『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 1661|回复: 4

[流程系列] 小白分享下做的客厅感应灯流程图

[复制链接]

7

主题

91

帖子

1174

积分

金牌会员

Rank: 6Rank: 6

积分
1174
金钱
1083
HASS币
10
发表于 2022-4-4 16:05:02 | 显示全部楼层 |阅读模式
本帖最后由 piaoling 于 2022-4-8 19:18 编辑

111.png
222.png
最终版本,加入虚拟开关2,缩短人感off时间为10s,有一个小bug,当ha服务器重启时,感应灯带会自动打开几秒后自动关闭,怀疑倒计时导致的,不影响使用。

[{"id":"0804d7f5fcad8c1b","type":"comment","z":"631fd0cf57d0b0ee","name":"2楼客厅顶灯","info":"","x":70,"y":280,"wires":[]},{"id":"59d33c497c344fe1","type":"switch","z":"631fd0cf57d0b0ee","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":300,"y":680,"wires":[["da08e7d83ba205d1","58255aecd22abd02"]]},{"id":"0a3db576e483f789","type":"api-call-service","z":"631fd0cf57d0b0ee","name":"开灯","server":"1416dd087f029896","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.0x158d00077e2b13_channel_1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1170,"y":720,"wires":[[]]},{"id":"22e788999f765df0","type":"api-call-service","z":"631fd0cf57d0b0ee","name":"关灯","server":"1416dd087f029896","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.0x158d00077e2b13_channel_1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1170,"y":780,"wires":[[]]},{"id":"35531d658c43a313","type":"timeout","z":"631fd0cf57d0b0ee","name":"10分钟循环倒计时","outtopic":"","outsafe":"off","outwarning":"off","outunsafe":"on","warning":"0","timer":"590","repeat":true,"again":false,"x":330,"y":780,"wires":[["c44e3579b8e79e5b"]]},{"id":"bbafbb9d300316b5","type":"comment","z":"631fd0cf57d0b0ee","name":"2楼客厅环灯带","info":"","x":80,"y":600,"wires":[]},{"id":"da08e7d83ba205d1","type":"api-current-state","z":"631fd0cf57d0b0ee","name":"青萍2光感","server":"1416dd087f029896","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"sensor.582d3460de74_illuminance","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":450,"y":640,"wires":[["7f70e80778db5ca2"]]},{"id":"7f70e80778db5ca2","type":"switch","z":"631fd0cf57d0b0ee","name":"小于数值","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":600,"y":640,"wires":[["94d57658a12eb436"]]},{"id":"58255aecd22abd02","type":"api-current-state","z":"631fd0cf57d0b0ee","name":"绿米2光感","server":"1416dd087f029896","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"sensor.0x158d0007753179_illuminance","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":450,"y":720,"wires":[["5ad4765c92ab3cd3"]]},{"id":"5ad4765c92ab3cd3","type":"switch","z":"631fd0cf57d0b0ee","name":"小于数值","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":600,"y":720,"wires":[["94d57658a12eb436"]]},{"id":"ad5b0a8e731fae2c","type":"switch","z":"631fd0cf57d0b0ee","name":"是否OFF","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1020,"y":720,"wires":[["0a3db576e483f789"]]},{"id":"50e7ea90d788b954","type":"server-state-changed","z":"631fd0cf57d0b0ee","name":"客厅灯关闭后","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.0x158d00077e2b13_channel_2","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","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,"outputProperties":[{"property":"payload","propertyType":"msg","value":"off","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":90,"y":940,"wires":[["56fa4c6b6524614a"],[]]},{"id":"051afa24d3dc6827","type":"api-current-state","z":"631fd0cf57d0b0ee","name":"检测顶灯状态","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.0x158d00077e2b13_channel_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"off","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1180,"y":640,"wires":[["ad5b0a8e731fae2c"],[]]},{"id":"40a18362d776ae63","type":"switch","z":"631fd0cf57d0b0ee","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1060,"y":940,"wires":[["1048f9c2611475aa"]]},{"id":"d4cb350744ae0151","type":"server-state-changed","z":"631fd0cf57d0b0ee","name":"客厅灯打开后","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.0x158d00077e2b13_channel_2","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","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,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":90,"y":860,"wires":[["7035e578bf9c3366"],[]]},{"id":"deb709b8a550e44d","type":"api-current-state","z":"631fd0cf57d0b0ee","name":"检测环灯带状态","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.0x158d00077e2b13_channel_1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":700,"y":780,"wires":[["7be3bec2f7efe395"],[]]},{"id":"34991ecce323f508","type":"api-current-state","z":"631fd0cf57d0b0ee","name":"2楼客厅人感-虚拟开关2","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.notify_home1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":870,"y":940,"wires":[["40a18362d776ae63"],[]]},{"id":"1048f9c2611475aa","type":"delay","z":"631fd0cf57d0b0ee","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1200,"y":940,"wires":[["3d86c011491f125e"]]},{"id":"56fa4c6b6524614a","type":"api-current-state","z":"631fd0cf57d0b0ee","name":"日落","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"above_horizon","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"sun.sun","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"above_horizon","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":230,"y":940,"wires":[["31aed53b3bae695b"],[]]},{"id":"31aed53b3bae695b","type":"switch","z":"631fd0cf57d0b0ee","name":"是否日落","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"above_horizon","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":360,"y":940,"wires":[["40436b6d738830c8"]]},{"id":"7035e578bf9c3366","type":"switch","z":"631fd0cf57d0b0ee","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":240,"y":860,"wires":[["bc452291deafbe54"]]},{"id":"7be3bec2f7efe395","type":"switch","z":"631fd0cf57d0b0ee","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":860,"y":780,"wires":[["84cfd5be3b1cccb8"]]},{"id":"84cfd5be3b1cccb8","type":"delay","z":"631fd0cf57d0b0ee","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1020,"y":780,"wires":[["22e788999f765df0"]]},{"id":"b3aa93e1ee849fa3","type":"switch","z":"631fd0cf57d0b0ee","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":300,"y":400,"wires":[["479f60da5a5e1469"]]},{"id":"6668727decb53261","type":"api-call-service","z":"631fd0cf57d0b0ee","name":"开灯","server":"1416dd087f029896","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.0x158d00077e2b13_channel_2"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1070,"y":440,"wires":[["ddb32e4ca69307b3"]]},{"id":"479f60da5a5e1469","type":"api-current-state","z":"631fd0cf57d0b0ee","name":"虚拟开关1","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.notify_home","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":450,"y":400,"wires":[["6d83daf8024c1a68"],[]]},{"id":"6d83daf8024c1a68","type":"switch","z":"631fd0cf57d0b0ee","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":600,"y":400,"wires":[["0a9bdefcab0ab235","d372bd792bae7645"]]},{"id":"9dbbc37e16fa6690","type":"api-call-service","z":"631fd0cf57d0b0ee","name":"关闭虚拟开关","server":"1416dd087f029896","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.notify_home"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1140,"y":360,"wires":[[]]},{"id":"ddb32e4ca69307b3","type":"delay","z":"631fd0cf57d0b0ee","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1220,"y":440,"wires":[["9dbbc37e16fa6690"]]},{"id":"81fe03b4645e4d3b","type":"inject","z":"631fd0cf57d0b0ee","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 16 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":340,"wires":[["9961d6f1c59fa8d2"]]},{"id":"9961d6f1c59fa8d2","type":"api-call-service","z":"631fd0cf57d0b0ee","name":"打开虚拟开关","server":"1416dd087f029896","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.notify_home"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":340,"y":340,"wires":[[]]},{"id":"320e1fab6f0f27e6","type":"comment","z":"631fd0cf57d0b0ee","name":"暂无关灯方案","info":"","x":370,"y":480,"wires":[]},{"id":"ec4af9cd69cffbf9","type":"comment","z":"631fd0cf57d0b0ee","name":"绿米动静贴/macbook开关机","info":"","x":380,"y":520,"wires":[]},{"id":"40436b6d738830c8","type":"timeout","z":"631fd0cf57d0b0ee","name":"6S循环倒计时","outtopic":"","outsafe":"on","outwarning":"on","outunsafe":"off","warning":"0","timer":"6","repeat":true,"again":false,"x":520,"y":940,"wires":[["80628068e50c12cf"]]},{"id":"80628068e50c12cf","type":"switch","z":"631fd0cf57d0b0ee","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":680,"y":940,"wires":[["34991ecce323f508"]]},{"id":"bc452291deafbe54","type":"timeout","z":"631fd0cf57d0b0ee","name":"6S循环倒计时","outtopic":"","outsafe":"on","outwarning":"on","outunsafe":"off","warning":"0","timer":"6","repeat":true,"again":false,"x":400,"y":860,"wires":[["c44e3579b8e79e5b"]]},{"id":"c44e3579b8e79e5b","type":"switch","z":"631fd0cf57d0b0ee","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":520,"y":780,"wires":[["deb709b8a550e44d"]]},{"id":"94d57658a12eb436","type":"api-current-state","z":"631fd0cf57d0b0ee","name":"虚拟开关1","server":"1416dd087f029896","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.notify_home","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":750,"y":680,"wires":[["38a026a119ccb75c"]]},{"id":"38a026a119ccb75c","type":"switch","z":"631fd0cf57d0b0ee","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":890,"y":680,"wires":[["f7a35c864858c33c"],["051afa24d3dc6827"]]},{"id":"f7a35c864858c33c","type":"delay","z":"631fd0cf57d0b0ee","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1020,"y":640,"wires":[["051afa24d3dc6827"]]},{"id":"e36483b6ca28bea7","type":"switch","z":"631fd0cf57d0b0ee","name":"是否off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":620,"y":1080,"wires":[[]]},{"id":"6ba973e716a6c4c5","type":"api-current-state","z":"631fd0cf57d0b0ee","name":"开关在off状态","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.0x158d00077e2b13_channel_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"off","valueType":"str"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":440,"y":1080,"wires":[["e36483b6ca28bea7"],[]]},{"id":"a0e4c4863ac78c65","type":"server-state-changed","z":"631fd0cf57d0b0ee","name":"客厅按钮点击","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d00077e2b13_switch","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"}],"x":90,"y":1080,"wires":[["0ca574f7843d0dee"]]},{"id":"0ca574f7843d0dee","type":"switch","z":"631fd0cf57d0b0ee","name":"判断单击","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"button_2_single","vt":"str"},{"t":"eq","v":"button_2_double","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":260,"y":1080,"wires":[["6ba973e716a6c4c5"],[]]},{"id":"69919a9791011602","type":"comment","z":"631fd0cf57d0b0ee","name":"去除双击状态误触","info":"","x":830,"y":1080,"wires":[]},{"id":"db04b108144c11bc","type":"switch","z":"631fd0cf57d0b0ee","name":"是否OFF","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1220,"y":1000,"wires":[["0a3db576e483f789"]]},{"id":"3d86c011491f125e","type":"api-current-state","z":"631fd0cf57d0b0ee","name":"检测顶灯状态","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.0x158d00077e2b13_channel_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"off","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1060,"y":1000,"wires":[["db04b108144c11bc"],[]]},{"id":"fbdd82181949570d","type":"server-state-changed","z":"631fd0cf57d0b0ee","name":"2楼客厅青萍2人感","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.582d3460de74_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"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":"ON","valueType":"str"},{"property":"topic","propertyType":"msg","value":"PIR-1","valueType":"str"}],"x":110,"y":120,"wires":[["6101b50928dffdc1"],[]]},{"id":"6101b50928dffdc1","type":"switch","z":"631fd0cf57d0b0ee","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":280,"y":140,"wires":[["f8c414720c04a192"]]},{"id":"8c21d83af3262877","type":"server-state-changed","z":"631fd0cf57d0b0ee","name":"2楼客厅绿米2人感","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d0007753179_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"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":"ON","valueType":"str"},{"property":"topic","propertyType":"msg","value":"PIR-2","valueType":"str"}],"x":110,"y":180,"wires":[["6101b50928dffdc1"],[]]},{"id":"e02c2343c02e659b","type":"timeout","z":"631fd0cf57d0b0ee","name":"10S循环倒计时","outtopic":"","outsafe":"on","outwarning":"on","outunsafe":"off","warning":"0","timer":"10","repeat":false,"again":false,"x":620,"y":120,"wires":[["1b1b2bf0d5924237"]]},{"id":"1b1b2bf0d5924237","type":"switch","z":"631fd0cf57d0b0ee","name":"是否OFF","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":780,"y":120,"wires":[["ad734eecf7a5c905"]]},{"id":"ad734eecf7a5c905","type":"api-call-service","z":"631fd0cf57d0b0ee","name":"关闭虚拟开关2","server":"1416dd087f029896","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.notify_home1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":940,"y":140,"wires":[[]]},{"id":"f8c414720c04a192","type":"api-call-service","z":"631fd0cf57d0b0ee","name":"打开虚拟开关2","server":"1416dd087f029896","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.notify_home1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":440,"y":140,"wires":[["e02c2343c02e659b"]]},{"id":"8919083bf1608535","type":"comment","z":"631fd0cf57d0b0ee","name":"2楼客厅2个人体感应赋值","info":"","x":110,"y":60,"wires":[]},{"id":"a9eed01fd8794500","type":"server-state-changed","z":"631fd0cf57d0b0ee","name":"2楼客厅人感-虚拟开关2","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.notify_home1","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"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":"on","valueType":"str"}],"x":120,"y":680,"wires":[["59d33c497c344fe1","35531d658c43a313"],[]]},{"id":"403b747f85f95a5c","type":"server-state-changed","z":"631fd0cf57d0b0ee","name":"2楼客厅人感-虚拟开关2","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.notify_home1","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"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":"on","valueType":"str"}],"x":120,"y":400,"wires":[["b3aa93e1ee849fa3"],[]]},{"id":"0a9bdefcab0ab235","type":"api-current-state","z":"631fd0cf57d0b0ee","name":"青萍2光感","server":"1416dd087f029896","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"sensor.582d3460de74_illuminance","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":770,"y":360,"wires":[["66f6a20847b049bc"]]},{"id":"66f6a20847b049bc","type":"switch","z":"631fd0cf57d0b0ee","name":"小于数值","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":920,"y":360,"wires":[["6668727decb53261"]]},{"id":"d372bd792bae7645","type":"api-current-state","z":"631fd0cf57d0b0ee","name":"绿米2光感","server":"1416dd087f029896","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"sensor.0x158d0007753179_illuminance","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":770,"y":440,"wires":[["db251d03e86d0ccf"]]},{"id":"db251d03e86d0ccf","type":"switch","z":"631fd0cf57d0b0ee","name":"小于数值","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":920,"y":440,"wires":[["6668727decb53261"]]},{"id":"56a3d5dc69419d3d","type":"comment","z":"631fd0cf57d0b0ee","name":"去除双击状态误触若使用,需删除-客厅灯关闭后-节点,即接入到日落节点之前。","info":"","x":300,"y":1020,"wires":[]},{"id":"1416dd087f029896","type":"server","name":"Home Assistant","version":2,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]



