Store Binary Sensor Status and check it at certain time

I have a sensor that sends an MQTT message when it is open and closed. Which node should I use to update the sensor status and store this information whether its open or closed?

I want to check if the sensor status is open at 2pm and if it is then I want to send a msg.payload. Will I need another node for this action?

:slight_smile:

when incoming mqqt sensor value is received save the payload to context store. Then use inject node or another timer node to retrieve context stored value at 02:00 and check if open.
e.g.

[{"id":"32730060.fd6438","type":"inject","z":"5a245aa1.510164","name":"simulate mqtt node input closed","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"closed","payloadType":"str","x":280,"y":2680,"wires":[["f06bb65c.dd7ea"]]},{"id":"f06bb65c.dd7ea","type":"change","z":"5a245aa1.510164","name":"","rules":[{"t":"set","p":"sensor_blah","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":2700,"wires":[[]]},{"id":"5d9398b6.afb928","type":"inject","z":"5a245aa1.510164","name":"simulate mqtt node input open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"open","payloadType":"str","x":270,"y":2720,"wires":[["f06bb65c.dd7ea"]]},{"id":"74d2aa8d.c95f6c","type":"inject","z":"5a245aa1.510164","name":"at 02:00","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 02 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":2600,"wires":[["e161fa25.fbe788"]]},{"id":"e161fa25.fbe788","type":"switch","z":"5a245aa1.510164","name":"","property":"sensor_blah","propertyType":"flow","rules":[{"t":"eq","v":"open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":380,"y":2600,"wires":[["43216397.c9cc14"]]},{"id":"43216397.c9cc14","type":"debug","z":"5a245aa1.510164","name":"do something","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":600,"y":2600,"wires":[]}]

THANKS SO MUCH!

I should be able to get it working now!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.