hikaxpro_hacs icon indicating copy to clipboard operation
hikaxpro_hacs copied to clipboard

PIR trigger sensor - AX Pro event handling

Open wifi75 opened this issue 2 years ago • 37 comments

hello below my HA log:

image

wy?

wifi75 avatar Feb 20 '23 15:02 wifi75

I pushed a change to get more info from log. If you have chance please provide log after update. Otherwise I am going to add these detectors without more properties (magnet state, curtains state etc...)

petrleocompel avatar Feb 20 '23 16:02 petrleocompel

a question but why do the Wireless PIR AM curtain detectors only display the temperature, not the presence? @wifi75

Currently I don't have this detector. So it is hard for me tu understand what it does while triggered or clear. What I see from logs:

{
	"id": 1,
	"name": "Pir Giardino ",
	"status": "online",
	"sensorStatus": "normal",
	"tamperEvident": false,
	"shielded": false,
	"bypassed": false,
	"armed": false,
	"isArming": false,
	"alarm": false,
	"charge": "normal",
	"chargeValue": 100,
	"signal": 121,
	"temperature": 5,
	"subSystemNo": 1,
	"linkageSubSystem": [1],
	"detectorType": "wirelessDTAMCurtainDetector",
	"model": "0x00032",
	"stayAway": false,
	"zoneType": "Instant",
	"isViaRepeater": false,
	"mountingType": "wall",
	"antiMaskingEnabled": true,
	"zoneAttrib": "wireless",
	"version": "V1.2.3",
	"deviceNo": 1,
	"abnormalOrNot": false
}

Normally on magnetic sensor is attribute magnet_open_status.

I added logging on "refresh". If you would trigger the sensor and with enabled logging reloaded the integration it will spill line with Adding device: %s with device info. Please do that with triggered state and calm state. Provide logs and i can compare the difference and find which attribute is used on this sensor. If you miss something on the second "magnet sensor" do the same trick.

petrleocompel avatar Feb 21 '23 09:02 petrleocompel

If I understand correctly, do I have to activate the pir and then make it return to normal status and do I have to send you the Home Assistant log?

wifi75 avatar Feb 21 '23 09:02 wifi75

Yes.

Sadly this reload should be done immediately after triggering (so on phone or with cooperation with somebody - if the trigger is just for few seconds). Currently I don't have better way. But if it is persistent presence it is easier.

petrleocompel avatar Feb 21 '23 09:02 petrleocompel

Hi, I enabled the debug of the latest version, I activated the pir sending AXPRO in alarm, but I don't see any events written about it in the log

wifi75 avatar Feb 21 '23 11:02 wifi75

Did you also reload integration after that ?

petrleocompel avatar Feb 21 '23 11:02 petrleocompel

yes of course, I set axpro in armed_away and my wife showed up on one of the pir sensors outside the house...

wifi75 avatar Feb 21 '23 11:02 wifi75

"reload should be done immediately after triggering"

Sadly I have no other way how to get this log better (otherwise i would log every message... And i would fill up your log immediately)

petrleocompel avatar Feb 21 '23 11:02 petrleocompel

this log it is only armed... but not triggered

only_armed.log

wifi75 avatar Feb 21 '23 11:02 wifi75

I see only "warnings". Did you enable debug (again) on the integration?

petrleocompel avatar Feb 21 '23 11:02 petrleocompel

if I enable debugging and then reload, it downloads a file and debugging is disabled, is that correct?

wifi75 avatar Feb 21 '23 12:02 wifi75

Okay I found the problem 🙁 There is change needed. Reloading cause the session to end. Update will be in minutes.

petrleocompel avatar Feb 21 '23 12:02 petrleocompel

ok! the first one Peter!

Il giorno mar 21 feb 2023 alle ore 13:39 Petr Leo Compel < @.***> ha scritto:

Okay I found the problem 🙁 There is change needed. Reloading cause the session to end. Update will be in minutes.

— Reply to this email directly, view it on GitHub https://github.com/petrleocompel/hikaxpro_hacs/issues/2#issuecomment-1438412551, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSXUJY54QY2CN7HTNZMZDTWYSZP5ANCNFSM6AAAAAAVB7ZQHU . You are receiving this because you were mentioned.Message ID: @.***>

