本帖最后由 情非殇 于 2018-10-4 11:18 编辑
- alias: s2233 #自动化名称(英文)
trigger: #触发器
platform: state #从不在家到在家,触发条件
entity_id: device_tracker.paulus, device_tracker.anne_therese
from: 'not_home'
to: 'home'
condition: #条件
condition: and #同时满足多个条件
conditions:
#日落后1小时至日出前1小时之内,这个需求应该写作条件
- condition: time #在周几的几点到几点之间
after: '15:00:00'
before: '20:00:00'
weekday:
- mon
- wed
- fri
- condition: state
entity_id: switch.sonoff_other
state: off
#日落后一小时
- condition: sun
event: sunset
offset: "01:00:00"
#日出前半小时
- condition: sun
event: sunrise
offset: "-00:30:00"
action: #动作
#动作1
- service: switch.turn_on
entity_id: switch.sonoff_other
#动作2
- delay: '00:30:00'
#动作3
- service: switch.turn_off
entity_id: switch.sonoff_other
至于日出日落时间提取,可以参考Mirukuteii的帖子https://bbs.hassbian.com/thread-3273-1-1.html
|