Manually configuring an MQTT humidity/temperature device

I have a setup with a Sonoff Bridge flashed wth Tasmota.
The setup is at a remote location bridged over VPN to HA.
In HA I have setup up a Mosquitto broker and MQTT.

I have been unsuccessful in making any form of auto discovery / auto configuration work,
so instead I have configured the devices manually in configuration.yaml

I have some combined temperature / humidity sensors and I can see that they transmit either on the same topic.
My goal is to collect these to combined temperature / humidity devices.
I have successfully managed to get the humidity messages working, but I cannot get the temperature readings to show up.

The MQTT log looks something like this:

tele/sibbarp/SibbarpTemp03/SENSOR

Received 04.01.32
QoS: 0
Payload: SibbarpTemp03:
  Device: '0x4E8E'
  Name: SibbarpTemp03
  Humidity: 53.8
  Endpoint: 1
  LinkQuality: 134
Received 04.07.11
QoS: 0
Payload: SibbarpTemp03:
  Device: '0x4E8E'
  Name: SibbarpTemp03
  Temperature: 7.1
  Endpoint: 1
  LinkQuality: 134
Received 05.01.38
QoS: 0
Payload: SibbarpTemp03:
  Device: '0x4E8E'
  Name: SibbarpTemp03
  Humidity: 53.8
  Endpoint: 1
  LinkQuality: 134
Received 05.07.16
QoS: 0
Payload: SibbarpTemp03:
  Device: '0x4E8E'
  Name: SibbarpTemp03
  Temperature: 6.9
  Endpoint: 1
  LinkQuality: 134

My manual configuration looks like this. The fit/else logic to filter the messages was suggested by Gemini,
that claimed that the MQTT device would be confused unless the messages were probably separated.
I am not that familiar with manual configuration of these devices, so I would not know if it is true or not.

     # DEVICE 5: TEMP/HUM SENSOR 03
    - name: "Temperature 03"
      unique_id: "sommerhus_temp_03_celsius"
      state_topic: "tele/sibbarp/SibbarpTemp03/SENSOR"
      value_template: >
        {% if value_json.SibbarpTemp03.Temperature is defined %}
          {{ value_json.SibbarpTemp03.Temperature }}
        {% else %}
          {{ states('sensor.temperature_03') }}
        {% endif %}
      unit_of_measurement: "°C"
      device_class: temperature
      state_class: measurement
      availability_topic: "tele/sibbarp/LWT"
      device: &temp_device3
        identifiers: ["sommerhus_temp_03"]
        name: "Sommerhus Climate Toilet"

    - name: "Humidity 03"
      unique_id: "sommerhus_temp_03_humidity"
      state_topic: "tele/sibbarp/SibbarpTemp03/SENSOR"
      value_template: >
        {% if value_json.SibbarpTemp03.Humidity is defined %}
          {{ value_json.SibbarpTemp03.Humidity }}
        {% else %}
          {{ states('sensor.humidity_03') }}
        {% endif %}
      unit_of_measurement: "%"
      device_class: humidity
      state_class: measurement
      device: *temp_device3

On the suggestion of ChatGPT I simplied the device definition and now nothing shows up, despite the log shows that one of each measurements have been received.

  # DEVICE 5: TEMP/HUM SENSOR 03

    - name: "Temperature 03"
      unique_id: "sommerhus_temp_03_celsius"
      state_topic: "tele/sibbarp/SibbarpTemp03/SENSOR"
      value_template: "{{ value_json.SibbarpTemp03.Temperature | default(none) }}"
      unit_of_measurement: "°C"
      device_class: temperature
      state_class: measurement
      availability_topic: "tele/sibbarp/LWT"
      device: &temp_device3
        identifiers: ["sommerhus_temp_03"]
        name: "Sommerhus Climate Toilet"

    - name: "Humidity 03"
      unique_id: "sommerhus_temp_03_humidity"
      state_topic: "tele/sibbarp/SibbarpTemp03/SENSOR"
      value_template: "{{ value_json.SibbarpTemp03.Humidity | default(none) }}"
      unit_of_measurement: "%"
      device_class: humidity
      state_class: measurement
      device: *temp_device3

Where are you putting this config?

The config is part of an mqtt section in a mqtt specific config file liked to from configuration.yaml

Linked with
mqtt: !include mqtt.yaml

the mqtt.yaml file contains:
sensor:
and then all the sensor configurations.

I am not super happy about adding devices in the main configuration, but that was the only thing I could get to work and this was also what various Tasmota cookbooks recommended for my particular setup.

I my setup I have a flashed Sonoff bridge configured as a Zigbee coordinator. That was the recommendation I could find for remote sites with low data quota and unstable connections. The VPN connection works flawless.

