Hello,
I am new to Node Red and am having an issue with a couple of Home Assistant (core-2021.11.5 & Node Red 10.1.1) automations and hope someone can help me with them.
The first one is controlling an outlet for Christmas lights where it turns on at sunset and turns off at 11PM local time. I redid the flow using a Bigtimer node but think I still have an issue. I have an input boolean for the automation which is either on or off. If it’s on, it should check if it’s after sunset in which it should turn on the outlet and then turn off the lights at 11PM local. I have been able to make I work but the next day, since the input boolean has not changed, the flow does not run since the input boolean event has not changed since the flow last ran. How do I reset the flow so that it runs each day? Here’s the flow for this one:
[{"id":"8a1ad810af4421e2","type":"tab","label":"Outside Christmas Lights","disabled":false,"info":"","env":[]},{"id":"75abe4318e1084a1","type":"api-call-service","z":"8a1ad810af4421e2","name":"Turn On Front Door Outlet","server":"9e5c2d85.48958","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.front_door_outlet","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":790,"y":220,"wires":[[]]},{"id":"44366fe55aa12da2","type":"api-call-service","z":"8a1ad810af4421e2","name":"Turn Off Front Door Outlet","server":"9e5c2d85.48958","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.front_door_outlet","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":790,"y":280,"wires":[[]]},{"id":"3895d0a3.e05bb","type":"bigtimer","z":"8a1ad810af4421e2","outtopic":"","outpayload1":"on","outpayload2":"off","name":"Sunset to 2300","comment":"","lat":"28.4188","lon":"-81.5818","starttime":"5004","endtime":"1380","startoff":0,"endoff":0,"startoff2":"","endoff2":"","offs":"0","outtext1":"on","outtext2":"off","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"day7":"","month7":"","day8":"","month8":"","day9":"","month9":"","day10":"","month10":"","day11":"","month11":"","day12":"","month12":"","d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xday7":"","xmonth7":"","xday8":"","xmonth8":"","xday9":"","xmonth9":"","xday10":"","xmonth10":"","xday11":"","xmonth11":"","xday12":"","xmonth12":"","xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"randon1":false,"randoff1":false,"randon2":false,"randoff2":false,"repeat":false,"atstart":true,"odd":false,"even":false,"x":320,"y":220,"wires":[["a8b74b4e.79fbb8"],[],[]]},{"id":"a8b74b4e.79fbb8","type":"switch","z":"8a1ad810af4421e2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":220,"wires":[["75abe4318e1084a1"],["44366fe55aa12da2"]]},{"id":"0569affe1bf28b4b","type":"api-current-state","z":"8a1ad810af4421e2","name":"Christmas Light Automation On?","server":"9e5c2d85.48958","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.christmas_lights_auto","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":230,"y":80,"wires":[["3895d0a3.e05bb"],[]]},{"id":"9e5c2d85.48958","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
The second one deals with turning on an LED light in the kitchen from 10PM to sunrise. I tried a different approach on this one and I can get it to turn on each night but it doesn’t turn off at sunrise. I’m sure this is not the most elegant way or even the right way to do it but I want to turn on the kitchen LED strip if the kitchen light is off and it’s after 10PM local time and turn the LED off at sunrise the next day. If the kitchen light is turned on after 10PM local, turn the LED light off which then should be turned back on after the kitchen light is turned off for the hours between 10PM local and sunrise the next day. Here’s that flow.
[{"id":"38ba2ab7bd5fa30b","type":"tab","label":"Kitchen LED Light","disabled":false,"info":"","env":[]},{"id":"69031d2cf2a77670","type":"server-state-changed","z":"38ba2ab7bd5fa30b","name":"Kitchen Light Off","server":"9e5c2d85.48958","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"light.kitchen","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":120,"wires":[["9851d1e1c0e59cdf"],[]]},{"id":"9851d1e1c0e59cdf","type":"time-range-switch","z":"38ba2ab7bd5fa30b","name":"10PM to Sunrise","lat":"28.4188","lon":"-81.5818","startTime":"22:00","endTime":"sunrise","startOffset":0,"endOffset":0,"x":370,"y":120,"wires":[["bbb8c148f41b0366"],[]]},{"id":"bbb8c148f41b0366","type":"api-call-service","z":"38ba2ab7bd5fa30b","name":"Turn Kitchen LED Lights On","server":"9e5c2d85.48958","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.kitchen_led_lights","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":620,"y":120,"wires":[["230cf9ea605c5a53"]]},{"id":"477fadcc7a16675c","type":"api-call-service","z":"38ba2ab7bd5fa30b","name":"Turn Kitchen LED Lights Off","server":"9e5c2d85.48958","version":3,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.kitchen_led_lights","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":240,"wires":[[]]},{"id":"ba3b25789a6eaf10","type":"server-state-changed","z":"38ba2ab7bd5fa30b","name":"Kitchen Light On","server":"9e5c2d85.48958","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"light.kitchen","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":340,"wires":[["515cac025cc019b4"],[]]},{"id":"515cac025cc019b4","type":"time-range-switch","z":"38ba2ab7bd5fa30b","name":"10PM to Sunrise","lat":"28.4188","lon":"-81.5818","startTime":"22:00","endTime":"sunrise","startOffset":0,"endOffset":0,"x":370,"y":340,"wires":[["bf11d14f84e07303"],[]]},{"id":"bf11d14f84e07303","type":"api-call-service","z":"38ba2ab7bd5fa30b","name":"Turn Kitchen LED Lights Off","server":"9e5c2d85.48958","version":3,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.kitchen_led_lights","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":620,"y":340,"wires":[[]]},{"id":"230cf9ea605c5a53","type":"ha-wait-until","z":"38ba2ab7bd5fa30b","name":"Wait until Sunrise","server":"9e5c2d85.48958","version":0,"outputs":1,"entityId":"sun.sun","entityIdFilterType":"exact","property":"attributes.rising","comparator":"is","value":"true","valueType":"str","timeout":0,"timeoutType":"num","timeoutUnits":"seconds","entityLocation":"data","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":false,"x":870,"y":120,"wires":[["477fadcc7a16675c"]]},{"id":"9e5c2d85.48958","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
Appreciate any help. I’ve read through the bigtimer node and looked through the sites for similar questions but am coming short on how to do this simple automation properly.
Thanks!