Hello Community,
I could use some quick help regarding the mqtt select entity.
I want it to publish but to also listen but I’m not really getting there. Now it is working if I double quote the Options but I don’t think that’s how it’s supposed to go. I mean it has an comman_template option so just like value_template I should be able to define a template for it.
Now that’s the part I’m struggeling with
- platform: mqtt
command_topic: hass/temp/alarm1/value
command_template: |
{% set options = { "1" : "00", "Notschnur Dusche" : "2" ,
"3" :"Notschnur Toilette", "3": "Rückmeldung: erreicht" , "4": "Rückmeldung: nicht erreicht" ,
"5" : "Rückmeldung: Ok" , "6" : "Rückmeldung: Hilfe benötigt" ,
"7" : "Rückmeldung notwendig" , "8" : "erledigt" , "9": "evtl. erledigt"} %}
state_topic: hass/temp/alarm1/value
value_template: "{{value_json}}"
name: "w01_ueberwachung_alarm1"
options:
- "00"
- "Notschnur Dusche"
- "Notschnur Toilette"
- "Rückmeldung: erreicht"
- "Rückmeldung: nicht erreicht"
- "Rückmeldung: Ok"
- "Rückmeldung: Hilfe benötigt"
- "Rückmeldung Notwendig"
- "erledigt"
- "evtl. erledigt"
This just sends empty payloads.
So far I’ve tried to remove the quotes around value_json (without using command_template), this publishes the payloads correctly but my other MQTT Select that is supposed to listen to the same topic with the same options doesn’t switch options. I know that it’s supposed to work becaus eif I use double quotes on one of the select’s options it works but that’s not what I need (because in that case the other select wouldn’t switch the first select)
I’ve also tried a different template for command_template like {{value_json} or {{ options }}. I’m thinking I might have to do an if template but it feels like this would kinda defeat the purpose of the mqtt select entity.
Any help is appriciated.