Hi, I'm trying to build little tricky flow for purpose as follows:
I have the Hikvision IP camera installed on door and this camera is sending alarm to Node-RED using hikvision-alarm-in when detect motion. In debug window I have:
object
code: "VideoMotion"
action: "Start"
index: 1
time: "2020-11-30T19:50:07.830Z"
Now I need to publish status "motion" or "idle" on HTTP endpoint that can be readable with javascript on another Raspberry Pi that displaying camera images and switching cameras based on motion event. This script is updating every 1 second, so I want to query NodeRED every 1 second via HTTP GET if the motion alarm from camera was recevied.
But I don't know how to switch variable status based on action: "Start"
and "Stop"
message received from Hikvision node and work with this status in HTTP response.
Thanks for your help.