Sonoff TH SI7021 wont show up on Hassio

I can turn ON/OFF my TH16 in hassio, but can’t get any temperature or humidity readings.

My tasmota console output:
19:32:09 MQT: tele/sonoffTH16/STATE = {“Time”:“2019-01-06T19:32:09”,“Uptime”:“0T01:45:15”,“Vcc”:3.531,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“OFF”,“Wifi”:{“AP”:1,“SSId”:“Kaunas”,“BSSId”:“A0:BD:CD:00:4A:DA”,“Channel”:11,“RSSI”:62}}
19:32:09 MQT: tele/sonoffTH16/SENSOR = {“Time”:“2019-01-06T19:32:09”,“SI7021”:{“Temperature”:22.3,“Humidity”:70.6},“TempUnit”:“C”}

sonsor.yaml configuration:

  • platform: mqtt
    name: “Office Temperature”
    state_topic: “tele/sonoffTH16/SENSOR”
    value_template: “{{ value_json[‘SI7021’].Temperature }}”
    unit_of_measurement: “°C”
  • platform: mqtt
    name: “Office Humidity”
    device_class: “humidity”
    state_topic: “tele/sonoffTH16/SENSOR”
    value_template: “{{ value_json[‘SI7021’].Humidity }}”
    unit_of_measurement: “%”

sonsor.yaml is included in configuration.yaml

I tired many variations of the code posted online but i cant get it to show up TH.

Hi,

Your “value_template” is wrong. It should be

value_template: '{{ value_json.SI7021.Temperature }}' 

and

value_template: '{{ value_json.SI7021.Humidity }}'

Hello!

That does not seem to solve the problem, I still get an unknown value in the attribute column.
Please advise

Config:

- platform: mqtt
  name: "IT room Temperature"
  state_topic: "tele/th16itroom/SENSOR"
  value_template: '{{ value_json.SI7021.Temperature }}'
  unit_of_measurement: "°C"
  availability_topic: "tele/th16itroom/LWT"
  payload_available: "Online"
  payload_not_available: "Offline"
- platform: mqtt
  name: "IT room Humidity"
  state_topic: "tele/th16itroom/SENSOR"
  value_template: '{{ value_json.SI7021.Humidity }}'
  unit_of_measurement: "%"
  availability_topic: "tele/th16itroom/LWT"
  payload_available: "Online"
  payload_not_available: "Offline"

First I had this config:

- platform: mqtt
  name: "IT room Temperature"
  state_topic: "tele/th16itroom/SENSOR"
  value_template: "{{ value_json['SI7021'].Temperature }}"
  unit_of_measurement: "°C"
  availability_topic: "tele/th16itroom/LWT"
  payload_available: "Online"
  payload_not_available: "Offline"
- platform: mqtt
  name: "IT room Humidity"
  state_topic: "tele/th16itroom/SENSOR"
  value_template: "{{ value_json['SI7021'].Humidity }}"
  unit_of_measurement: "%"
  availability_topic: "tele/th16itroom/LWT"
  payload_available: "Online"
  payload_not_available: "Offline"

Like @ziauriaiziaurus I’ve just changed the DHT22 to SI7021

Edit:
This is the line we need to extract it from:

"StatusSNS":{"Time":"2019-01-13T22:33:10","SI7021":{"Temperature":19.7,"Humidity":55.9},"TempUnit":"C"}}

Second edit:
I’ve checked the lines from my POW:

{"StatusSNS":{"Time":"2019-01-13T22:34:31","ENERGY":{"TotalStartTime":"2019-01-13T21:19:44","Total":0.197,"Yesterday":0.000,"Today":0.197,"Power":153,"ApparentPower":153,"ReactivePower":0,"Factor":1.00,"Voltage":212,"Current":0.721}}}

With config:

- platform: mqtt
  name: "Fridge Energy"
  state_topic: "tele/fridge/SENSOR"
  value_template: '{{ value_json["ENERGY"]["Today"] }}'
  unit_of_measurement: "kWh"

And this does work, tried to apply this:

- platform: mqtt
  name: "IT room Temperature"
  state_topic: "tele/th16itroom/SENSOR"
  value_template: '{{ value_json["SI7021"]["Temperature"] }}'
  unit_of_measurement: "°C"
  availability_topic: "tele/th16itroom/LWT"
  payload_available: "Online"
  payload_not_available: "Offline"
- platform: mqtt
  name: "IT room Humidity"
  state_topic: "tele/th16itroom/SENSOR"
  value_template: '{{ value_json["SI7021"]["Humidity"] }}'
  unit_of_measurement: "%"
  availability_topic: "tele/th16itroom/LWT"
  payload_available: "Online"
  payload_not_available: "Offline"

But still unknown in the attribute section.

Third edit:

Auto discovery with “setoption19 1” does seem to work and creates a sensor called: sensor.it_room_th16_SI7021_temperature & humidity

Though i’d still like to fix this.

I am tyring to config a Sonof TH16 wiht SI7021 sensor and Tasmota firmware 6.4.1 I have same issue where it will not read temperatures. Anyone have a working config for HA 0.86.x?

I have tired all the following configs :
value_template: “{{ value_json[‘SI7021’].Temperature }}”
value_template: ‘{{ value_json[“SI7021”][“Temperature”] }}’
value_template: ‘{{ value_json.SI7021.Temperature }}’

Thanks,
Aaron

Does anyone have a working config with Tasmota and SI7021 sensor?

- platform: mqtt
    state_topic: 'D1minib/tele/SENSOR'
    name: 'Temperature'
    unit_of_measurement: '°C'
    value_template: '{{ value_json.SI7021.Temperature }}'
  - platform: mqtt
    state_topic: 'D1minib/tele/SENSOR'
    name: 'Humidity'
    unit_of_measurement: '%'
    value_template: '{{ value_json.SI7021.Humidity }}'
1 Like

It worked! I copied your value_template and I also had a leading / on my state_topic which may have been cuasing problems. Many thanks!