TP Link Kasa

Flow to control run time of my TP-Link Kasa switches. Used in conjunction with inputs in Homeassistant to adjust run time. Also schedules the circle led on the switches to turn off at night.

[{"id":"44a865623fafc872","type":"tab","label":"Master Bedroom","disabled":false,"info":""},{"id":"c9dd59b3761bdb67","type":"server-state-changed","z":"44a865623fafc872","name":"HS220 LED auto or off","server":"8cd93e38.ec024","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.hs220_led","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"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":"10.1.1.52","valueType":"str"}],"x":120,"y":80,"wires":[["17c08871eadd51a3"]]},{"id":"ecf4445bb3721442","type":"kasa","z":"44a865623fafc872","name":"Dimmer Switch","device":"10.1.1.52","interval":60000,"eventInterval":15000,"payload":"getInfo","payloadType":"info","debug":false,"x":1100,"y":80,"wires":[[]]},{"id":"af21b7291cc81276","type":"server-state-changed","z":"44a865623fafc872","name":"HS200 LED auto or off","server":"8cd93e38.ec024","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.hs200_led","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"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.led","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"10.1.1.53","valueType":"str"}],"x":120,"y":160,"wires":[["d74512ce16d58aad"]]},{"id":"3b20507ce2589f60","type":"switch","z":"44a865623fafc872","name":"","property":"payload.led","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":690,"y":160,"wires":[["fa591570e4baa5f1"],["86657436d4356c30"]]},{"id":"fa591570e4baa5f1","type":"change","z":"44a865623fafc872","name":"true","rules":[{"t":"change","p":"payload.led","pt":"msg","from":"on","fromt":"str","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":140,"wires":[["38c5e550bc677723"]]},{"id":"86657436d4356c30","type":"change","z":"44a865623fafc872","name":"false","rules":[{"t":"change","p":"payload.led","pt":"msg","from":"off","fromt":"str","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":180,"wires":[["38c5e550bc677723"]]},{"id":"55e3adc65a5caa40","type":"kasa","z":"44a865623fafc872","name":"Fan","device":"10.1.1.53","interval":60000,"eventInterval":15000,"payload":"getInfo","payloadType":"info","debug":false,"x":1070,"y":160,"wires":[[]]},{"id":"71f651db6185ec4d","type":"switch","z":"44a865623fafc872","name":"","property":"payload.led","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":690,"y":80,"wires":[["f3ce989bd25fe817"],["33c011072546d527"]]},{"id":"f3ce989bd25fe817","type":"change","z":"44a865623fafc872","name":"true","rules":[{"t":"change","p":"payload.led","pt":"msg","from":"on","fromt":"str","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":60,"wires":[["6c812688c73bdad9"]]},{"id":"33c011072546d527","type":"change","z":"44a865623fafc872","name":"false","rules":[{"t":"change","p":"payload.led","pt":"msg","from":"off","fromt":"str","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":100,"wires":[["6c812688c73bdad9"]]},{"id":"20bd338727f94bad","type":"bigtimer","z":"44a865623fafc872","outtopic":"","outpayload1":"on","outpayload2":"off","name":"Big Timer","comment":"","lat":"38.84991409539333","lon":"-91.14301867714474","starttime":"5003","endtime":"1260","starttime2":0,"endtime2":0,"startoff":0,"endoff":"0","startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","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":0,"month7":0,"day8":0,"month8":0,"day9":0,"month9":0,"day10":0,"month10":0,"day11":0,"month11":0,"day12":0,"month12":0,"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":0,"xmonth7":0,"xday8":0,"xmonth8":0,"xday9":0,"xmonth9":0,"xday10":0,"xmonth10":0,"xday11":0,"xmonth11":0,"xday12":0,"xmonth12":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,"randon1":false,"randoff1":false,"randon2":false,"randoff2":false,"repeat":false,"atstart":true,"odd":false,"even":false,"x":440,"y":80,"wires":[["45b7a5b3794e516b"],[],[]]},{"id":"45b7a5b3794e516b","type":"change","z":"44a865623fafc872","name":"move","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.led","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":80,"wires":[["71f651db6185ec4d"]]},{"id":"17c08871eadd51a3","type":"change","z":"44a865623fafc872","name":"change","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"auto","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":80,"wires":[["20bd338727f94bad"]]},{"id":"2805c37e4e0c3fef","type":"bigtimer","z":"44a865623fafc872","outtopic":"","outpayload1":"on","outpayload2":"off","name":"Big Timer","comment":"","lat":"38.84991409539333","lon":"-91.14301867714474","starttime":"5003","endtime":"1260","starttime2":0,"endtime2":0,"startoff":0,"endoff":"0","startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","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":0,"month7":0,"day8":0,"month8":0,"day9":0,"month9":0,"day10":0,"month10":0,"day11":0,"month11":0,"day12":0,"month12":0,"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":0,"xmonth7":0,"xday8":0,"xmonth8":0,"xday9":0,"xmonth9":0,"xday10":0,"xmonth10":0,"xday11":0,"xmonth11":0,"xday12":0,"xmonth12":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,"randon1":false,"randoff1":false,"randon2":false,"randoff2":false,"repeat":false,"atstart":true,"odd":false,"even":false,"x":440,"y":160,"wires":[["0088bc6b8463bb28"],[],[]]},{"id":"d74512ce16d58aad","type":"change","z":"44a865623fafc872","name":"change","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"auto","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":160,"wires":[["2805c37e4e0c3fef"]]},{"id":"0088bc6b8463bb28","type":"change","z":"44a865623fafc872","name":"move","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.led","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":160,"wires":[["3b20507ce2589f60"]]},{"id":"686bdd106529a387","type":"server-state-changed","z":"44a865623fafc872","d":true,"name":"Turn HS220 LED indicator on/off","server":"8cd93e38.ec024","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.hs220_led","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"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.led","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"10.1.1.52","valueType":"str"}],"x":150,"y":820,"wires":[["d8973177d14ad80f"]]},{"id":"1d7c9c37d7b2340e","type":"kasa","z":"44a865623fafc872","d":true,"name":"Dimmer Switch","device":"10.1.1.52","interval":60000,"eventInterval":15000,"payload":"getInfo","payloadType":"info","debug":false,"x":860,"y":820,"wires":[[]]},{"id":"493042dac095e08d","type":"server-state-changed","z":"44a865623fafc872","d":true,"name":"Turn HS200 LED indicator on/off","server":"8cd93e38.ec024","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.hs200_led","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"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.led","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"10.1.1.53","valueType":"str"}],"x":150,"y":980,"wires":[["4e80ea7b87213b3d"]]},{"id":"4e80ea7b87213b3d","type":"switch","z":"44a865623fafc872","name":"","property":"payload.led","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":980,"wires":[["b8600ce87671e3f8"],["c8c1dc9cd7c0c580"]]},{"id":"b8600ce87671e3f8","type":"change","z":"44a865623fafc872","name":"","rules":[{"t":"change","p":"payload.led","pt":"msg","from":"on","fromt":"str","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":960,"wires":[["2dac2069d895c899","703c7b3239ca9245"]]},{"id":"c8c1dc9cd7c0c580","type":"change","z":"44a865623fafc872","name":"","rules":[{"t":"change","p":"payload.led","pt":"msg","from":"off","fromt":"str","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":1000,"wires":[["2dac2069d895c899","76f23e8637ecfca9"]]},{"id":"2dac2069d895c899","type":"kasa","z":"44a865623fafc872","d":true,"name":"Fan","device":"10.1.1.53","interval":60000,"eventInterval":15000,"payload":"getInfo","payloadType":"info","debug":false,"x":830,"y":980,"wires":[[]]},{"id":"d8973177d14ad80f","type":"switch","z":"44a865623fafc872","name":"","property":"payload.led","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":820,"wires":[["e3b873a9a1ef16db"],["03dc48ad29f7f3de"]]},{"id":"e3b873a9a1ef16db","type":"change","z":"44a865623fafc872","name":"","rules":[{"t":"change","p":"payload.led","pt":"msg","from":"on","fromt":"str","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":800,"wires":[["1d7c9c37d7b2340e","196b8e4b6425618a"]]},{"id":"03dc48ad29f7f3de","type":"change","z":"44a865623fafc872","name":"","rules":[{"t":"change","p":"payload.led","pt":"msg","from":"off","fromt":"str","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":840,"wires":[["1d7c9c37d7b2340e","e15972a288eaa0ba"]]},{"id":"b04b4a86d36a726c","type":"bigtimer","z":"44a865623fafc872","d":true,"outtopic":"","outpayload1":"on","outpayload2":"off","name":"Big Timer","comment":"","lat":"38.84991409539333","lon":"-91.14301867714474","starttime":"5003","endtime":"1260","starttime2":0,"endtime2":0,"startoff":0,"endoff":"0","startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","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":0,"month7":0,"day8":0,"month8":0,"day9":0,"month9":0,"day10":0,"month10":0,"day11":0,"month11":0,"day12":0,"month12":0,"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":0,"xmonth7":0,"xday8":0,"xmonth8":0,"xday9":0,"xmonth9":0,"xday10":0,"xmonth10":0,"xday11":0,"xmonth11":0,"xday12":0,"xmonth12":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,"randon1":false,"randoff1":false,"randon2":false,"randoff2":false,"repeat":false,"atstart":true,"odd":false,"even":false,"x":200,"y":900,"wires":[["44bc99a653b7d088"],[],[]]},{"id":"44bc99a653b7d088","type":"change","z":"44a865623fafc872","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.led","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":900,"wires":[["d8973177d14ad80f","4e80ea7b87213b3d"]]},{"id":"e15972a288eaa0ba","type":"api-call-service","z":"44a865623fafc872","d":true,"name":"","server":"8cd93e38.ec024","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.hs220_led","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":860,"wires":[[]]},{"id":"196b8e4b6425618a","type":"api-call-service","z":"44a865623fafc872","d":true,"name":"","server":"8cd93e38.ec024","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.hs220_led","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":780,"wires":[[]]},{"id":"703c7b3239ca9245","type":"api-call-service","z":"44a865623fafc872","d":true,"name":"","server":"8cd93e38.ec024","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.hs200_led","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":940,"wires":[[]]},{"id":"76f23e8637ecfca9","type":"api-call-service","z":"44a865623fafc872","d":true,"name":"","server":"8cd93e38.ec024","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.hs200_led","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":1020,"wires":[[]]},{"id":"6f73a16deec0aa06","type":"comment","z":"44a865623fafc872","name":"LED indicator ","info":"On = follow big timer scheadule\noff = led off all the time","x":90,"y":40,"wires":[]},{"id":"56a6ad4003d285bf","type":"comment","z":"44a865623fafc872","name":"Light/Fan run time","info":"Run time for Light and Fan \n\nCurrently hard coded for 1 hour\n\nFuture plan for run time to be controlled from home assistant input number slider","x":110,"y":280,"wires":[]},{"id":"582adf2bf711b6fd","type":"comment","z":"44a865623fafc872","name":"LED on/off alternative (disabled, using other flow)","info":"alternative on off flow for LED - current\n\nNot sure which one to keep","x":210,"y":760,"wires":[]},{"id":"e4d68d770c813a35","type":"delay","z":"44a865623fafc872","name":"delay","pauseType":"delayv","timeout":"1","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"x":850,"y":320,"wires":[["2f0f2e698657578f"]]},{"id":"2c54f54db7e1fbad","type":"server-state-changed","z":"44a865623fafc872","name":"Lights","server":"8cd93e38.ec024","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"light.ds_m_bed","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"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"}],"x":70,"y":320,"wires":[["b171b50a4824c77d"]]},{"id":"b171b50a4824c77d","type":"api-current-state","z":"44a865623fafc872","name":"Run time","server":"8cd93e38.ec024","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.hs220_mb","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"delay","propertyType":"msg","value":"","valueType":"entityState"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":220,"y":320,"wires":[["0e57e268980e4c70"]]},{"id":"0e57e268980e4c70","type":"rbe","z":"44a865623fafc872","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":350,"y":320,"wires":[["8d7e04352ef4676b"]]},{"id":"8d7e04352ef4676b","type":"switch","z":"44a865623fafc872","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":470,"y":320,"wires":[["7b08c7b69c1e6255"],["bef507225ac04f02"]]},{"id":"bef507225ac04f02","type":"change","z":"44a865623fafc872","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":340,"wires":[["e4d68d770c813a35"]]},{"id":"2f0f2e698657578f","type":"change","z":"44a865623fafc872","name":"off","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":320,"wires":[["696772e2cbcf163c"]]},{"id":"7b08c7b69c1e6255","type":"change","z":"44a865623fafc872","name":"millisecs to minutes","rules":[{"t":"set","p":"delay","pt":"msg","to":"msg.delay*60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":300,"wires":[["e4d68d770c813a35"]]},{"id":"f0fb6b069f9cc41d","type":"delay","z":"44a865623fafc872","name":"delay","pauseType":"delayv","timeout":"1","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"x":850,"y":400,"wires":[["10c28c5074af2f33"]]},{"id":"fbb0a5dbb9ee4de0","type":"server-state-changed","z":"44a865623fafc872","name":"Fan","server":"8cd93e38.ec024","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.mb_fan","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"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"}],"x":70,"y":400,"wires":[["a5b87201467f32b9"]]},{"id":"a5b87201467f32b9","type":"api-current-state","z":"44a865623fafc872","name":"Run time","server":"8cd93e38.ec024","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.hs220_mb","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"delay","propertyType":"msg","value":"","valueType":"entityState"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":220,"y":400,"wires":[["e5a9d63b5bec69a1"]]},{"id":"e5a9d63b5bec69a1","type":"rbe","z":"44a865623fafc872","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":350,"y":400,"wires":[["984539454769fdf1"]]},{"id":"984539454769fdf1","type":"switch","z":"44a865623fafc872","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":470,"y":400,"wires":[["0819602b5bde4630"],["e1cfab173c6663d3"]]},{"id":"e1cfab173c6663d3","type":"change","z":"44a865623fafc872","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":420,"wires":[["f0fb6b069f9cc41d"]]},{"id":"10c28c5074af2f33","type":"change","z":"44a865623fafc872","name":"off","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":400,"wires":[["c2ed0c1e52800e23"]]},{"id":"0819602b5bde4630","type":"change","z":"44a865623fafc872","name":"millisecs to minutes","rules":[{"t":"set","p":"delay","pt":"msg","to":"msg.delay*60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":380,"wires":[["f0fb6b069f9cc41d"]]},{"id":"497f3cd4fa728f92","type":"link in","z":"44a865623fafc872","name":"Master Bedroom Dimmer switch","links":["6c812688c73bdad9","696772e2cbcf163c"],"x":975,"y":80,"wires":[["ecf4445bb3721442"]]},{"id":"7f60ac558d54ba9d","type":"link in","z":"44a865623fafc872","name":"Master Bedroom Dimmer Fan","links":["38c5e550bc677723","c2ed0c1e52800e23"],"x":975,"y":160,"wires":[["55e3adc65a5caa40"]]},{"id":"696772e2cbcf163c","type":"link out","z":"44a865623fafc872","name":"Master Bedroom Dimmer switch","links":["497f3cd4fa728f92"],"x":1055,"y":320,"wires":[]},{"id":"6c812688c73bdad9","type":"link out","z":"44a865623fafc872","name":"Master Bedroom Dimmer switch","links":["497f3cd4fa728f92"],"x":895,"y":80,"wires":[]},{"id":"38c5e550bc677723","type":"link out","z":"44a865623fafc872","name":"Master Bedroom Dimmer switch","links":["7f60ac558d54ba9d"],"x":895,"y":160,"wires":[]},{"id":"c2ed0c1e52800e23","type":"link out","z":"44a865623fafc872","name":"Master Bedroom Dimmer switch","links":["7f60ac558d54ba9d"],"x":1055,"y":400,"wires":[]},{"id":"8cd93e38.ec024","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Flow Info

Created 3 years, 9 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x19)
  • comment (x3)
  • delay (x2)
  • link in (x2)
  • link out (x4)
  • rbe (x2)
  • switch (x6)
Other

Tags

  • TP-Link
  • Kasa
  • hs200
  • hs220
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option