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

 找回密码
 立即注册
查看: 18802|回复: 21

[技术探讨] sonoff改人体感应-HC-SR501的问题

[复制链接]

4

主题

341

帖子

3426

积分

论坛元老

Rank: 8Rank: 8

积分
3426
金钱
3085
HASS币
0
发表于 2018-11-19 09:03:38 | 显示全部楼层 |阅读模式
sonoff改装了人体感应之后(参考这个帖子),很灵敏,现在有个问题,可以通过自动化开启和定时关闭,这个没问题,但是这个模块在有人的时候一直在on和OFF状态切换,而且HA的自动化,我设置的是延迟关闭。
我想请教一下,能不能在sonoff的人体模块在感应到人体(ON)的状态之后,能不能重新计时这个delay的时间,从而不会出现一直开灯关灯(比如说我要在厨房呆半小时,我设置的延迟时间是5分钟,那么灯就会开关6次),如果能,就不会出现这种开关频繁的情况!或者说不知道能不能通过其他方式实现!?

回复

使用道具 举报

23

主题

656

帖子

4613

积分

元老级技术达人

积分
4613
金钱
3942
HASS币
30

教程狂人

QQ
发表于 2018-11-19 09:55:22 | 显示全部楼层
可以实现,如果你使用的tasmota的固件的话,可在控制台中使用rlue规则实现,设置一个5分钟倒计时的定时器,当人体传感器的开关状态为1时,倒计时不执行,当人体模块的开关状态变为0时,延时五分钟关闭输出
回复

使用道具 举报

23

主题

1338

帖子

6757

积分

超级版主

Rank: 8Rank: 8

积分
6757
金钱
5394
HASS币
100

教程狂人

发表于 2018-11-19 10:02:21 | 显示全部楼层
ha automation里面关灯加一个for: 5mins
回复

使用道具 举报

27

主题

387

帖子

3255

积分

元老级技术达人

积分
3255
金钱
2848
HASS币
40

教程狂人

发表于 2018-11-19 10:07:24 | 显示全部楼层
可參考這篇文章裡面的 等待60秒語法https://bbs.hassbian.com/forum.php?mod=viewthread&tid=3033
Image_20181119_001.png
回复

使用道具 举报

8

主题

2073

帖子

6053

积分

论坛元老

流水无味

Rank: 8Rank: 8

积分
6053
金钱
3980
HASS币
145

灌水之王

