I have put together a flow for Vacation mode. Vacation mode can be sent manually, or is automatically set when all people are away for an extended period of time.
The flow turns lights on & off, and also plays ambient noise through Sonos. At night, it shuts everything off through a separate flow triggered by a “Night mode” switch (input_boolean). This is the same switch I use when home.
The flow itself works great. The scheduling, not so much. I want my vacation mode flow to work when it’s turned on. I also want it to work daily when vacation mode is on, with different parts of the flow occurring at different times. The trouble is, the flow only works on the first day that vacation mode is turned on. How can I adjust my flow to remedy this?
[{"id":"a1774f76.0cb69","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"97bdffc0.1bb2c","type":"time-range-switch","z":"a1774f76.0cb69","name":"Sunset - 9:45pm","lat":"0.0","lon":"0.0","startTime":"sunset","endTime":"21:45","startOffset":0,"endOffset":0,"x":380,"y":60,"wires":[["a3314f04.976c5"],[]]},{"id":"dafbd5dc.d322a8","type":"ha-get-entities","z":"a1774f76.0cb69","server":"296c0678.b5f9ca","name":"","rules":[{"property":"entity_id","logic":"in_group","value":"vacation_lights","valueType":"str"},{"property":"state","logic":"is","value":"off","valueType":"str"}],"output_type":"random","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":690,"y":60,"wires":[["e87d0b23.86dd58"]]},{"id":"a3314f04.976c5","type":"function","z":"a1774f76.0cb69","name":"25%","func":"const random = Math.round(Math.random() * 100);\n\nif(random < 75) {\n node.status({fill: \"red\", text: random});\n return;\n}\n\nnode.status({fill: \"green\", text: random});\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":542,"y":60,"wires":[["dafbd5dc.d322a8"]]},{"id":"e87d0b23.86dd58","type":"api-call-service","z":"a1774f76.0cb69","name":"turn on","server":"296c0678.b5f9ca","version":1,"debugenabled":false,"service_domain":"homeassistant","service":"turn_on","entityId":"{{payload.entity_id}}","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":810,"y":60,"wires":[["b9a20de6.2336a"]]},{"id":"b9a20de6.2336a","type":"delay","z":"a1774f76.0cb69","name":"","pauseType":"random","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"16","randomLast":"65","randomUnits":"minutes","drop":false,"x":920,"y":60,"wires":[["d1c5af00.633c5"]]},{"id":"d1c5af00.633c5","type":"api-call-service","z":"a1774f76.0cb69","name":"turn off","server":"296c0678.b5f9ca","version":1,"debugenabled":false,"service_domain":"homeassistant","service":"turn_off","entityId":"{{payload.entity_id}}","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1030,"y":60,"wires":[[]]},{"id":"fdaf6d0.6ae559","type":"server-state-changed","z":"a1774f76.0cb69","name":"Vacation Mode On","server":"296c0678.b5f9ca","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.vacation_mode","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","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,"x":150,"y":60,"wires":[["97bdffc0.1bb2c","221279f8.f88bf6","52319c9e.7629f4"],[]]},{"id":"221279f8.f88bf6","type":"timecheck","z":"a1774f76.0cb69","name":"9:45pm","time":"21:50","x":360,"y":100,"wires":[["a1904f19.101d3"],[]]},{"id":"a1904f19.101d3","type":"api-call-service","z":"a1774f76.0cb69","name":"Night Mode On","server":"296c0678.b5f9ca","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.night","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":600,"y":100,"wires":[[]]},{"id":"34772570.b62d9a","type":"sonos-manage-mysonos","z":"a1774f76.0cb69","confignode":"80cb210.c2ec0e","compatibilityMode":false,"command":"mysonos.export.item","state":"Ambient House Noise","stateType":"str","name":"Queue Ambient Noise","x":1060,"y":140,"wires":[["efa1a2f4.9d635"]]},{"id":"efa1a2f4.9d635","type":"sonos-universal","z":"a1774f76.0cb69","confignode":"80cb210.c2ec0e","compatibilityMode":false,"command":"group.set.volume","state":"50","stateType":"str","name":"Set Volume to 50","x":1250,"y":140,"wires":[["a39c1cf0.f2515"]]},{"id":"a39c1cf0.f2515","type":"sonos-universal","z":"a1774f76.0cb69","confignode":"80cb210.c2ec0e","compatibilityMode":false,"command":"group.play.queue","state":"","stateType":"str","name":"Play","x":1390,"y":140,"wires":[["a8aa3698.11dc08"]]},{"id":"bf49a3e7.292e","type":"api-call-service","z":"a1774f76.0cb69","name":"Sonos Living Room Power On","server":"296c0678.b5f9ca","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.sonos_living_room_power_current_value","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":650,"y":140,"wires":[["b14698b8.cc5c38"]]},{"id":"52319c9e.7629f4","type":"time-range-switch","z":"a1774f76.0cb69","name":"9:55am - 9:45pm","lat":"0.0","lon":"0.0","startTime":"09:55","endTime":"21:45","startOffset":0,"endOffset":0,"x":390,"y":140,"wires":[["bf49a3e7.292e"],[]]},{"id":"b14698b8.cc5c38","type":"delay","z":"a1774f76.0cb69","name":"After 5 minutes...","pauseType":"delay","timeout":"5","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":870,"y":140,"wires":[["34772570.b62d9a"]]},{"id":"a8aa3698.11dc08","type":"sonos-universal","z":"a1774f76.0cb69","confignode":"80cb210.c2ec0e","compatibilityMode":false,"command":"group.set.queuemode","state":"REPEAT_ONE","stateType":"str","name":"Set to Repeat","x":1520,"y":140,"wires":[[]]},{"id":"296c0678.b5f9ca","type":"server","name":"Home Assistant","addon":true},{"id":"80cb210.c2ec0e","type":"sonos-config","name":"Living Room","serialnum":"xx:xx:xx:xx:xx","ipaddress":"10.0.0.20"}]