找回密码
 立即注册
查看: 4596|回复: 1

[求助] 新版HA人体感应和sonoff互动失效,恳请指点自动化代码,谢...

[复制链接]

175

主题

462

回帖

3832

积分

论坛元老

积分
3832
金钱
3190
HASS币
0
发表于 2018-12-30 17:37:42 | 显示全部楼层 |阅读模式
本帖最后由 ptlzx 于 2018-12-30 17:40 编辑

HA版本0.84.6
以前用如下代码正常的,现在新版的就失效了:
- alias: switch.sonoff_4_on
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_158d00016db923
    from: 'off'
    to: 'on' 
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: sun.sun
        state: "below_horizon"
      - condition: time
        after: '17:00:00'
        before: '05:00:00'
  action:
    - service: switch.turn_on
      entity_id: switch.sonoff_4

用UI设置自动化代码,也一样没有效果:
- id: 600ce25b2bd94bf5b533b8dee0127d6d
  alias: switch.sonoff_4_on
  trigger:
  - entity_id: binary_sensor.motion_sensor_158d00016db923
    from: 'off'
    platform: state
    to: 'on'
  condition:
  - after: '17:00:00'
    before: 05:00:00
    condition: time
  action:
  - data:
      entity_id:
      - switch.sonoff_4
    service: switch.turn_on



回复

使用道具 举报

27

主题

2120

回帖

9074

积分

论坛元老

积分
9074
金钱
6922
HASS币
30

论坛元老

发表于 2018-12-30 18:15:54 | 显示全部楼层
state: "below_horizon" 这个不应该是单引号么
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2025-5-5 11:23 , Processed in 0.104962 second(s), 24 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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