用这个逻辑上是不是就行得通
#暗光环境网关灯开启
- alias: light.gateway_light_7811dca47fae_on
trigger:
platform: numeric_state
entity_id: sensor.illumination_7811dca47fae
value_template: '{{ states.sensor.illumination_7811dca47fae.state| int }}'
below: 300
condition:
condition: time
after: '17:00:00'
before: '23:59:00'
action:
service: light.turn_on
entity_id: light.gateway_light_7811dca47fae
#亮光环境网关灯关闭
- alias: light.gateway_light_7811dca47fae_off
trigger:
platform: numeric_state
entity_id: sensor.illumination_7811dca47fae
value_template: '{{ states.sensor.illumination_7811dca47fae.state| int }}'
above: 300
condition:
condition: time
after: '17:00:00'
before: '23:59:00'
action:
service: light.turn_off
entity_id: light.gateway_light_7811dca47fae
|