-- Grazie

wifi75 avatar Feb 21 '23 12:02 wifi75

Okay No change is needed! There is debug,... debug recording needs to be at least 1 minute long during that time if you would trigger I should see the change. In log should DEBUG Zones: .... apear.

petrleocompel avatar Feb 21 '23 12:02 petrleocompel

ok then I activate the debug without reloading, then armed_away and I show myself from the PIR sensor. then I reload, take the file and paste it here.

wifi75 avatar Feb 21 '23 12:02 wifi75

Yes try that. Hopefully we will get everything. I don't think you have to "arm" for triggering the sensors. (The state is sent even when system is not armed).

Maybe there is misunderstanding on my side... 🤦‍♂️ did you mean by "presence" the "PIR detection trigger"?

petrleocompel avatar Feb 21 '23 12:02 petrleocompel

yes exactly, when a PIR detection trigger occurs in HA the sensor must change state ....

image

image

wifi75 avatar Feb 21 '23 12:02 wifi75

then maybe icon missing

image

wifi75 avatar Feb 21 '23 12:02 wifi75

yes exactly, when a PIR detection trigger occurs in HA the sensor must change state .... image

Sadly checked on my side with my PIR sensors. I was too focused on other aspects of that detector... PIR sensor do not sent any info about this presence state. That page is same page as in HikVision app "device page". Even in their app sensors do not report info about "PIR presence state".

Only possibility are "zones/areas"

{
	"SubSysList": [{
		"SubSys": {
			"id": 1,
			"arming": "disarm",
			"alarm": false,
			"enabled": true,
			"name": "Oblast 1",
			"delayTime": 0
		}
	}, ...]
}

On these "areas" we could get Armed state and report it. But it is not possible on the "device".

petrleocompel avatar Feb 21 '23 13:02 petrleocompel

IMG_E48DDAA47F91-1 Example device page. This informations are available on "PIR Sensors"

petrleocompel avatar Feb 21 '23 13:02 petrleocompel

if you can't have this function, it doesn't matter..

wifi75 avatar Feb 22 '23 08:02 wifi75

What is target functionality? It might be possible to do by “areas”.

petrleocompel avatar Feb 22 '23 08:02 petrleocompel

Please explain what you mean, I don't understand.

wifi75 avatar Feb 22 '23 08:02 wifi75

Target usage of this in HA. If i would create for each “area” a component with alarm attribute you could get info in HA what zone triggered alarm. Or it could be attribute on the system device.

petrleocompel avatar Feb 22 '23 08:02 petrleocompel

you know that maybe I have a doubt that both the internal and external pir sensors are activated only when you activate the AXPRO control unit. however anything you can integrate surely can be useful to create scenes or automations.. it would have been nice to have been able to have a sensor in the HA that indicates if there was movement in the pir, for example it will turn on an external light!

wifi75 avatar Feb 22 '23 08:02 wifi75

I will see what API offers to us. But from my current knowledge it is possible to get this info only when system is armed and only in "area" (so if you have multiple sensors in one area you don't know which one did was the trigger)

Otherwise it would have to be done in otherway (system calling HA) and that is not easy. (At least for me, don't know if it is supported but i guess it is). It would require configuration on AXPro and I guess it would still work only for armed system. (but you would get info what detector is origin)

petrleocompel avatar Feb 22 '23 08:02 petrleocompel

I forgot one more thing, the integration takes place via local ip, but why is it slow in changing state?

wifi75 avatar Feb 22 '23 08:02 wifi75

There is by default a 30 seconds interval defined from HA (can be changed). I can add to set up a field for this to be tweaked. But simply that is the reason.

petrleocompel avatar Feb 22 '23 08:02 petrleocompel

it would be very useful to be able to change that tempo!

wifi75 avatar Feb 22 '23 09:02 wifi75

This can be fixed @wifi75 but only with "hooks" implementation and configuration of "alarm system" to send triggers to HA. But HA has to be reachable by your AXPro.

petrleocompel avatar Feb 27 '23 14:02 petrleocompel