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

 找回密码
 立即注册
查看: 218|回复: 0

[求助] 如何设置idkaiguan为开时间,中断自动化?

[复制链接]

11

主题

183

帖子

1366

积分

金牌会员

Rank: 6Rank: 6

积分
1366
金钱
1183
HASS币
0
发表于 2024-2-21 18:07:04 | 显示全部楼层 |阅读模式

binary_sensor:
  - platform: gpio
    pin:
      number: 14
      mode: INPUT_PULLUP
    id: kaiguan

    name: "SWITHguodao"
#    internal: true
    on_state:     #切换relay开关
       then:
         switch.toggle: relay


  - platform: gpio
    pin:
      number: 12
      mode: INPUT_PULLUP
    name: "erlouganyingqi"
    device_class: motion
    id: pir501
    filters:
#      - invert:
      - delayed_on: 800ms
      - delayed_off: 10s          #延时关闭
    on_press:
      then:
        - if:
            condition:
              and:
                - binary_sensor.is_on: pir501


            then:
              - logger.log: "Detected somebody activity"
              - switch.turn_on: relay

            else:
              - logger.log: "There is no one around"
              - switch.turn_off: relay

    on_release:                                   #感应不到人关闭开关
      then:
        - switch.turn_off: relay


现在的情况是手动切换kaiguan的状态,过10秒也会延时关灯。
需要中断或者关闭自动关灯的自动化,


感谢!!


回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-29 03:04 , Processed in 0.079654 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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