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
Alternative firmware for ESP8266 with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full do...
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.