[{"id":"a72011f7.394d8","type":"subflow","name":"Light State","info":"","category":"","in":[{"x":25,"y":306,"wires":[{"id":"9b2caad8.d47ef"}]}],"out":[{"x":1300,"y":680,"wires":[{"id":"3b4f395a.337d66","port":0},{"id":"4df70287.e16584","port":0},{"id":"449fde02.b8ea","port":0},{"id":"fa4b6838.2fab8","port":0},{"id":"b579ddd9.8c50a","port":0},{"id":"bb07361c.e173e","port":0},{"id":"2d0fb41c.606174","port":0},{"id":"ec257fa8.371628","port":0},{"id":"967d3778.ef1fb8","port":0},{"id":"1906f620.326aea","port":0},{"id":"18880708.1a88c9","port":0},{"id":"b66b8423.a53fb","port":0},{"id":"499a5f0c.4c4888","port":0},{"id":"b2b3d092.737de","port":0},{"id":"b194e0fe.1351a8","port":0},{"id":"cc1e58c9.69bb58","port":0}]}],"env":[],"status":{"x":1120,"y":40,"wires":[]}},{"id":"4deb7da4.a7f1ac","type":"api-current-state","z":"a72011f7.394d8","name":"Get state","server":"23176b84.edef7c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.zw_fbd2_wk_plafond_level_s1","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":774,"y":186,"wires":[["ec257fa8.371628"]]},{"id":"3b4f395a.337d66","type":"function","z":"a72011f7.394d8","name":"Reset State - light_zw_fbd2_wk_plafond_level_s1","func":"var flow_data = global.get(\"zw_fbd2_wk_plafond_level_s1\");\n\nmsg.payload = {\n \"domain\":\"light\",\n \"service\":\"turn_\" + flow_data[\"state\"],\n \"data\": {\n \"entity_id\":\"light.zw_fbd2_wk_plafond_level_s1\",\n \"brightness\":flow_data.attributes[\"brightness\"],\n \"rgb_color\":flow_data.attributes[\"rgb_color\"],\n \"color_temp\":flow_data.attributes[\"color_temp\"],\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":904,"y":858,"wires":[["cc014ec3.4c0e9"]]},{"id":"9b2caad8.d47ef","type":"switch","z":"a72011f7.394d8","name":"store/reset/or per room","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"store","vt":"str"},{"t":"eq","v":"reset","vt":"str"},{"t":"eq","v":"store_alarmlights","vt":"str"},{"t":"eq","v":"reset_alarmlights","vt":"str"},{"t":"eq","v":"store_livingroom","vt":"str"},{"t":"eq","v":"reset_livingroom","vt":"str"},{"t":"eq","v":"store_kitchen","vt":"str"},{"t":"eq","v":"reset_kitchen","vt":"str"},{"t":"eq","v":"store_hallway","vt":"str"},{"t":"eq","v":"reset_hallway","vt":"str"}],"checkall":"true","repair":false,"outputs":10,"x":175,"y":306,"wires":[["7f179aff.6a62fc"],["9d3eb7ad.bb442"],[],[],["7749c5c9.0726dc"],["94524c7b.5c8358"],["3fe1fb19.b6f294"],["adcd3b4c.97db98"],["9ee5522d.f17b8"],["6030e6e6.4b098"]]},{"id":"ec257fa8.371628","type":"function","z":"a72011f7.394d8","name":"Store state - zw_fbd2_wk_plafond_level_s1","func":"global.set(\"zw_fbd2_wk_plafond_level_s1\",msg.data);\nreturn msg;","outputs":1,"noerr":0,"x":1084,"y":186,"wires":[[]]},{"id":"bee763ff.fbc848","type":"api-current-state","z":"a72011f7.394d8","name":"Get state","server":"23176b84.edef7c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.hue_wk_hanglamp_links","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":774,"y":246,"wires":[["967d3778.ef1fb8"]]},{"id":"967d3778.ef1fb8","type":"function","z":"a72011f7.394d8","name":"Store state - hue_wk_hanglamp_links","func":"global.set(\"hue_wk_hanglamp_links\",msg.data);\nreturn msg;","outputs":1,"noerr":0,"x":1064,"y":246,"wires":[[]]},{"id":"4df70287.e16584","type":"function","z":"a72011f7.394d8","name":"Reset State - hue_wk_hanglamp_links","func":"var flow_data = global.get(\"hue_wk_hanglamp_links\");\n\nmsg.payload = {\n \"domain\":\"light\",\n \"service\":\"turn_\" + flow_data[\"state\"],\n \"data\": {\n \"entity_id\":\"light.hue_wk_hanglamp_links\",\n \"brightness\":flow_data.attributes[\"brightness\"],\n \"rgb_color\":flow_data.attributes[\"rgb_color\"],\n \"color_temp\":flow_data.attributes[\"color_temp\"],\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":864,"y":918,"wires":[["cc014ec3.4c0e9"]]},{"id":"9aaa3481.7ff148","type":"api-current-state","z":"a72011f7.394d8","name":"Get state","server":"23176b84.edef7c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.hue_wk_hanglamp_rechts","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":774,"y":306,"wires":[["1906f620.326aea"]]},{"id":"1906f620.326aea","type":"function","z":"a72011f7.394d8","name":"Store state - hue_wk_hanglamp_rechts","func":"global.set(\"hue_wk_hanglamp_rechts\",msg.data);\nreturn msg;","outputs":1,"noerr":0,"x":1074,"y":306,"wires":[[]]},{"id":"408cc7e0.bb2a78","type":"api-current-state","z":"a72011f7.394d8","name":"Get state","server":"23176b84.edef7c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.hue_wk_rechtsvoor","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":774,"y":366,"wires":[["18880708.1a88c9"]]},{"id":"18880708.1a88c9","type":"function","z":"a72011f7.394d8","name":"Store state - hue_wk_rechtsvoor","func":"global.set(\"hue_wk_rechtsvoor\",msg.data);\nreturn msg;","outputs":1,"noerr":0,"x":1054,"y":366,"wires":[[]]},{"id":"4baf4b9a.1cef34","type":"api-current-state","z":"a72011f7.394d8","name":"Get state","server":"23176b84.edef7c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.hue_wk_rechtsachter","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":774,"y":426,"wires":[["b66b8423.a53fb"]]},{"id":"b66b8423.a53fb","type":"function","z":"a72011f7.394d8","name":"Store state - hue_wk_rechtsachter","func":"global.set(\"hue_wk_rechtsachter\",msg.data);\nreturn msg;","outputs":1,"noerr":0,"x":1054,"y":426,"wires":[[]]},{"id":"97b46f85.81d238","type":"api-current-state","z":"a72011f7.394d8","name":"Get state","server":"23176b84.edef7c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.hue_keukentafel","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":774,"y":526,"wires":[["499a5f0c.4c4888"]]},{"id":"499a5f0c.4c4888","type":"function","z":"a72011f7.394d8","name":"Store state - hue_keukentafel","func":"global.set(\"hue_keukentafel\",msg.data);\nreturn msg;","outputs":1,"noerr":0,"x":1044,"y":526,"wires":[[]]},{"id":"746c59c5.3a5e6","type":"api-current-state","z":"a72011f7.394d8","name":"Get state","server":"23176b84.edef7c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.zw_fbd2_kk_eiland_level_s1","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":774,"y":586,"wires":[["b2b3d092.737de"]]},{"id":"b2b3d092.737de","type":"function","z":"a72011f7.394d8","name":"Store state - zw_fbd2_kk_eiland_level_s1","func":"global.set(\"zw_fbd2_kk_eiland_level_s1\",msg.data);\nreturn msg;","outputs":1,"noerr":0,"x":1074,"y":586,"wires":[[]]},{"id":"449fde02.b8ea","type":"function","z":"a72011f7.394d8","name":"Reset State - hue_wk_hanglamp_rechts","func":"var flow_data = global.get(\"hue_wk_hanglamp_rechts\");\n\nmsg.payload = {\n \"domain\":\"light\",\n \"service\":\"turn_\" + flow_data[\"state\"],\n \"data\": {\n \"entity_id\":\"light.hue_wk_hanglamp_rechts\",\n \"brightness\":flow_data.attributes[\"brightness\"],\n \"rgb_color\":flow_data.attributes[\"rgb_color\"],\n \"color_temp\":flow_data.attributes[\"color_temp\"],\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":873,"y":978,"wires":[["cc014ec3.4c0e9"]]},{"id":"fa4b6838.2fab8","type":"function","z":"a72011f7.394d8","name":"Reset State - hue_wk_rechtsvoor","func":"var flow_data = global.get(\"hue_wk_rechtsvoor\");\n\nmsg.payload = {\n \"domain\":\"light\",\n \"service\":\"turn_\" + flow_data[\"state\"],\n \"data\": {\n \"entity_id\":\"light.hue_wk_rechtsvoor\",\n \"brightness\":flow_data.attributes[\"brightness\"],\n \"rgb_color\":flow_data.attributes[\"rgb_color\"],\n \"color_temp\":flow_data.attributes[\"color_temp\"],\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":853,"y":1038,"wires":[["cc014ec3.4c0e9"]]},{"id":"b579ddd9.8c50a","type":"function","z":"a72011f7.394d8","name":"Reset State - hue_wk_rechtsachter","func":"var flow_data = global.get(\"hue_wk_rechtsachter\");\n\nmsg.payload = {\n \"domain\":\"light\",\n \"service\":\"turn_\" + flow_data[\"state\"],\n \"data\": {\n \"entity_id\":\"light.hue_wk_rechtsachter\",\n \"brightness\":flow_data.attributes[\"brightness\"],\n \"rgb_color\":flow_data.attributes[\"rgb_color\"],\n \"color_temp\":flow_data.attributes[\"color_temp\"],\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":853,"y":1098,"wires":[["cc014ec3.4c0e9"]]},{"id":"bb07361c.e173e","type":"function","z":"a72011f7.394d8","name":"Reset State - hue_keukentafel","func":"var flow_data = global.get(\"hue_keukentafel\");\n\nmsg.payload = {\n \"domain\":\"light\",\n \"service\":\"turn_\" + flow_data[\"state\"],\n \"data\": {\n \"entity_id\":\"light.hue_keukentafel\",\n \"brightness\":flow_data.attributes[\"brightness\"],\n \"rgb_color\":flow_data.attributes[\"rgb_color\"],\n \"color_temp\":flow_data.attributes[\"color_temp\"],\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":843,"y":1218,"wires":[["cc014ec3.4c0e9"]]},{"id":"2d0fb41c.606174","type":"function","z":"a72011f7.394d8","name":"Reset State - zw_fbd2_kk_eiland_level_s1","func":"var flow_data = global.get(\"zw_fbd2_kk_eiland_level_s1\");\n\nmsg.payload = {\n \"domain\":\"light\",\n \"service\":\"turn_\" + flow_data[\"state\"],\n \"data\": {\n \"entity_id\":\"light.zw_fbd2_kk_eiland_level_s1\",\n \"brightness\":flow_data.attributes[\"brightness\"],\n \"rgb_color\":flow_data.attributes[\"rgb_color\"],\n \"color_temp\":flow_data.attributes[\"color_temp\"],\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":883,"y":1278,"wires":[["cc014ec3.4c0e9"]]},{"id":"7749c5c9.0726dc","type":"link out","z":"a72011f7.394d8","name":"save_state_light_livingroom","links":["739ab232.e478a4"],"x":435,"y":186,"wires":[]},{"id":"739ab232.e478a4","type":"link in","z":"a72011f7.394d8","name":"save_state_light_livingroom","links":["7749c5c9.0726dc","9d506121.c88fa8","7f179aff.6a62fc"],"x":515,"y":186,"wires":[["4deb7da4.a7f1ac","bee763ff.fbc848","9aaa3481.7ff148","408cc7e0.bb2a78","4baf4b9a.1cef34"]]},{"id":"94524c7b.5c8358","type":"link out","z":"a72011f7.394d8","name":"reset_state_light_livingroom","links":["78d26cee.ba6704"],"x":435,"y":858,"wires":[]},{"id":"78d26cee.ba6704","type":"link in","z":"a72011f7.394d8","name":"reset_state_light_livingroom","links":["94524c7b.5c8358","9d3eb7ad.bb442"],"x":515,"y":858,"wires":[["3b4f395a.337d66","4df70287.e16584","449fde02.b8ea","fa4b6838.2fab8","b579ddd9.8c50a"]]},{"id":"9d3eb7ad.bb442","type":"link out","z":"a72011f7.394d8","name":"reset_state_all","links":["41968709.8a0878","78d26cee.ba6704","dcdcc687.d62ae"],"x":435,"y":798,"wires":[]},{"id":"7f179aff.6a62fc","type":"link out","z":"a72011f7.394d8","name":"save_state_all","links":["739ab232.e478a4","8baf7f8f.5da6","afc12a19.ec5e2"],"x":435,"y":126,"wires":[]},{"id":"73bae27c.247b14","type":"comment","z":"a72011f7.394d8","name":"=== LIVING ===","info":"","x":620,"y":146,"wires":[]},{"id":"3fe1fb19.b6f294","type":"link out","z":"a72011f7.394d8","name":"save_state_light_kitchen","links":["afc12a19.ec5e2"],"x":435,"y":526,"wires":[]},{"id":"afc12a19.ec5e2","type":"link in","z":"a72011f7.394d8","name":"save_state_light_kitchen","links":["3fe1fb19.b6f294","7f179aff.6a62fc"],"x":515,"y":526,"wires":[["97b46f85.81d238","746c59c5.3a5e6"]]},{"id":"adcd3b4c.97db98","type":"link out","z":"a72011f7.394d8","name":"reset_state_light_kitchen","links":["41968709.8a0878"],"x":435,"y":1218,"wires":[]},{"id":"41968709.8a0878","type":"link in","z":"a72011f7.394d8","name":"reset_state_light_kitchen","links":["9d3eb7ad.bb442","adcd3b4c.97db98"],"x":515,"y":1218,"wires":[["bb07361c.e173e","2d0fb41c.606174"]]},{"id":"e75df446.9f1ac","type":"comment","z":"a72011f7.394d8","name":"=== KITCHEN ===","info":"","x":630,"y":486,"wires":[]},{"id":"cc014ec3.4c0e9","type":"api-call-service","z":"a72011f7.394d8","name":"Call Service","server":"23176b84.edef7c","version":1,"service_domain":"light","service":"turn_on","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1284,"y":858,"wires":[[]]},{"id":"adb2114d.de0ed","type":"comment","z":"a72011f7.394d8","name":"ALL","info":"","x":470,"y":100,"wires":[]},{"id":"3737ed16.ab00ba","type":"comment","z":"a72011f7.394d8","name":"ALL","info":"","x":470,"y":760,"wires":[]},{"id":"d4e42cc3.9414d","type":"comment","z":"a72011f7.394d8","name":"=== LIVING ===","info":"","x":620,"y":818,"wires":[]},{"id":"17d0ff35.3a9461","type":"comment","z":"a72011f7.394d8","name":"=== KITCHEN ===","info":"","x":630,"y":1178,"wires":[]},{"id":"b194e0fe.1351a8","type":"function","z":"a72011f7.394d8","name":"Reset State - hue_hal","func":"var flow_data = global.get(\"hue_hal\");\n\nmsg.payload = {\n \"domain\":\"light\",\n \"service\":\"turn_\" + flow_data[\"state\"],\n \"data\": {\n \"entity_id\":\"light.hue_hal\",\n \"brightness\":flow_data.attributes[\"brightness\"],\n \"rgb_color\":flow_data.attributes[\"rgb_color\"],\n \"color_temp\":flow_data.attributes[\"color_temp\"],\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":820,"y":1400,"wires":[["cc014ec3.4c0e9"]]},{"id":"6030e6e6.4b098","type":"link out","z":"a72011f7.394d8","name":"reset_state_light_hallway","links":["dcdcc687.d62ae"],"x":442,"y":1400,"wires":[]},{"id":"dcdcc687.d62ae","type":"link in","z":"a72011f7.394d8","name":"reset_state_light_hallway","links":["6030e6e6.4b098","9d3eb7ad.bb442"],"x":522,"y":1400,"wires":[["b194e0fe.1351a8"]]},{"id":"eebcca79.870f98","type":"comment","z":"a72011f7.394d8","name":"=== HALLWAY ===","info":"","x":637,"y":1360,"wires":[]},{"id":"c8a98622.03a06","type":"api-current-state","z":"a72011f7.394d8","name":"Get state","server":"23176b84.edef7c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.hue_hal","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":780,"y":680,"wires":[["cc1e58c9.69bb58"]]},{"id":"cc1e58c9.69bb58","type":"function","z":"a72011f7.394d8","name":"Store state - hue_hal","func":"global.set(\"hue_hal\",msg.data);\nreturn msg;","outputs":1,"noerr":0,"x":1020,"y":680,"wires":[[]]},{"id":"9ee5522d.f17b8","type":"link out","z":"a72011f7.394d8","name":"save_state_light_hallway","links":["8baf7f8f.5da6"],"x":441,"y":680,"wires":[]},{"id":"8baf7f8f.5da6","type":"link in","z":"a72011f7.394d8","name":"save_state_light_halway","links":["7f179aff.6a62fc","9ee5522d.f17b8"],"x":521,"y":680,"wires":[["c8a98622.03a06"]]},{"id":"50be605.d6e7a2","type":"comment","z":"a72011f7.394d8","name":"=== HALLWAY ===","info":"","x":636,"y":640,"wires":[]},{"id":"23176b84.edef7c","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false},{"id":"e631d815.a579","type":"subflow:a72011f7.394d8","z":"283de3b.cc2271c","name":"","env":[],"x":500,"y":100,"wires":[["b69f1f0c.eb05d8"]]},{"id":"46df6820.803de","type":"subflow:a72011f7.394d8","z":"283de3b.cc2271c","name":"","env":[],"x":500,"y":180,"wires":[["b69f1f0c.eb05d8"]]},{"id":"b69f1f0c.eb05d8","type":"debug","z":"283de3b.cc2271c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":710,"y":180,"wires":[]},{"id":"4ef9e54f.6d62f4","type":"template","z":"283de3b.cc2271c","name":"store state kitchen","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"store_kitchen","output":"str","x":310,"y":40,"wires":[["e631d815.a579"]]},{"id":"f2d085cf.12b26","type":"inject","z":"283de3b.cc2271c","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":40,"wires":[["4ef9e54f.6d62f4"]]},{"id":"ff96f4a6.28d63","type":"template","z":"283de3b.cc2271c","name":"reset state kitchen","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"reset_kitchen","output":"str","x":290,"y":120,"wires":[["46df6820.803de"]]},{"id":"8cc98c5c.8c519","type":"inject","z":"283de3b.cc2271c","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":120,"wires":[["ff96f4a6.28d63"]]}]