13
137
541
高级会员
使用道具 举报
25
688
3630
论坛元老
action: - service: light.turn_on entity_id: light.gateway_light_34xxxxx data_template: brightness: 255 color_name: > {% if (states.sensor.heweather_aqi.state|int) <= 50 %}green {% elif 50 < (states.sensor.heweather_aqi.state|int) <= 100 %}yellow {% elif (states.sensor.heweather_aqi.state|int) >= 100 %}red {% else %}white {% endif %}
aktifin 发表于 2018-4-11 13:28 试了一下估计是[]和if代码之间有问题 换了个思路,这个测试可行
3
134
1088
论坛积极会员
2
177
2671
金牌会员
本版积分规则 发表回复 回帖后跳转到最后一页
经常参与各类话题的讨论,发帖内容较有主见
Archiver|手机版|小黑屋|Hassbian
GMT+8, 2024-6-5 15:59 , Processed in 0.305217 second(s), 28 queries .
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.