Trying to get temp data from Tasmota Sonoff th10

I have the Sonoff th10/16 with tasmotta installed. Im trying to pull the temp data from the MQTT topic.

This is what it looks like in the console:

19:07:32 MQT: tele/3rdfloorAC/SENSOR = {“Time”:“2018-07-08T19:07:32”,“AM2301”:{“Temperature”:75.2,“Humidity”:49.5},“TempUnit”:“F”}

this is my package code:

sensor:

platform: mqtt
name: “3rd floor temp”
state_topic: “tele/3rdfloorAC/SENSOR”
qos: 0
unit_of_measurement: “°F”

platform: mqtt
name: “Office Temperature”
state_topic: “tele/Office/SENSOR”
value_template: “{{ value_json[‘AM2301’].Temperature }}”
unit_of_measurement: “°F”

My output on the first sensor gives the fullt topic

{“Time”:“2018-07-08T19:12:34”,“AM2301”:{“Temperature”:75.4,“Humidity”:49.5},“TempUnit”:“F”} °F

My second one I copied from other threads in the forums. I even waited 45 min and reboot just in case it needed that time. But it stays as unknown.

Your two sensors are calling different MQTT state topics, is this intentional?

Try
value_template: “{{ value_json.AM2301.Temperature }}”

Try something like the following

  - platform: mqtt
    name: "Bedroom Temp"
    state_topic: "tele/sonoff3/SENSOR"
    unit_of_measurement: '°C'
    value_template: "{{ value_json.BME280.Temperature }}"
  - platform: mqtt
    name: "Bedroom Humidity"
    state_topic: "tele/sonoff3/SENSOR"
    unit_of_measurement: '%'
    value_template: "{{ value_json.BME280.Humidity }}"

that was it! Thank you.

Now I can use the temperature to setup some automations!

1 Like