发表于 2018-11-19 10:41:56 | 显示全部楼层
ha的自动化没怎么研究
node red 可以参考这种
[{"id":"367db195.219c9e","type":"tab","label":"流程1","disabled":false,"info":""},{"id":"813721ec.850bf","type":"api-call-service","z":"367db195.219c9e","name":"打开洗手间灯","server":"9fb7a6b8.7a26f8","service_domain":"switch","service":"turn_on","data":"{"entity_id": "switch.xuanguan_aa84f8_2"}","mergecontext":"","x":1080,"y":200,"wires":[[]]},{"id":"303b5438.4a03ac","type":"server-state-changed","z":"367db195.219c9e","name":"洗手间感应","server":"9fb7a6b8.7a26f8","entityidfilter":"binary_sensor.esp01wc","entityidfiltertype":"substring","haltifstate":"","x":160,"y":240,"wires":[["79b0e470.db558c"]]},{"id":"d838f272.e96c7","type":"api-call-service","z":"367db195.219c9e","name":"关闭洗手间灯","server":"9fb7a6b8.7a26f8","service_domain":"switch","service":"turn_off","data":"{"entity_id": "switch.xuanguan_aa84f8_2"}","mergecontext":"","x":1480,"y":300,"wires":[[]]},{"id":"75564a90.418394","type":"api-current-state","z":"367db195.219c9e","name":"洗手灯开","server":"9fb7a6b8.7a26f8","halt_if":"off","override_topic":true,"override_payload":true,"entity_id":"switch.xuanguan_aa84f8_2","x":1140,"y":300,"wires":[["b175f7dd.1d6968"]]},{"id":"95a4f016.29fb1","type":"comment","z":"367db195.219c9e","name":"洗手间灯光","info":"","x":160,"y":200,"wires":[]},{"id":"b8e8c855.e3f158","type":"switch","z":"367db195.219c9e","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":540,"y":240,"wires":[["23558da6.a4bcc2","b29849c7.cae608"],["23558da6.a4bcc2"]]},{"id":"79b0e470.db558c","type":"time-range-switch","z":"367db195.219c9e","name":"","lat":"28.2870742103","lon":"121.0694003105","startTime":"06:50","endTime":"17:00","startOffset":"17:01","endOffset":"06:49","x":350,"y":240,"wires":[[],["b8e8c855.e3f158"]]},{"id":"ce6c4df3.30f93","type":"api-current-state","z":"367db195.219c9e","name":"洗手门未关","server":"9fb7a6b8.7a26f8","halt_if":"off","override_topic":true,"override_payload":true,"entity_id":"binary_sensor.door_window_sensor_158d0001d85160","x":970,"y":300,"wires":[["75564a90.418394"]]},{"id":"23558da6.a4bcc2","type":"stoptimer","z":"367db195.219c9e","duration":"4","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":760,"y":300,"wires":[["ce6c4df3.30f93"],[]]},{"id":"b29849c7.cae608","type":"api-current-state","z":"367db195.219c9e","name":"洗手灯关","server":"9fb7a6b8.7a26f8","halt_if":"on","override_topic":true,"override_payload":true,"entity_id":"switch.xuanguan_aa84f8_2","x":740,"y":200,"wires":[["efd8e6e6.3687c8"]]},{"id":"acedce59.14f54","type":"server-state-changed","z":"367db195.219c9e","name":"洗手间门状态","server":"9fb7a6b8.7a26f8","entityidfilter":"binary_sensor.door_window_sensor_158d0002a12afe","entityidfiltertype":"substring","haltifstate":"","x":350,"y":300,"wires":[["6005bfd0.b2af2"]]},{"id":"6005bfd0.b2af2","type":"switch","z":"367db195.219c9e","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":520,"y":300,"wires":[["23558da6.a4bcc2"],[]]},{"id":"fa5b286a.16d448","type":"server-state-changed","z":"367db195.219c9e","name":"客厅门状态","server":"9fb7a6b8.7a26f8","entityidfilter":"binary_sensor.door_window_sensor_158d0002a12afc","entityidfiltertype":"substring","haltifstate":"","x":160,"y":380,"wires":[["ab94a32d.aad7a"]]},{"id":"3bec72c1.f6acde","type":"switch","z":"367db195.219c9e","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":520,"y":380,"wires":[[],["b57662b4.17a1c"]]},{"id":"ab94a32d.aad7a","type":"time-range-switch","z":"367db195.219c9e","name":"","lat":"28.2870742103","lon":"121.0694003105","startTime":"05:50","endTime":"22:00","startOffset":"22:01","endOffset":"05:49","x":350,"y":380,"wires":[[],["3bec72c1.f6acde"]]},{"id":"b57662b4.17a1c","type":"delay","z":"367db195.219c9e","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":740,"y":380,"wires":[["ce6c4df3.30f93"]]},{"id":"5773a05b.0d3e1","type":"time-range-switch","z":"367db195.219c9e","name":"日落日出","lat":"28.2870742103","lon":"121.0694003105","startTime":"sunrise","endTime":"sunset","startOffset":"30","endOffset":"-30","x":340,"y":180,"wires":[[],[]]},{"id":"efd8e6e6.3687c8","type":"api-current-state","z":"367db195.219c9e","name":"洗手间自动化","server":"9fb7a6b8.7a26f8","halt_if":"off","override_topic":true,"override_payload":true,"entity_id":"input_boolean.testxishoujian","x":900,"y":200,"wires":[["813721ec.850bf"]]},{"id":"b175f7dd.1d6968","type":"api-current-state","z":"367db195.219c9e","name":"洗手间自动化","server":"9fb7a6b8.7a26f8","halt_if":"off","override_topic":true,"override_payload":true,"entity_id":"input_boolean.testxishoujian","x":1300,"y":300,"wires":[["d838f272.e96c7"]]},{"id":"9fb7a6b8.7a26f8","type":"server","z":"","name":"Home Assistant","legacy":true,"hassio":true,"rejectUnauthorizedCerts":true}]
回复

使用道具 举报

4

主题

341

帖子

3426

积分

论坛元老

Rank: 8Rank: 8

积分
3426
金钱
3085
HASS币
0
 楼主| 发表于 2018-11-19 12:24:35 | 显示全部楼层
alei643 发表于 2018-11-19 09:55
可以实现,如果你使用的tasmota的固件的话,可在控制台中使用rlue规则实现,设置一个5分钟倒计时的定时器, ...

我用的就是tasmota,但是命令不会,还没去仔细研究过!
回复

使用道具 举报

4

主题

341

帖子

3426

积分

论坛元老

Rank: 8Rank: 8

积分
3426
金钱
3085
HASS币
0
 楼主| 发表于 2018-11-19 12:27:09 | 显示全部楼层
natic 发表于 2018-11-19 10:02
ha automation里面关灯加一个for: 5mins

具体怎么加,有具体的写法吗?
回复

使用道具 举报

4

主题

341

帖子

3426

积分

论坛元老

Rank: 8Rank: 8

积分
3426
金钱
3085
HASS币
0
 楼主| 发表于 2018-11-19 12:28:51 | 显示全部楼层
xieahui 发表于 2018-11-19 10:41
ha的自动化没怎么研究
node red 可以参考这种
[code][{"id":"367db195.219c9e","t ...

我N1装的HASS,node red安装一直搞不定!很无奈
回复

使用道具 举报

4

主题

341

帖子

3426

积分

论坛元老

Rank: 8Rank: 8

积分
3426
金钱
3085
HASS币
0
 楼主| 发表于 2018-11-19 12:30:50 | 显示全部楼层
windgo 发表于 2018-11-19 10:07
可參考這篇文章裡面的 等待60秒語法https://bbs.hassbian.com/forum.php?mod=viewthread&tid=3033

...

感谢,看来我论坛还是逛的不够啊,还得再继续研究研究
回复

使用道具 举报

23

主题

1338

帖子

6757

积分

超级版主

Rank: 8Rank: 8

积分
6757
金钱
5394
HASS币
100

教程狂人

发表于 2018-11-19 15:21:11 | 显示全部楼层
georgewu57 发表于 2018-11-19 12:27
具体怎么加,有具体的写法吗?

官方文档很详细,谷歌搜一下就有了
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-26 14:46 , Processed in 0.227964 second(s), 36 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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