Closed tunip closed 5 years ago
Hello,
Did you identified the mqtt message that is setting the value to undefined ?
Gateway publish:
OMG/BTtoMQTT/4C65A8.....8
{"hum":"63.5"}
...temperature is gone
next scan...
OMG/BTtoMQTT/4C65A8.....8
{"hum":"63.5","tem":"23.2"}
...temperature is back
Why home assistant undefines temperature when only humidity is published from the gateway is a good question. Maybe they expect always all values from the json output. If both values are published everything is fine.
Maybe I need to publish every value in a seperate topic (#define jsonPublishing false).
We need to search on Hass doc to see if there is a way to don't reset the values when the key is not present, or maybe ask the commmunity in hass forum
You are right. I will ask this in the HA community. Many thx
Describe the bug I use 3 ESP32 gateways with BT only enabled for my 3 Xiaomi Flower & 7 MiJia devices. MQTT values are cleared from time to time for the MiJia's (Flower sensors are not affected).
Custom OMG settings for each gateway: As I need a unique state_topic in Home Assistant, I removed the Gateway_Name from the topic in config_BT.h. The Gateway_Name is still unique on each ESP32 in User_config.h.
To Reproduce Steps to reproduce the behavior:
Expected behavior In my example, the temperature should not be "cleared" from one of the three gateways.
Screenshots
![val_del](https://user-images.githubusercontent.com/11404472/52720914-d40ace80-2fa8-11e9-9f59-dd168d0e64ea.jpg)
Environment:
OpenMQTTGateway version used: V0.9
Home Assistant sensors:
platform: mqtt name: "ble sensor 1 temperatur" state_topic: "OMG/BTtoMQTT/4C65A8D065D6" availability_topic: "OMG/GW1/LWT" value_template: "{{ value_json.tem }}" unit_of_measurement: '°C' device_class: temperature
platform: mqtt name: "ble sensor 1 luftfeuchtigkeit" state_topic: "OMG/BTtoMQTT/4C65A8D065D6" availability_topic: "OMG/GW1/LWT" value_template: "{{ value_json.hum | round(0) }}" unit_of_measurement: '%' device_class: humidity