条件是这么写的,下半部分就不知道你在说啥了
automation:
trigger:
platform: template
value_template: "{% if is_state_attr('switch.xxx', 'brightness', 40) %}true{% endif %}"
trigger:
platform: state
entity_id: switch.yyy
from: 'on'
to: 'off'
trigger:
platform: state
entity_id: switch.yyy
from: 'off'
to: 'on'
|