==================================================================
CE973E74-5F1F-44DC-84C6-2F1E816B87EF.png
这个主要是客厅感应灯带图,放了1个绿米人体感应和1个青萍人体设置15S感应,用来错开感应时间。

人感-光感开灯没什么说的,关灯用的node-red-contrib-timeout节点作为循环倒计时,每次人感动作后重置关灯时间。一直到无人状态,倒计时归零输出off,关灯。


然后下面把客厅顶灯开关加入,客厅顶灯开后关闭感应灯带,客厅顶灯关后在日落时间接着就打开感应灯带。

加入6s循环倒计时是为了去除干扰,客厅顶灯开关持续开着或关着时,有时会自动开关灯,加入timeout循环后,可实现6s内联通,倒计时归零后断开。


我发现timeout还挺好用,current节点的当前状态不是实时更新的,加入timeout节点后,即使先打开客厅顶灯开,后打开(6s内打开)感应灯带,也可以实现关灯。



3F4146FF-D1AF-4C2D-8380-EC5F7250D379.png
顶灯这里加了个虚拟开关,实现每天只执行一次----自动打开顶灯。关灯方案还没弄,因为这是2楼,采光不好,睡前客厅灯需要常开的。

2楼客厅环灯带那个流程里也加入了这个虚拟开关1,防止出现顶灯和感应灯带同时开启的问题。

