Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIR trigger sensor - AX Pro event handling #2

Open
wifi75 opened this issue Feb 20, 2023 · 37 comments
Open

PIR trigger sensor - AX Pro event handling #2

wifi75 opened this issue Feb 20, 2023 · 37 comments
Assignees
Labels
enhancement New feature or request

Comments

@wifi75
Copy link

wifi75 commented Feb 20, 2023

hello below my HA log:

image

wy?

@petrleocompel
Copy link
Owner

petrleocompel commented Feb 20, 2023

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
Copy link
Owner

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 petrleocompel reopened this Feb 21, 2023
@petrleocompel petrleocompel changed the title Invalid detector Detector support "Magnetic contact" and "Curtain PIR" Feb 21, 2023
@wifi75
Copy link
Author

wifi75 commented Feb 21, 2023

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?

@petrleocompel
Copy link
Owner

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.

@wifi75
Copy link
Author

wifi75 commented Feb 21, 2023

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

@petrleocompel
Copy link
Owner

Did you also reload integration after that ?

@wifi75
Copy link
Author

wifi75 commented Feb 21, 2023

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

@petrleocompel
Copy link
Owner

petrleocompel commented Feb 21, 2023

"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)

@wifi75
Copy link
Author

wifi75 commented Feb 21, 2023

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

only_armed.log

@petrleocompel
Copy link
Owner

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

@wifi75
Copy link
Author

wifi75 commented Feb 21, 2023

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

@petrleocompel
Copy link
Owner

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

@wifi75
Copy link
Author

wifi75 commented Feb 21, 2023 via email

@petrleocompel
Copy link
Owner

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.

@wifi75
Copy link
Author

wifi75 commented Feb 21, 2023

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.

@petrleocompel
Copy link
Owner

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"?

@wifi75
Copy link
Author

wifi75 commented Feb 21, 2023

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

image

image

@wifi75
Copy link
Author

wifi75 commented Feb 21, 2023

then maybe icon missing

image

@petrleocompel
Copy link
Owner

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
Copy link
Owner

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

@wifi75
Copy link
Author

wifi75 commented Feb 22, 2023

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

@petrleocompel
Copy link
Owner

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

@wifi75
Copy link
Author

wifi75 commented Feb 22, 2023

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

@petrleocompel
Copy link
Owner

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.

@wifi75
Copy link
Author

wifi75 commented Feb 22, 2023

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!

@petrleocompel
Copy link
Owner

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)

@wifi75
Copy link
Author

wifi75 commented Feb 22, 2023

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

@petrleocompel
Copy link
Owner

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.

@wifi75
Copy link
Author

wifi75 commented Feb 22, 2023

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

@petrleocompel petrleocompel self-assigned this Feb 27, 2023
@petrleocompel petrleocompel changed the title Detector support "Magnetic contact" and "Curtain PIR" PIR trigger sensor - AX Pro event handling Feb 27, 2023
@petrleocompel
Copy link
Owner

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 petrleocompel added the enhancement New feature or request label Feb 27, 2023
@wifi75
Copy link
Author

wifi75 commented Feb 27, 2023

I understand... maybe add it in the readme so I understand what to do...

@petrleocompel
Copy link
Owner

I was poking around in AX Pro configuration. The only way how to handle these kind of things would be ARC sadly it seems it would work only when alarm is armed. Also depends a lot on protocol which is being used. And i guess the most info giving protocol is (proprietary) also the one I miss info about. I guess HikVision ISUP would give you most info but I do not see any documentation about how the receiver handles the requests.

@tiagoefreitas
Copy link

@petrleocompel it seems this project implements events, why not copy it?

https://github.com/Supergiovane/node-red-contrib-hikvision-ultimate

@petrleocompel
Copy link
Owner

petrleocompel commented Feb 27, 2024

@tiagoefreitas Are you sure? I just took a quick look but I do not see mention of PIR events from the AXPro system

@petrleocompel
Copy link
Owner

From code ... related to AXPro it only knows if system is armed or unarmed.

The "motion event" is camera related. That is not related to AXPro.

@tiagoefreitas
Copy link

From code ... related to AXPro it only knows if system is armed or unarmed.

The "motion event" is camera related. That is not related to AXPro.

Sorry I misunderstood then. Is it not possible to create one zone per sensor and get the status that way?

@petrleocompel
Copy link
Owner

Not really because PIR events are not handled by "device". normally this should be trigger from Alarm system to somewhere else. Currently I was promised some internal docs but no info provided yet. And sadly more important things are currently there on plan.

It seems we would have to be reflecting API to get this done. You can read the thread to get more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants