Mqtt reception of several termustates

Hello Together,

I am quite new to Home-Assistant and am doing my first project right now.

I use the following addon to receive data from several thermostats.

The output looks like this.

homeassistant/sensor/currentcost/Ambient_Weather_F007TH_Thermo-Hygrometer/null {“time” : “2019-02-15 18:32:08”, “model” : “Ambient Weather F007TH Thermo-Hygrometer”, “device” : 253, “channel” : 1, “battery” : “Ok”, “temperature_C” : 6.667, “humidity” : 58, “mic” : “CRC”}
homeassistant/sensor/currentcost/Ambient_Weather_F007TH_Thermo-Hygrometer/null {“time” : “2019-02-15 18:32:14”, “model” : “Ambient Weather F007TH Thermo-Hygrometer”, “device” : 135, “channel” : 2, “battery” : “Ok”, “temperature_C” : 23.444, “humidity” : 47, “mic” : “CRC”}

The output always has the same state_topic:
The thermostats differ only in “device” and “channel”.

When I try to receive data via the mqtt sensor, I always receive data from all thermostats simultaneously.

how can I distinguish the thermostats from each other and make a separate display for each one?

I use this code

  • platform: mqtt
    name: Küche
    state_topic: “homeassistant/sensor/currentcost/Ambient_Weather_F007TH_Thermo-Hygrometer/null”
    unit_of_measurement: “°C”
    value_template: ‘{{ value_json.temperature_C }}’

And the same with a different name for the second sensor.

Take a look here:

1 Like

Thank you for your answer.

It helped!

In my case, I used the Channel ID.

#Temperatursensoren
sensor Draußen
sensor:

  • platform: mqtt
    state_topic: “home/rtl_433/Ambient_Weather_F007TH_Thermo-Hygrometer/null”
    name: “Draussen Temperatur”
    unit_of_measurement: “°C”
    value_template: >
    {% if value_json is defined and value_json.channel == 1 %}
    {{ value_json.temperature_C }}
    {% else %}
    {{ states(‘sensor.Draussen_Temperatur’) }}
    {% endif %}
  • platform: mqtt
    state_topic: “home/rtl_433/Ambient_Weather_F007TH_Thermo-Hygrometer/null”
    name: “Draussen Feuchtigkeit”
    unit_of_measurement: “%”
    value_template: >
    {% if value_json is defined and value_json.channel == 1 %}
    {{ value_json.humidity }}
    {% else %}
    {{ states(‘sensor.Draussen_Feuchtigkeit’) }}
    {% endif %}