|
楼主 |
发表于 2018-4-13 11:33:08
|
显示全部楼层
找到了。。。。。。。原来是参数用错了。。。
# 开关门/传感状态
- platform: template
sensors:
door:
friendly_name: 大门状态
entity_id: binary_sensor.door_window_sensor
value_template: '{% if is_state("binary_sensor.door_window_sensor", "off") %}关{% else %}开{% endif %}'
icon_template: >
{% if is_state("binary_sensor.door_window_sensor", "off") %}
mdi:lock
{% else %}
mdi:lock-open
{% endif %}
entity_picture_template: >
{% if is_state("binary_sensor.door_window_sensor", "off") %}
/local/defined_icon/door-closed.png
{% else %}
/local/defined_icon/door-open.png
{% endif %} |
|