I am very new to Node-Red. I am using Homeseer automation for lighting control. Using Homeseer's documentation (and hours of experimentation) I was able to create a NR flow to have an outdoor motion sensor cause my Amazon Echo devices to announce "Motion detected" when the sensor is triggered.
However, I don't want this to happen during nighttime hours.
My question is, how do I add a node to my system that lets my flow determine the time of day, so I can use a switch node (?) to only allow the Echo trigger during specific hours of the day? I am using NR 4.0.9
TIA
You could use the time range switch node.
You could also use a switch node and a JSONata expresstion to output time and check if betweeen times in 24hr format
e.g.
[{"id":"14e67ff4e0591ac4","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":" { \"relay\":0, \"on\":true }","payloadType":"json","x":330,"y":2220,"wires":[["675924b00eaaa4da"]]},{"id":"675924b00eaaa4da","type":"switch","z":"d1395164b4eec73e","name":"","property":"$number($moment().format(\"Hmm\"))","propertyType":"jsonata","rules":[{"t":"btwn","v":"700","vt":"num","v2":"2200","v2t":"num"}],"checkall":"true","repair":false,"outputs":1,"x":490,"y":2220,"wires":[["4c147035c4b63827"]]},{"id":"4c147035c4b63827","type":"debug","z":"d1395164b4eec73e","name":"debug 2565","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":2220,"wires":[]}]
Should only pass message if between 700 (7 am) and 2200 (10pm)
Sounds like just what I need. But, being a complete newbie to node-red, when the install instructions say to "change directory to your node-red installation", exactly which Windows directory would this be? I can see the NR installation created more than one.
I tried installing another node, and it did not appear in my node list, so perhaps I wasn't in the correct directory when I issued the command.
Thanks
In the right top hamburger menu, you can install nodes via manage palette
Got it. Thanks!
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.