[{"id":"9ff8a6d747974ff6","type":"subflow","name":"墙贴控制窗帘","info":"","category":"","in":[{"x":180,"y":120,"wires":[]}],"out":[],"env":[{"name":"switch_id","type":"str","value":""},{"name":"cover1_id","type":"str","value":""},{"name":"bool1_id","type":"str","value":""},{"name":"cover2_id","type":"str","value":""},{"name":"bool2_id","type":"str","value":""},{"name":"control_id","type":"bool","value":"true"},{"name":"window1_id","type":"str","value":""},{"name":"window2_id","type":"str","value":""}],"meta":{},"color":"#DDAA99"},{"id":"d2bc37ad7db533bb","type":"server-state-changed","z":"9ff8a6d747974ff6","name":"墙贴动作","server":"3df55419.f637dc","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"${switch_id}","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"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":"","valueType":"triggerId"}],"x":220,"y":240,"wires":[["cfc420b976c63d48"]]},{"id":"cfc420b976c63d48","type":"switch","z":"9ff8a6d747974ff6","name":"右单击 \\n 左单击 \\n 左右一起","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"single_right","vt":"str"},{"t":"eq","v":"single_left","vt":"str"},{"t":"eq","v":"single_both","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":380,"y":240,"wires":[["0dab354f0abfc76d"],["9e2333a19e0f85a6"],["124e9de73a0d9759","3debc7146877b9a9"]]},{"id":"9180646ad5e77e99","type":"api-call-service","z":"9ff8a6d747974ff6","name":"关cover1","server":"3df55419.f637dc","version":3,"debugenabled":false,"service_domain":"cover","service":"close_cover","entityId":"${cover1_id}","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1400,"y":60,"wires":[[]]},{"id":"8745ecc524c511a4","type":"api-current-state","z":"9ff8a6d747974ff6","name":"变量ON","server":"3df55419.f637dc","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"${bool1_id}","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1200,"y":100,"wires":[["9180646ad5e77e99","646be2a9abc67fa1"],["8556cfac1e700f79","f43b2bdb906290c9"]]},{"id":"8556cfac1e700f79","type":"api-call-service","z":"9ff8a6d747974ff6","name":"开cover1","server":"3df55419.f637dc","version":3,"debugenabled":false,"service_domain":"cover","service":"open_cover","entityId":"${cover1_id}","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1400,"y":100,"wires":[[]]},{"id":"0dab354f0abfc76d","type":"api-current-state","z":"9ff8a6d747974ff6","name":"cover1是否运行","server":"3df55419.f637dc","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"${cover1_id}","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":580,"y":160,"wires":[["f69469c7b065c0fc"]]},{"id":"f69469c7b065c0fc","type":"switch","z":"9ff8a6d747974ff6","name":"","property":"data.attributes.running","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":695,"y":160,"wires":[["1b3e91d3313e8ed2"],["124e9de73a0d9759"]],"l":false},{"id":"124e9de73a0d9759","type":"api-call-service","z":"9ff8a6d747974ff6","name":"cover1停","server":"3df55419.f637dc","version":3,"debugenabled":false,"service_domain":"cover","service":"stop_cover","entityId":"${cover1_id}","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":820,"y":200,"wires":[[]]},{"id":"646be2a9abc67fa1","type":"api-call-service","z":"9ff8a6d747974ff6","name":"","server":"3df55419.f637dc","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"${bool1_id}","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1460,"y":20,"wires":[[]]},{"id":"f43b2bdb906290c9","type":"api-call-service","z":"9ff8a6d747974ff6","name":"","server":"3df55419.f637dc","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"${bool1_id}","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1460,"y":140,"wires":[[]]},{"id":"9e2333a19e0f85a6","type":"api-current-state","z":"9ff8a6d747974ff6","name":"cover2是否运行","server":"3df55419.f637dc","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"${cover2_id}","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":580,"y":340,"wires":[["51d5ac6faa167196"]]},{"id":"51d5ac6faa167196","type":"switch","z":"9ff8a6d747974ff6","name":"运行","property":"data.attributes.running","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":695,"y":340,"wires":[["335ba59daf68efca"],["3debc7146877b9a9"]],"l":false},{"id":"3ed077e0167e132a","type":"api-current-state","z":"9ff8a6d747974ff6","name":"变量ON","server":"3df55419.f637dc","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"${bool2_id}","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1200,"y":300,"wires":[["ffe24767fa6bdedd","e4a2284e1586db94"],["f13fb0c746192ec3","f52d2d766f52883a"]]},{"id":"3debc7146877b9a9","type":"api-call-service","z":"9ff8a6d747974ff6","name":"cover2停","server":"3df55419.f637dc","version":3,"debugenabled":false,"service_domain":"cover","service":"stop_cover","entityId":"${cover2_id}","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":820,"y":400,"wires":[[]]},{"id":"f52d2d766f52883a","type":"api-call-service","z":"9ff8a6d747974ff6","name":"","server":"3df55419.f637dc","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"${bool2_id}","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1460,"y":340,"wires":[[]]},{"id":"f13fb0c746192ec3","type":"api-call-service","z":"9ff8a6d747974ff6","name":"开cover2","server":"3df55419.f637dc","version":3,"debugenabled":false,"service_domain":"cover","service":"open_cover","entityId":"${cover2_id}","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1400,"y":300,"wires":[[]]},{"id":"ffe24767fa6bdedd","type":"api-call-service","z":"9ff8a6d747974ff6","name":"关cover2","server":"3df55419.f637dc","version":3,"debugenabled":false,"service_domain":"cover","service":"close_cover","entityId":"${cover2_id}","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1400,"y":260,"wires":[[]]},{"id":"e4a2284e1586db94","type":"api-call-service","z":"9ff8a6d747974ff6","name":"","server":"3df55419.f637dc","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"${bool2_id}","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1460,"y":220,"wires":[[]]},{"id":"1b3e91d3313e8ed2","type":"function","z":"9ff8a6d747974ff6","name":"","func":"var window1_id = env.get("window1_id");\nif(window1_id.length>8)\n msg.payload = 1;\nelse\n msg.payload = 0;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":100,"wires":[["5917f4950e4a0765"]]},{"id":"5917f4950e4a0765","type":"switch","z":"9ff8a6d747974ff6","name":"window1?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":895,"y":100,"wires":[["8745ecc524c511a4"],["5a4e2f7e0bad7a13"]],"l":false},{"id":"5a4e2f7e0bad7a13","type":"api-current-state","z":"9ff8a6d747974ff6","name":"window1","server":"3df55419.f637dc","version":2,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"${window1_id}","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1000,"y":120,"wires":[["16bba4166c198d5d"],[]]},{"id":"16bba4166c198d5d","type":"function","z":"9ff8a6d747974ff6","name":"","func":"var window1_id = env.get("window2_id");\nif(window1_id.length>8)\n msg.payload = 1;\nelse\n msg.payload = 0;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":990,"y":160,"wires":[["919660324f5dd971"]]},{"id":"919660324f5dd971","type":"switch","z":"9ff8a6d747974ff6","name":"window1?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1075,"y":160,"wires":[["8745ecc524c511a4"],["8c8148c393eca10c"]],"l":false},{"id":"8c8148c393eca10c","type":"api-current-state","z":"9ff8a6d747974ff6","name":"window2","server":"3df55419.f637dc","version":2,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"${window2_id}","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1200,"y":160,"wires":[["8745ecc524c511a4"],[]]},{"id":"335ba59daf68efca","type":"function","z":"9ff8a6d747974ff6","name":"","func":"var window1_id = env.get("window1_id");\nif(window1_id.length>8)\n msg.payload = 1;\nelse\n msg.payload = 0;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":300,"wires":[["a026b0acd4961e93"]]},{"id":"a026b0acd4961e93","type":"switch","z":"9ff8a6d747974ff6","name":"window1?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":895,"y":300,"wires":[["3ed077e0167e132a"],["9fc1679c87e0957a"]],"l":false},{"id":"9fc1679c87e0957a","type":"api-current-state","z":"9ff8a6d747974ff6","name":"window1","server":"3df55419.f637dc","version":2,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"${window1_id}","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1000,"y":320,"wires":[["7688b73685449881"],[]]},{"id":"7688b73685449881","type":"function","z":"9ff8a6d747974ff6","name":"","func":"var window1_id = env.get("window2_id");\nif(window1_id.length>8)\n msg.payload = 1;\nelse\n msg.payload = 0;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":990,"y":360,"wires":[["40101865cbe72279"]]},{"id":"40101865cbe72279","type":"switch","z":"9ff8a6d747974ff6","name":"window1?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1075,"y":360,"wires":[["3ed077e0167e132a"],["f34ec8363768d63d"]],"l":false},{"id":"f34ec8363768d63d","type":"api-current-state","z":"9ff8a6d747974ff6","name":"window2","server":"3df55419.f637dc","version":2,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"${window2_id}","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1200,"y":360,"wires":[["3ed077e0167e132a"],[]]},{"id":"3df55419.f637dc","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false},{"id":"5f3aea8641fbab53","type":"subflow:9ff8a6d747974ff6","z":"a04dd43c.b52b18","name":"","x":1150,"y":340,"wires":[]}]