13
124
541
高级会员
使用道具 举报
25
662
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
131
1088
论坛积极会员
2
178
2857
金牌会员
本版积分规则 发表回复 回帖后跳转到最后一页
经常参与各类话题的讨论,发帖内容较有主见
Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )
GMT+8, 2025-6-25 22:42 , Processed in 0.063893 second(s), 24 queries .
Powered by Discuz! X3.5
© 2001-2025 Discuz! Team.