- 积分
- 7620
- 金钱
- 4626
- 威望
- 0
- 贡献
- 0
- HASS币
- 398
超级版主
我就是六神
- 积分
- 7620
- 金钱
- 4626
- HASS币
- 398
  

|
发表于 2018-6-5 14:29:01
|
显示全部楼层
Conditions can also be part of an action. You can combine multiple service calls and conditions in a single action, and they will be processed in the order you put them in. If the result of a condition is false, the action will stop there so any service calls after that condition will not be executed.
automation:
- alias: 'Enciende Despacho'
trigger:
platform: state
entity_id: sensor.mini_despacho
to: 'ON'
action:
- service: notify.notify
data:
message: Testing conditional actions
- condition: or
conditions:
- condition: template
value_template: '{{ states.sun.sun.attributes.elevation < 4 }}'
- condition: template
value_template: '{{ states.sensor.sensorluz_7_0.state < 10 }}'
- service: scene.turn_on
entity_id: scene.DespiertaDespacho
这是官方给的说明~ |
|