I’m running into a bit of an issue (likely a small one for you experts) regarding MQTT.
I have a Wemos D1 flashed with Tasmota that collects various values from my heating system:
2 temperature values for the heating circuit
2 temperature values for the hot water circuit
A distance value for the oil tank level
A “switch” that monitors burner malfunctions
The last item—the burner malfunction switch—is the one giving me trouble.
In Tasmota, this switch only appears in the logs, not in the UI (which is fine by me).
The value appears correctly in the JSON payload sent via MQTT; for example, it shows "Switch1": "ON".
I have verified this using MQTT Explorer.
The Wemos D1 also shows up correctly in the Home Assistant Tasmota integration.
The Problem:
In Home Assistant, all values are displayed except for this specific switch.
I’m a bit stuck on how to get it to show up.
I added the following to my configuration.yaml:
mqtt:
binary_sensor:
- name: “Heizöltank Stoerung”
state_topic: “Heizoeltank/tele/sensor”
value_template: “{{ value_json.Switch1 }}”
payload_on: “on”
payload_off: “off”
device_class: “power” # Optional: Zeigt Blitz-Icon für Strom an
unique_id: “heizoeltank_switch_1” # Wichtig für die UI-Bearbeitung
device:
identifiers: “Heizoeltank” # Einmaliger Name für das Gerät
name: “Heizoeltank”
model: “ESP8266 mit Tasmota”
manufacturer: “Tasmota”
The state_topic matches what I see in MQTT Explorer.
Besides the sensor path, I could also use the path Heizoeltank/stat/STATUS10 (though I haven’t tested that yet).
I cannot (and would rather not) manually simulate a burner malfunction just for testing.
Despite adding the entry in the configuration, nothing has changed regarding the entities shown for the Tasmota device.
The state of “Switch1” is still not visible, so I can’t set up any automations for it.
I would really appreciate any input or tips on what I might be doing wrong.
The main difference between my configuration and yours is that I removed the payload_off and payload_on options. Their default values are OFF and ON respectively so there’s no need to include them.
Hm, strange…
I tried to follow you along.
Removed payload_off and payload_on from my configuration.yaml.
Then copied the JSON to the clipboard, navigate to "Heizoeltank/tele/sensor" in the MQTT Explorer and published the pasted JSON.
But the binary_sensor.heizoeltank_heizoltank_stoerung did not changed the value
I hesitate to state the obvious but you are doing something differently because I have proven that it does work. The challenge now is to determine what exactly you are doing differently.
First, check Logs for any associated warnings or errors.
Is that a misprint or does the word heizoeltank actually appear twice in its entity_id?
Double-check the topic’s spelling. Confirm it is actually Heizoeltank/tele/sensor and is not misspelled.
Oh man, you are right.
The binary sensor is copied directly out of HA and it is not a misprint.
But I dont understand, where it comes from.
The binary sensor is configured in the configuration.yaml, right?
The Heizoeltank/tele/sensor is confirmed.
Here again the complete mqtt-section of my configuration.yaml:
I need two binary sensors, since I need to watch for two heating systems.
But I cannot see, where the double appearance is coming from, nor where I can change it.