So, I have also problem regarding “unknown” status after HA restart…
When I click on sensor I can manualy set correct status:
After I click on sensor or if automation set ON or OFF, after that status is correct…
Tasmota:
So, probably the problem is:
switch:
- platform: mqtt
name: "Zunaj - steber (luč)"
state_topic: "stat/Sonoff-TH16-Steber/POWER"
command_topic: "cmnd/Sonoff-TH16-Steber/POWER"
availability_topic: "tele/Sonoff-TH16-Steber/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: false
sensor:
- platform: mqtt
name: "Zunaj-T"
state_topic: "tele/Sonoff-TH16-Steber/SENSOR"
value_template: '{{ value_json["AM2301"]["Temperature"] }}'
unit_of_measurement: "°C"
- platform: mqtt
name: "Zunaj-V"
state_topic: "tele/Sonoff-TH16-Steber/SENSOR"
value_template: '{{ value_json["AM2301"]["Humidity"] }}'
unit_of_measurement: "%"
What would be correct settings in my configuration…
Probably also enable PowerRetain, but not only this as this do not resolve my “unknown” status problem…
Can anybody help me to get correct sensor mqtt settings… Thank you…