目前把能考虑到的干扰因素都写进去了,还一个卫生间图,很粗暴的用2个人感解决的,见下图。因为刚搬家没几天,后面继续研究1楼厨房,客厅,几个卧室等。

有什么缺陷希望大家指出,复杂的流程图还不会写,感觉流程图越弄越复杂。。。。对了,各个房间都是按照1个绿米人体感应和1个青萍人体感应弄得。
FB9D8F78-CF89-4929-B622-6DA089541E70.png


回复

使用道具 举报

56

主题

929

帖子

4075

积分

论坛元老

Rank: 8Rank: 8

积分
4075
金钱
3146
HASS币
0
发表于 2022-4-4 18:55:59 | 显示全部楼层
适合自己的就是最好的,乐在其中。
回复

使用道具 举报

8

主题

220

帖子

1666

积分

金牌会员

Rank: 6Rank: 6

积分
1666
金钱
1446
HASS币
0
发表于 2022-4-7 14:59:40 | 显示全部楼层
流能不能分享下,谢谢!
海鲜市场:jasona3
回复

使用道具 举报

7

主题

91

帖子

1174

积分

金牌会员

Rank: 6Rank: 6

积分
1174
金钱
1083
HASS币
10
 楼主| 发表于 2022-4-7 20:40:35 | 显示全部楼层
