3
47
222
中级会员
- id: '1535792456242' alias: AQI_light trigger: platform: numeric_state entity_id: sensor.chinese_air_quality_index above: 1 below: 100 action: service: light.turn_on entity_id: light.gateway_light_7c49eb1a5d92 data: brightness: 20 color_name: green
使用道具 举报
35
533
2895
金牌会员
debitus 发表于 2018-9-1 19:11 我是小白,说的可能都是错的。 你现在用numeric state来trigger,我感觉只有在sensor.chinese_air_quality_ ...
redeemer 发表于 2018-9-1 22:42 有道理,请问方便分享一下你的自动化吗?
- alias: aqi_then_light_auto_on trigger: - platform: time at: '07:00:00' condition: condition: numeric_state entity_id: sensor.airx_outside_pm25 above: 70 action: - service: light.turn_on data_template: entity_id: light.gateway_light_34ce008c2033 brightness: 60 color_name: > {%- if (states.sensor.airx_outside_pm25.state | int > 70) and (states.sensor.airx_outside_pm25.state | int <= 150) -%} yellow {%- elif (states.sensor.airx_outside_pm25.state | int > 150) and (states.sensor.airx_outside_pm25.state | int <= 250) -%} red {%- elif (states.sensor.airx_outside_pm25.state | int > 250) -%} purple {%- endif -%} - delay: 02:30:00 - service: light.turn_off entity_id: light.gateway_light_34ce008c2033
debitus 发表于 2018-9-1 22:58 [code]- alias: aqi_then_light_auto_on trigger: - platform: time
本版积分规则 发表回复 回帖后跳转到最后一页
Archiver|手机版|小黑屋|Hassbian
GMT+8, 2024-11-23 22:39 , Processed in 0.623612 second(s), 27 queries .
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.