Untitled

                Never    
JSON
       
[{"id":"766ec4c8.e67b7c","type":"tab","label":"House state","disabled":false,"info":"# House mode flow\nThis flow manages the house mode. Currently supported\nflows are \n- Morgon\n- Dag\n- Kväll\n- Natt\n- Städning\n\n\n## Triggers\n**Morning** triggers on sunrise with offset.\n**Day** triggers on set time when morning ends\n**Evening** triggers on sunset but will wait\none hour if it is not cloudy (yr.no sensor).\nThis is a way to manage darker due to clouds.\n**Night** triggers on specifik time that differs \non weekdays and weekends\n\n_IMPORTANT I use the swedish words for actual modes.\nMorgon, Dag, Kväll och Natt._\n\n## input_select is the master\nThe Hass input select is master so any trigger \nchange the state of the inputselect.\n\nThe global variable is initialized at startup from\ninput_select value\n\n## The global varable house_mode\nNew state sets the global var house_mode to use in \nother automations for easy access\n\n## EV_HOUSE_MODE_CHANGED Event\nAny change in house_mode sends event with\nnew: the new mode\nold: the old mode\n\n"},{"id":"54c7d50e.4b753c","type":"bigtimer","z":"766ec4c8.e67b7c","outtopic":"","outpayload1":"","outpayload2":"","name":"Evening or Night - weekdays","comment":"","lat":"62.3398599","lon":"17.0413267","starttime":"5004","endtime":"1365","starttime2":0,"endtime2":0,"startoff":"-60","endoff":0,"startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":false,"sat":false,"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,"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":false,"atstart":false,"odd":false,"even":false,"x":300,"y":200,"wires":[[],["433a1b88.358d14"],[]]},{"id":"430841a4.58c59","type":"inject","z":"766ec4c8.e67b7c","name":"On","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":160,"wires":[["54c7d50e.4b753c"]]},{"id":"dfda7b3.3ebf288","type":"inject","z":"766ec4c8.e67b7c","name":"Off","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":240,"wires":[["54c7d50e.4b753c"]]},{"id":"433a1b88.358d14","type":"switch","z":"766ec4c8.e67b7c","name":"Evening or night?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":280,"wires":[["88a06121.6398a"],["5530460c.57c748"]]},{"id":"d37c3c0c.1b7ea","type":"change","z":"766ec4c8.e67b7c","name":"Set evening","rules":[{"t":"set","p":"topic","pt":"msg","to":"Kväll","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":280,"wires":[["67c428c9.ae08c8"]]},{"id":"5530460c.57c748","type":"change","z":"766ec4c8.e67b7c","name":"Set night","rules":[{"t":"set","p":"topic","pt":"msg","to":"Natt","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":340,"wires":[["67c428c9.ae08c8"]]},{"id":"67c428c9.ae08c8","type":"change","z":"766ec4c8.e67b7c","name":"Set global house_mode","rules":[{"t":"set","p":"house_mode","pt":"global","to":"topic","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":400,"wires":[["637b136a.35df9c"]]},{"id":"37a9f6ff.7bacda","type":"bigtimer","z":"766ec4c8.e67b7c","outtopic":"","outpayload1":"","outpayload2":"","name":"Evening or Night - weekends","comment":"","lat":"62.3398599","lon":"17.0413267","starttime":"5004","endtime":"1425","starttime2":0,"endtime2":0,"startoff":"-60","endoff":0,"startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","timeout":1440,"sun":false,"mon":false,"tue":false,"wed":false,"thu":false,"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,"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":false,"atstart":false,"odd":false,"even":false,"x":300,"y":340,"wires":[[],["433a1b88.358d14"],[]]},{"id":"70469098.c443f","type":"inject","z":"766ec4c8.e67b7c","name":"On","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":300,"wires":[["37a9f6ff.7bacda"]]},{"id":"39ff1afc.e6bfc6","type":"inject","z":"766ec4c8.e67b7c","name":"Off","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":380,"wires":[["37a9f6ff.7bacda"]]},{"id":"dc84a9f5.492eb8","type":"bigtimer","z":"766ec4c8.e67b7c","outtopic":"","outpayload1":"","outpayload2":"","name":"Morning or day","comment":"","lat":"62.3398599","lon":"17.0413267","starttime":"5003","endtime":"600","starttime2":0,"endtime2":0,"startoff":"30","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,"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":false,"atstart":false,"odd":false,"even":false,"x":260,"y":500,"wires":[[],["8561029e.9ece2"],[]]},{"id":"1a224030.4fefa","type":"inject","z":"766ec4c8.e67b7c","name":"On","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":460,"wires":[["dc84a9f5.492eb8"]]},{"id":"d051302e.1f241","type":"inject","z":"766ec4c8.e67b7c","name":"Off","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":540,"wires":[["dc84a9f5.492eb8"]]},{"id":"8561029e.9ece2","type":"switch","z":"766ec4c8.e67b7c","name":"Morning or day?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":540,"y":500,"wires":[["b3d757ce.1ac828"],["f44f7585.fe27c8"]]},{"id":"b3d757ce.1ac828","type":"change","z":"766ec4c8.e67b7c","name":"Set morning","rules":[{"t":"set","p":"topic","pt":"msg","to":"Morgon","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":480,"wires":[["67c428c9.ae08c8"]]},{"id":"f44f7585.fe27c8","type":"change","z":"766ec4c8.e67b7c","name":"Set day","rules":[{"t":"set","p":"topic","pt":"msg","to":"Dag","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":520,"wires":[["67c428c9.ae08c8"]]},{"id":"637b136a.35df9c","type":"function","z":"766ec4c8.e67b7c","name":"Display current mode","func":"node.status({fill:\"green\",shape:\"ring\",text:msg.topic});\nreturn msg;","outputs":1,"noerr":0,"x":980,"y":440,"wires":[["4651db79.4b4954"]]},{"id":"cfc22886.286b98","type":"server-state-changed","z":"766ec4c8.e67b7c","name":"House mode select state","server":"67344dd9.0c79e4","entityidfilter":"input_select.house_mode_select","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":130,"y":660,"wires":[["18a6b75f.1c6269"]]},{"id":"4651db79.4b4954","type":"api-call-service","z":"766ec4c8.e67b7c","name":"Set new mode to input_select","server":"67344dd9.0c79e4","service_domain":"input_select","service":"select_option","data":"{\"entity_id\":\"input_select.house_mode_select\",\"option\":\"{{global.house_mode}}\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1250,"y":440,"wires":[[]]},{"id":"18a6b75f.1c6269","type":"ha-fire-event","z":"766ec4c8.e67b7c","name":"","server":"67344dd9.0c79e4","event":"EV_HOUSE_MODE_CHANGED","data":"{\"new\":\"{{data.new_state.state}}\",\"old\":\"{{data.old_state.state}}\"}","mergecontext":"","x":590,"y":660,"wires":[[]]},{"id":"1edc1b07.d754a5","type":"server-events","z":"766ec4c8.e67b7c","name":"Event HouseMode","server":"67344dd9.0c79e4","event_type":"EV_HOUSE_MODE_CHANGED","x":110,"y":780,"wires":[[]]},{"id":"433b23b5.c5ff2c","type":"inject","z":"766ec4c8.e67b7c","name":"On start","topic":"foo","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"10","x":80,"y":60,"wires":[["8eed843e.ad3008"]]},{"id":"8eed843e.ad3008","type":"api-current-state","z":"766ec4c8.e67b7c","name":"Get house mode current state","server":"67344dd9.0c79e4","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_select.house_mode_select","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":310,"y":60,"wires":[["88d8eebc.62a1e"]]},{"id":"88d8eebc.62a1e","type":"change","z":"766ec4c8.e67b7c","name":"Set and inti global house_mode","rules":[{"t":"set","p":"house_mode","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":60,"wires":[[]]},{"id":"88a06121.6398a","type":"api-current-state","z":"766ec4c8.e67b7c","name":"Get cloudiness","server":"67344dd9.0c79e4","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.yr_cloudiness","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":600,"y":140,"wires":[["279d82e9.cd4a3e"]]},{"id":"279d82e9.cd4a3e","type":"switch","z":"766ec4c8.e67b7c","name":"> 90%?","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"90.0","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":700,"y":200,"wires":[["d37c3c0c.1b7ea"],["25c3f25a.d1319e"]]},{"id":"25c3f25a.d1319e","type":"delay","z":"766ec4c8.e67b7c","name":"Wait 45 minutes its not cloudy","pauseType":"delay","timeout":"45","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":950,"y":160,"wires":[["d37c3c0c.1b7ea"]]},{"id":"67344dd9.0c79e4","type":"server","z":"","name":"Home Assistant"}]

Raw Text