Hi!
I done configured a mqtt switch into home assistant for a 4Gang Zigbee switch, but instead of a toggle switch icon, I got two flash icons. I know that it can be solved with assumed state, but still, maybe I done something wrong in the config. Anyone have any idea about this?
- name: Door Green Light Switch
state_topic: "tele/ZigBee_BridgeE/DB8A/SENSOR"
command_topic: "cmnd/ZigBee_BridgeE/ZbSend"
value_template: >
{% if value_json['ZbReceived']['0xDB8A']['Endpoint'] == 1 %}
{%- if value_json['ZbReceived']['0xDB8A']['Power'] == 1 -%}
{"device": "0xDB8A","send":{"Power":1},"endpoint":1}
{%- else -%}
{"device": "0xDB8A","send":{"Power":0},"endpoint":1}
{% endif %}
{% else %}
{{ states('switch.door_green_light_switch') }}
{% endif %}
qos: 2
payload_on: '{"device": "0xDB8A","send":{"Power":1},"endpoint":1}'
payload_off: '{"device": "0xDB8A","send":{"Power":0},"endpoint":1}'
retain: true
And another question, because I took this code from a website, what is that type of condition where you use {%- xxx -%}, that middle line usability, what this means?
Update: it is not working even with the assumed state
Update2: the state of the swtich it is always Unknown
Thank you in advance!