I am pretty sure I have set option 19 to 0 without success.

I have now executed setoption19 0
Should I remove the manual configurations from configuration.yaml?

And where do I see if the devices appear? They have already been defined in configuration.yaml after all.

There is activity in the Tasmota integration log, but it is just a connection count and a last restart time (with correct recent timestamp).

I am not quote sure what to do from here and what I should look for in the various logs.

I already have the Tasmota integration up running. It does not show info about the devices connected to the coordinator, only about the coordinator itself (basic info about the coordinator, like it is some device on its own).

I use Home Assistant 2026.3.1. So is your Tasmota configured as a coordinator or is it just a bridge passing through the messages?
In the blog posts I read, discovery works fine if it just bridges messages, but less so if it is flashed as a coordinator. Using it in coordinate mode is recommended for remote sites with unreliable connections and limited data quotas I believe.

I have no idea what that is. I have the latest version of tasmota loaded on all my stuff. If you have something different loaded, please lead with that so you are not wasting peoples time.

A Tasmota device should be an MQTT client that connects to an MQTT broker.

I have used this guide to flash the Zigbee bridge with Tasmota.

As he writes, there are then three options:

  1. Use something like Home Assistant’s ZHA integration to control the Sonoff Bridge Pro and act as a Zigbee coordinator
  2. Use Zigbee2MQTT to take control of the Sonoff Bridge Pro and act as a Zigbee coordinator
  3. Flash the Sonoff Bridge Pro’s CC2652 Zigbee chip with Tasmota’s Zigbee coordinator firmware and allow it to act as a Zigbee coordinator (known as Zigbee2Tasmota)

He continues with:
Options 1 and 2 require a separate device such as a Raspberry Pi running something like Home Assistant and possibly Zigbee2MQTT and an MQTT broker such as Mosquitto. If you have something like this already, ZHA or Zigbee2MQTT are excellent options, and in both cases they take control of the Zigbee chip on the Sonoff Bridge Pro using serial over TCP; Tasmota will simply pass bytes between the coordinator and the Zigbee chip. However, the downside of this is that it couples your Zigbee network to the device running ZHA/Zigbee2MQTT, and if that goes down so will your Zigbee network.

So, as I understood it, option 1 and 2, connecting directly to ZHA using basic package bridging is a great option in a home setup, but not optimal for a remote setup, where your devices will be connected to Home Assistant over a possibly flaky connection.

So after flashing the Sonoff with Tasmota, I further flashed it with the coordinate firmware to let it act as a standalone Zigbee coordinator rather than just a package bridge to ZHA.

From other blobs I read when I first configured the thing, the caviat with a standalone coordinate is that it does not autoconfigure devices, since they are a layer behind the other coordinator, so as I understand it, there are now two coordinators talking together rather than just the HA coordinator talking to the devices to the bridge.
So instead, one has to configure the devices manually and that all went reasonable well except that for some odd reason, only humidity shows up despite both temperature and humidity is being received.

So I am really just seeking some advice on how to manually configure an MQTT device give the received messages shown above.
I would assume this to be just pure MQTT configuration, since Mosquitto, Tasmota and all that seem to to their job of sending messages to MQTT.

I have one of those things running ZHA on a test network, because I had it and because I was running it in a remote location, so the WIFI.

TBH I did not understand when I was advising you above.

It is a piece of crap. It only talks to a few devices, small networks and it is very slow because of the radio airtime sharing. Response is abysmal.

Throw it away.

I used this, BTW…

This works as long as you use the firmware he is sharing on his site and you keep it at version 9 or whatever it is, and NEVER let it update…

After a lot of trial and error I finally managed to make my custom configuration work. This pattern did the trick:

      # DEVICE: TEMP/HUM SENSOR 03
      - name: "Sommerhus Climate Toilet Temperature 03"
        unique_id: "sommerhus_temp_03_celsius"
        state_topic: "tele/sibbarp/SibbarpTemp03/SENSOR"
        value_template: "{{ value_json.SibbarpTemp03.Temperature | float(default=none) }}"
        unit_of_measurement: "°C"
        device_class: temperature
        state_class: measurement
        device: &temp_device3
          identifiers: ["sommerhus_temp_03"]
          name: "Sommerhus Climate Toilet"

      - name: "Sommerhus Climate Toilet Humidity 03"
        unique_id: "sommerhus_temp_03_humidity"
        state_topic: "tele/sibbarp/SibbarpTemp03/SENSOR"
        value_template: "{{ value_json.SibbarpTemp03.Humidity | float(default=none) }}"
        unit_of_measurement: "%"
        device_class: humidity
        state_class: measurement
        device: *temp_device3