Is it normal that the command to turn on the lamp will come every time, even if the lamp is already on?
And it seems that the switch node is not needed here. Messages can be received directly from timestamp 1 and 2.
The flow will do that. It shouldn't matter, but if it bothers you put a Filter node in the output to stop the repeats
If you haven't got the Switch then a motion end message when motion has not started will switch the light on.
You have removed the wire from the bottom inject to the change node
This is exactly how I realized it with my Hue Motion Sensors
Leopoll, of course you are right if considering this simple example. However, the occupied/not occupied message usually comes from one and the same node. Therefore, a switch node is required.
I am using the library "node-red-contrib-home-assistant-websocket" because the server based on Home Assistant. This library has a device node. This node specifies a trigger, so you get two different nodes for occupied/not occupied.
In that case then yes, you don't need the switch as that is effectively included in the HA nodes.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.