Hi there,
I have a Sonoff SNZB-02 connected to Sonoff Zigbee Bridge ZBBridge flashed with latest Tasmota firmware.
I managed to connect the bridge to Home Assistant via MQTT broker. I can read values from the temperature/humidity sensor.
The problem is, that the MQTT message is sometimes missing Temperature or Humidity value.
e.q.
{
"ZbReceived": {
"tasmotatest": {
"Device": "0x1F94",
"Name": "tasmotatest",
"Temperature": 23.78,
"Endpoint": 1,
"LinkQuality": 100
}
}
}
MQTT message without Temperature:
{
"ZbReceived": {
"tasmotatest": {
"Device": "0x1F94",
"Name": "tasmotatest",
"BatteryPercentage": 59.5,
"Endpoint": 1,
"LinkQuality": 100
}
}
}
So when I get Temperature value to HA and later the device sends message just with the battery percentage (without Temperature) - the temperature value in HA is set to 0. How can I tell HA, that if the Temperature value is not present in the MQTT message, then the HA would not update the sensor?
Here is my HA configuration:
- platform: mqtt
name: "Tasmota Temperature"
state_topic: "aaa/tasmota1/SENSOR"
value_template: "{{ value_json.ZbReceived.tasmotatest.Temperature }}"
unit_of_measurement: "°C"
availability_topic: "aaa/tasmota1/LWT"
payload_available: "Online"
payload_not_available: "Offline"
device_class: temperature
Thank you for help/guidance.