感谢楼主的插件,hassio:0.84.6测试成功!
- platform: youjia
name: youjia
scan_interval: 3600
unit_of_measurement: "元/升"
city: "zhejiang"
- platform: template
sensors:
youjia_city:
friendly_name: "城市"
# value_template: "{{ states.sensor.youjia.attributes.city }}"
value_template: '{% if states.sensor.youjia.attributes.city == "zhejiang" %}浙江{% else %}未知{% endif %}'
youjia_92:
friendly_name: "92#汽油"
unit_of_measurement: '元/升'
value_template: "{{states.sensor.youjia.attributes.qiyou92}}"
youjia_95:
friendly_name: "95#汽油"
unit_of_measurement: '元/升'
value_template: "{{states.sensor.youjia.attributes.qiyou95}}"
youjia_98:
friendly_name: "98#汽油"
unit_of_measurement: '元/升'
value_template: "{{states.sensor.youjia.attributes.qiyou98}}"
youjia_caiyou:
friendly_name: "0#柴油"
unit_of_measurement: '元/升'
value_template: "{{states.sensor.youjia.attributes.caiyou}}"
youjia_update_time:
friendly_name: "爬虫时间"
value_template: "{{states.sensor.youjia.attributes.time}}"
# yuanyoujia:
# friendly_name: "原油价格"
# unit_of_measurement: '美元/桶'
# value_template: "{{states.sensor.youjia.attributes.yuanyou}}"
# yuanyou_update_time:
# friendly_name: "原油价更新时间"
# value_template: "{{states.sensor.youjia.attributes.yuanyou_update}}"
|