本帖最后由 piaoling 于 2022-4-7 20:53 编辑
jasona3 发表于 2022-4-7 14:59
流能不能分享下,谢谢!
又修改,调整了一下。。。
2楼客厅环灯带,再次修改去除客厅灯3秒内双击误触点亮感应夜灯的可能。家里灯切换亮度需要操作开关,开-关-开多次,去除开关操作过程中误触点亮感应夜灯的可能。
[{"id":"e9e99d2bce867407","type":"comment","z":"e895e69c97f54ab7","name":"2楼客厅顶灯","info":"","x":150,"y":80,"wires":[]},{"id":"7c783e528a3bf472","type":"switch","z":"e895e69c97f54ab7","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":320,"y":560,"wires":[["90c8f62ec84ac7f3","dad6937d39e72361"]]},{"id":"cdbc4dd2dcef22a3","type":"server-state-changed","z":"e895e69c97f54ab7","name":"2楼人感1","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.582d3460de3e_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"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":"ON","valueType":"str"},{"property":"topic","propertyType":"msg","value":"PIR-1","valueType":"str"}],"x":140,"y":580,"wires":[["7c783e528a3bf472","0ee96fb3e4acc3b0"],[]]},{"id":"66528108976740fb","type":"server-state-changed","z":"e895e69c97f54ab7","name":"2楼人感2","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.582d3460de74_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"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":"ON","valueType":"str"},{"property":"topic","propertyType":"msg","value":"PIR-2","valueType":"str"}],"x":140,"y":660,"wires":[["7c783e528a3bf472","0ee96fb3e4acc3b0"],[]]},{"id":"bc7e83098191670b","type":"api-call-service","z":"e895e69c97f54ab7","name":"开灯","server":"1416dd087f029896","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.0x158d00077e2b13_channel_1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1170,"y":600,"wires":[[]]},{"id":"f53277ea06666694","type":"api-call-service","z":"e895e69c97f54ab7","name":"关灯","server":"1416dd087f029896","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.0x158d00077e2b13_channel_1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1170,"y":660,"wires":[[]]},{"id":"0ee96fb3e4acc3b0","type":"timeout","z":"e895e69c97f54ab7","name":"10分钟循环倒计时","outtopic":"","outsafe":"off","outwarning":"off","outunsafe":"on","warning":"0","timer":"590","repeat":true,"again":false,"x":350,"y":660,"wires":[["a0b6a3cdb8f1a965"]]},{"id":"3849fc5817ce66aa","type":"comment","z":"e895e69c97f54ab7","name":"2楼客厅环灯带","info":"","x":160,"y":500,"wires":[]},{"id":"90c8f62ec84ac7f3","type":"api-current-state","z":"e895e69c97f54ab7","name":"2楼人感1-光感","server":"1416dd087f029896","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"sensor.582d3460de3e_illuminance","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":500,"y":520,"wires":[["b1ee089d743f8a64"]]},{"id":"b1ee089d743f8a64","type":"switch","z":"e895e69c97f54ab7","name":"小于数值","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":660,"y":520,"wires":[["18b03684fc0338d6"]]},{"id":"dad6937d39e72361","type":"api-current-state","z":"e895e69c97f54ab7","name":"2楼人感2-光感","server":"1416dd087f029896","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"sensor.582d3460de74_illuminance","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":500,"y":580,"wires":[["fbcf30902b0beb6b"]]},{"id":"fbcf30902b0beb6b","type":"switch","z":"e895e69c97f54ab7","name":"小于数值","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":660,"y":580,"wires":[["18b03684fc0338d6"]]},{"id":"5e0d899335a84b8b","type":"switch","z":"e895e69c97f54ab7","name":"是否OFF","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1260,"y":540,"wires":[["bc7e83098191670b"]]},{"id":"a91bfba19bf5e339","type":"server-state-changed","z":"e895e69c97f54ab7","name":"客厅灯关闭后","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.0x158d00077e2b13_channel_2","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","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,"outputProperties":[{"property":"payload","propertyType":"msg","value":"off","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":450,"y":1000,"wires":[[],[]]},{"id":"7db87cceb5832c7d","type":"api-current-state","z":"e895e69c97f54ab7","name":"检测顶灯状态","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.0x158d00077e2b13_channel_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"off","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1260,"y":480,"wires":[["5e0d899335a84b8b"],[]]},{"id":"b27c33f4a1d2d88f","type":"api-current-state","z":"e895e69c97f54ab7","name":"2楼人感2","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.582d3460de74_motion","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":900,"y":860,"wires":[["d8a3c06a78b612c0"],[]]},{"id":"d8a3c06a78b612c0","type":"switch","z":"e895e69c97f54ab7","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1040,"y":820,"wires":[["cfac56c855fc8c59"]]},{"id":"54a4b5d551cab149","type":"server-state-changed","z":"e895e69c97f54ab7","name":"客厅灯打开后","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.0x158d00077e2b13_channel_2","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","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,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":150,"y":740,"wires":[["9be6514b5aa53a9c"],[]]},{"id":"6f9af8417c562846","type":"api-current-state","z":"e895e69c97f54ab7","name":"检测环灯带状态","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.0x158d00077e2b13_channel_1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":720,"y":660,"wires":[["38874bea9a08cae2"],[]]},{"id":"39fce576e5c51be9","type":"api-current-state","z":"e895e69c97f54ab7","name":"2楼人感1","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.582d3460de3e_motion","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":900,"y":800,"wires":[["d8a3c06a78b612c0"],[]]},{"id":"cfac56c855fc8c59","type":"delay","z":"e895e69c97f54ab7","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1180,"y":820,"wires":[["4fa68b0951a1b7f4"]]},{"id":"2f5dc6b7df5bed1c","type":"api-current-state","z":"e895e69c97f54ab7","name":"日落","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"above_horizon","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"sun.sun","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"above_horizon","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":290,"y":820,"wires":[["48aaa550f916fc70"],[]]},{"id":"48aaa550f916fc70","type":"switch","z":"e895e69c97f54ab7","name":"是否日落","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"above_horizon","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":420,"y":820,"wires":[["d80cea19456cccab"]]},{"id":"9be6514b5aa53a9c","type":"switch","z":"e895e69c97f54ab7","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":320,"y":740,"wires":[["ea68b23b7d5dd8dd"]]},{"id":"38874bea9a08cae2","type":"switch","z":"e895e69c97f54ab7","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":880,"y":660,"wires":[["e46fd8aaefe21c02"]]},{"id":"e46fd8aaefe21c02","type":"delay","z":"e895e69c97f54ab7","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1020,"y":660,"wires":[["f53277ea06666694"]]},{"id":"59c81425a62c65c4","type":"switch","z":"e895e69c97f54ab7","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":320,"y":200,"wires":[["3aa1d2d4cb902bef"]]},{"id":"4960e3a4971a8455","type":"server-state-changed","z":"e895e69c97f54ab7","name":"2楼人感1","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.582d3460de3e_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"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":"ON","valueType":"str"},{"property":"topic","propertyType":"msg","value":"PIR-1","valueType":"str"}],"x":140,"y":220,"wires":[["59c81425a62c65c4"],[]]},{"id":"1a953f9ec3bca836","type":"server-state-changed","z":"e895e69c97f54ab7","name":"2楼人感2","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.582d3460de74_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"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":"ON","valueType":"str"},{"property":"topic","propertyType":"msg","value":"PIR-2","valueType":"str"}],"x":140,"y":300,"wires":[["59c81425a62c65c4"],[]]},{"id":"b64629c321c62ed1","type":"api-call-service","z":"e895e69c97f54ab7","name":"开灯","server":"1416dd087f029896","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.0x158d00077e2b13_channel_2"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1130,"y":240,"wires":[["212c2a7e883d05cf"]]},{"id":"eccca4fa802da943","type":"api-call-service","z":"e895e69c97f54ab7","name":"关灯","server":"1416dd087f029896","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.0x158d00077e2b13_channel_2"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1150,"y":300,"wires":[[]]},{"id":"84093bb0227900af","type":"switch","z":"e895e69c97f54ab7","name":"是否OFF","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":700,"y":300,"wires":[["eccca4fa802da943"]]},{"id":"a489fb79f69c9d0c","type":"api-current-state","z":"e895e69c97f54ab7","name":"2楼人感1-光感","server":"1416dd087f029896","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"sensor.0x158d00075f4c04_illuminance","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":820,"y":180,"wires":[["581cd1d6bdef5d1d"]]},{"id":"581cd1d6bdef5d1d","type":"switch","z":"e895e69c97f54ab7","name":"小于数值","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":980,"y":180,"wires":[["b64629c321c62ed1"]]},{"id":"33d5cafa109f34c1","type":"api-current-state","z":"e895e69c97f54ab7","name":"2楼人感2-光感","server":"1416dd087f029896","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"sensor.0x158d0007753179_illuminance","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":820,"y":240,"wires":[["9bcc40f3aef07a4d"]]},{"id":"9bcc40f3aef07a4d","type":"switch","z":"e895e69c97f54ab7","name":"小于数值","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":980,"y":240,"wires":[["b64629c321c62ed1"]]},{"id":"3aa1d2d4cb902bef","type":"api-current-state","z":"e895e69c97f54ab7","name":"虚拟开关1","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.notify_home","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":470,"y":200,"wires":[["76fd6d8ee3b6f9ea"],[]]},{"id":"76fd6d8ee3b6f9ea","type":"switch","z":"e895e69c97f54ab7","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":640,"y":200,"wires":[["a489fb79f69c9d0c","33d5cafa109f34c1"]]},{"id":"d7724a124379d05d","type":"api-call-service","z":"e895e69c97f54ab7","name":"关闭虚拟开关","server":"1416dd087f029896","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.notify_home"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1200,"y":140,"wires":[[]]},{"id":"212c2a7e883d05cf","type":"delay","z":"e895e69c97f54ab7","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1280,"y":220,"wires":[["d7724a124379d05d"]]},{"id":"782e40cc87929c47","type":"inject","z":"e895e69c97f54ab7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 16 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":140,"wires":[["8f41327d1e29574d"]]},{"id":"8f41327d1e29574d","type":"api-call-service","z":"e895e69c97f54ab7","name":"打开虚拟开关","server":"1416dd087f029896","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.notify_home"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":400,"y":140,"wires":[[]]},{"id":"307bec1ddc16b48f","type":"comment","z":"e895e69c97f54ab7","name":"暂无关灯方案","info":"","x":430,"y":280,"wires":[]},{"id":"e20d300f1dc0e437","type":"comment","z":"e895e69c97f54ab7","name":"绿米动静贴/macbook开关机","info":"","x":440,"y":320,"wires":[]},{"id":"d80cea19456cccab","type":"timeout","z":"e895e69c97f54ab7","name":"6S循环倒计时","outtopic":"","outsafe":"on","outwarning":"on","outunsafe":"off","warning":"0","timer":"6","repeat":true,"again":false,"x":580,"y":820,"wires":[["721eb13a4eb859fe"]]},{"id":"721eb13a4eb859fe","type":"switch","z":"e895e69c97f54ab7","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":740,"y":820,"wires":[["39fce576e5c51be9","b27c33f4a1d2d88f"]]},{"id":"ea68b23b7d5dd8dd","type":"timeout","z":"e895e69c97f54ab7","name":"6S循环倒计时","outtopic":"","outsafe":"on","outwarning":"on","outunsafe":"off","warning":"0","timer":"6","repeat":true,"again":false,"x":480,"y":740,"wires":[["a0b6a3cdb8f1a965"]]},{"id":"a0b6a3cdb8f1a965","type":"switch","z":"e895e69c97f54ab7","name":"是否ON","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":560,"y":660,"wires":[["6f9af8417c562846"]]},{"id":"18b03684fc0338d6","type":"api-current-state","z":"e895e69c97f54ab7","name":"虚拟开关1","server":"1416dd087f029896","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.notify_home","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":810,"y":520,"wires":[["95c92e21e33c86bd"]]},{"id":"95c92e21e33c86bd","type":"switch","z":"e895e69c97f54ab7","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":950,"y":520,"wires":[["f0cbfa603cb7858b"],["7db87cceb5832c7d"]]},{"id":"f0cbfa603cb7858b","type":"delay","z":"e895e69c97f54ab7","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1080,"y":480,"wires":[["7db87cceb5832c7d"]]},{"id":"f7f048b8c09b7451","type":"switch","z":"e895e69c97f54ab7","name":"是否off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":680,"y":940,"wires":[["2f5dc6b7df5bed1c"]]},{"id":"9e75dc7bd5b0169d","type":"api-current-state","z":"e895e69c97f54ab7","name":"开关在off状态","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.0x158d00077e2b13_channel_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"off","valueType":"str"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":500,"y":940,"wires":[["f7f048b8c09b7451"],[]]},{"id":"afdda308b968f005","type":"server-state-changed","z":"e895e69c97f54ab7","name":"客厅按钮点击","server":"1416dd087f029896","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d00077e2b13_switch","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"}],"x":150,"y":940,"wires":[["2a2b70052ff4edb6"]]},{"id":"2a2b70052ff4edb6","type":"switch","z":"e895e69c97f54ab7","name":"判断单击","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"button_2_single","vt":"str"},{"t":"eq","v":"button_2_double","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":320,"y":940,"wires":[["9e75dc7bd5b0169d"],[]]},{"id":"65b1481e1841f9d0","type":"comment","z":"e895e69c97f54ab7","name":"去除双击状态误触","info":"","x":890,"y":940,"wires":[]},{"id":"7586ecbdf5ac6eab","type":"switch","z":"e895e69c97f54ab7","name":"是否OFF","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1320,"y":760,"wires":[["bc7e83098191670b"]]},{"id":"4fa68b0951a1b7f4","type":"api-current-state","z":"e895e69c97f54ab7","name":"检测顶灯状态","server":"1416dd087f029896","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.0x158d00077e2b13_channel_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"off","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1340,"y":820,"wires":[["7586ecbdf5ac6eab"],[]]},{"id":"01de10334ae41b5a","type":"comment","z":"e895e69c97f54ab7","name":"不去除双击干扰","info":"","x":680,"y":1000,"wires":[]},{"id":"1416dd087f029896","type":"server","name":"Home Assistant","version":2,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]
回复

使用道具 举报

70

主题

596

帖子

3409

积分

论坛元老

Rank: 8Rank: 8

积分
3409
金钱
2813
HASS币
0
发表于 2022-4-7 22:03:04 | 显示全部楼层
node-red-contrib-timeout要如何安装?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-22 03:53 , Processed in 1.714065 second(s), 29 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表