-
Notifications
You must be signed in to change notification settings - Fork 856
Description
Describe the bug
Although I set the esp32 to connect with every scan the temperature/humidity/battery data on mosquitto (version 1.5.7) is getting replaced by the data broadcasted by the LYWSD03MMC sensor on a scan:
Broadcast data:
{"id":"A4:C1:38:17:5F:77","name":"LYWSD03MMC","rssi":-40,"servicedata":"30585b055a775f1738c1a408"}
Relevant data:
{"model":"LYWSD03MMC","id":"A4:C1:38:17:5F:77","tempc":26.35,"tempf":79.43,"hum":56,"volt":2.919,"batt":81.9}
Therefore the relevant data is not available to openhab or mqttthing on homebridge most of the time and errors are thrown. Also "onlysensors" and "whitelist" seem not to work properly (set through mqtt commands).
To Reproduce
Steps to reproduce the behavior:
- Hardware ESP32-WROOM-32, 3x LYWSD03MMC (with 1.0.0._0130 fw)
- Download OpenmQTTGateway Sources and load esp32dev_ble into the the arduino libraries
- Correct known bug on line 523 (missing function void....)
- #define OpenHABDiscovery true
- Install OpenMQTTGateway 0.9.6 on ESP32 dev with activated ZGateway_BLE through ArduinoIDE.
- Configure MQTT and WIFI
- set: scan to connect ratio to 1
mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"scanbcnct":1}' - whitelist Sensors
mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"white-list":[your MAC adresses]}' - trigger scan and hopefully connect too with
mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"interval":0}' - also tried with
mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"onlysensors":true}'
Expected behavior
I would expect OpenMQTTGateway to only plublish the relevant data set after a successful connection and otherwise not push an mqtt message.
Environment (please complete the following information):
- Hardware ESP32-WROOM-32, 3x LYWSD03MMC (with 1.0.0._0130 fw)
- OpenMQTTGateway V0.9.6 with esp32dev_ble, most recent ArduinoIDE, MQTT-Broker Mosquitto V 1.5.7,
Possible workaround, earlier discussion:
A workaround solution would be a broadcasting firmware. Similar issues seem to have been discussed here: https://community.openmqttgateway.com/t/xiaomi-mijia-lywsd03mmc-esp32-support/775/49
