Skip to content

Instantly share code, notes, and snippets.

@GuySie
Last active August 17, 2020 11:19
Show Gist options
  • Save GuySie/1614e49ce6cb0227411e0538f3c7d3b4 to your computer and use it in GitHub Desktop.
Save GuySie/1614e49ce6cb0227411e0538f3c7d3b4 to your computer and use it in GitHub Desktop.
NodeRED - Light Art automatic on/off
[{"id":"6619be87.5300b","type":"bigtimer","z":"705d71ec.1ed62","outtopic":"","outpayload1":"","outpayload2":"","name":"Big Timer","comment":"","starttime":"480","endtime":"0","starttime2":0,"endtime2":0,"startoff":0,"endoff":0,"startoff2":0,"endoff2":0,"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,"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,"repeat":true,"atstart":true,"odd":false,"even":false,"x":140,"y":820,"wires":[[],[],["3189997d.7cf646"]]},{"id":"3189997d.7cf646","type":"switch","z":"705d71ec.1ed62","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":270,"y":820,"wires":[["77254241.f377ac"],["1b5c1f48.407df1"]]},{"id":"77254241.f377ac","type":"api-current-state","z":"705d71ec.1ed62","name":"Is Guy home?","version":1,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"person.guy","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":480,"y":740,"wires":[["ded15393.01b5d"],["53adfc2a.ae5ab4"]]},{"id":"53adfc2a.ae5ab4","type":"api-current-state","z":"705d71ec.1ed62","name":"Is Marrit home?","version":1,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"person.marrit","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":480,"y":800,"wires":[["ded15393.01b5d"],["1b5c1f48.407df1"]]},{"id":"90c99768.f1ad08","type":"api-call-service","z":"705d71ec.1ed62","name":"Turn on Light Art","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.extended_color_light_1","data":"{}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":760,"wires":[["4cd2d7f6.f8f4a8"]]},{"id":"cecbb21b.90a5e","type":"api-call-service","z":"705d71ec.1ed62","name":"Turn off Light Art","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.extended_color_light_1","data":"{}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":860,"wires":[["52d12623.edd378"]]},{"id":"bc042fc4.5046d","type":"server-state-changed","z":"705d71ec.1ed62","name":"If Guy leaves home","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"person.guy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"home","halt_if_type":"str","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":true,"x":170,"y":920,"wires":[["900759c6.01f348"],[]]},{"id":"900759c6.01f348","type":"api-current-state","z":"705d71ec.1ed62","name":"and Marrit is not home","version":1,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is_not","override_topic":false,"entity_id":"person.marrit","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":460,"y":920,"wires":[["1b5c1f48.407df1"],[]]},{"id":"4c795ac1.a7fc64","type":"server-state-changed","z":"705d71ec.1ed62","name":"If Marrit leaves home","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"person.marrit","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"home","halt_if_type":"str","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":true,"x":180,"y":980,"wires":[["161acb95.b332a4"],[]]},{"id":"161acb95.b332a4","type":"api-current-state","z":"705d71ec.1ed62","name":"and Guy is not home","version":1,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is_not","override_topic":false,"entity_id":"person.guy","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":460,"y":980,"wires":[["1b5c1f48.407df1"],[]]},{"id":"f304a152.db35c","type":"server-state-changed","z":"705d71ec.1ed62","name":"If Guy comes home","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"person.guy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"home","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":170,"y":640,"wires":[["cfd0498.dd5c8b8"],[]]},{"id":"b40caaa2.7158f8","type":"server-state-changed","z":"705d71ec.1ed62","name":"If Marrit comes home","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"person.marrit","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"home","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":180,"y":700,"wires":[["cfd0498.dd5c8b8"],[]]},{"id":"cfd0498.dd5c8b8","type":"time-range-switch","z":"705d71ec.1ed62","name":"Between 08:00 and 00:00","startTime":"08:00","endTime":"00:00","startOffset":0,"endOffset":0,"x":450,"y":640,"wires":[["ded15393.01b5d"],[]]},{"id":"1b5c1f48.407df1","type":"api-current-state","z":"705d71ec.1ed62","name":"Is Light Art on?","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is_not","override_topic":false,"entity_id":"light.extended_color_light_1","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":720,"y":860,"wires":[["cecbb21b.90a5e"],[]]},{"id":"ded15393.01b5d","type":"api-current-state","z":"705d71ec.1ed62","name":"Is Light Art off?","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.extended_color_light_1","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":720,"y":760,"wires":[["90c99768.f1ad08"],[]]},{"id":"4cd2d7f6.f8f4a8","type":"api-call-service","z":"705d71ec.1ed62","name":"Turn on Color Flow","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.light_art_color_flow","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1190,"y":760,"wires":[[]]},{"id":"52d12623.edd378","type":"api-call-service","z":"705d71ec.1ed62","name":"Turn off Color Flow","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.light_art_color_flow","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1190,"y":860,"wires":[[]]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment