Hi all. I’d appreciate a second set of eyes on this. I have a Hikvision NVR system and have a line crossing motion trigger setup and integrated it into HA. HA receives reports of movement correctly but I just can’t get the automation to run. As it’s a binary sensor, I’m aware it is either off or on, even though the HA interface shows ‘clear’ or ‘detected’, but for the life of me, I just can’t seem to get it to then run my automation.
You need to look at the entity in the states page to tell you what states are reported. It just might be that you really do need to use ‘detected’ as the state to trigger the automation.
check to make sure the state for the binary_sensor you’re using changes, too. I don’t see why it wouldn’t be since it’s showing up in the interface but just as a dummy check.
also maybe the automation is actually triggering but the action you think should be happening isn’t being taken. check the log to see if the automation triggers.
You know I really thought I was getting to understand this programming… Thanks for your assistant. From what I understand then, triggers work on OR, so for each of my sensors I could have just one automation - would that be correct?
e.g.
trigger:
- platform: state
entity_id: binary_sensor.network_video_recorder_line_crossing_2
to: 'on'
- platform: state
entity_id: binary_sensor.network_video_recorder_line_crossing_1
to: 'on'
- platform: state
entity_id: binary_sensor.network_video_recorder_motion_2
to: 'on'
if either of these activated, then the automation would run?
Thanks everyone. Been testing with having it active after sunrise and before sunset and it’s coming on now as expected. Now to amend this the other way around and wait for this evening. Thanks for all your help. You’ve saved my sanity for another day.
I have 4 cameras - 1 NVR. The line recorder only triggers to ‘on’ for less than a second and I read somewhere that the default was 5 seconds in which it had to be at the particular state before notifying HA. Perhaps I misread…
I’ve been working on it for a few days and my brain has turned into mush. At the moment, the sensors activate perfectly. I’ll fine tune it once it works after testing this evening, but at the moment, as the sensor is reacting as I would like, I’m avoiding changing it…