ESP8266 + DHT 22 sensor post to local MQTT server, but can't post to HASSio

I’ve managed to post to local Mosqito server a topic “DHT22/json”. I can’t separate them to a different topics.
The data comes correctly like this:


My configuration.yaml file looks like this:

# MQTT Sensor Example configuration.yaml entry
  username: local
  password: local

  - platform: mqtt
    unique_id: ESP001189E4Temp
    name: "Temperature"
    state_topic: "DHT22/json"
    unit_of_measurement: "°C"
    value_template: "{{ value_json.dhtt1 }}"
  - platform: mqtt
    unique_id: ESP001189E4Humid
    name: "Humidity"
    state_topic: "DHT22/json"
    unit_of_measurement: "%"
    value_template: "{{ value_json.dhth1 }}"

But the readings dispayed is always 0.
Please help. I dont’t know how to read correct value on my dashboard?

Have you verified what is actually on your MQTT broker?
MQTT Explorer is an incredible tool to check this.

Yes I did. That’s where I’ve copied the JSON from.

Please try this value templates.

{{ value_json.sensors.dhtt1 }}
{{ value_json.sensors.dhth1 }}
1 Like

Thank you. Your sollution work well.

1 Like