感谢大佬指明测试方向。按大佬给的测试方法,找了代码测试成功了。
一共用了3种写法,也做一下记录:
weather_shu_shi_du:
friendly_name: weather_shu_shi_du
value_template: "{{ state_attr('weather.tian_qi', 'suggestion') [7]['brf']}}"
这个写法是抓weather.tianqi,属性suggestion数组第8个项目的brf值
weather_kong_qi_zhi_liang:
friendly_name: weather_kong_qi_zhi_liang
value_template: "{{ state_attr('weather.tian_qi', 'aqi').category}}"
这个写法是抓weather.tianqi,属性aqi的category值
weather_feng_xiang:
friendly_name: weather_feng_xiang
value_template: "{{ state_attr('weather.tian_qi', 'winddir') }}"
这个写法是抓weather.tianqi,属性winddir值 |