Autodiscovery should work now.
Thanks for the info, nevertheless the battery discharge rate is not linear, especialy when you are close to the end of the battery.
As complementary data, here is the discharge rate when battery is above 90%
3-4% in one month with interval every 55s
Of course youāre right, like I said earlier battery voltage isnt very precise at these levels
Can you change the display to show Fahrenheit?
@1technophile hi, can you point me at a commit or a part of the source code where support for these lives (in omg)?
Iād really like to see it in esphome, perhaps I could port it over
EDIT: Actually, it seems like itās already there in the beta version of esphome. Which is simply installable on hassos from the same repo as regular version.
Thereās also been some refactoring of xiomi sensors, and there appears to be no battery monitoring for the clock/temperature/hydrometer:
Docs:
very interestingā¦
Great work guys! Iām really hoping to have it working with my esphome-based ESP32 BLE tracker! Iād also like to have it supported by HA. Do you know if anybody is working on it? Iāve got some round XIaomi temp sensors read by HA, but also 1 by esphome tracker (depending on the floor).
@1technophile - this is a pretty good discharge rate Iād say. How does your integration work? Does it force the clock to send an update or it listens to some broadcast messages from it?? (e.g. like esphome does with the round MiJia thermometer/hygromether)
Iām asking as I used this HA custom component from h4 (GitHub - h4/LYWSD02-home-assistant: Home-Assistant sensor for LYWSD02 Thermometer), but it drains the battery really heavily. 10% less in only 3 hours. I think it explicitly connects to the clock and reads the data every 30 seconds. But the Xiaomi Home app is even worse - it drained 8% in less than an hour!
Thus Iām asking how you read the data as if you do listen to broadcasts then perhaps maybe thereās a way to change the HA component to behave he same way instead of polling the data from the clock.
I really want to integrate this directly with HA as my esphome BLE tracker is located in totally another place and I donāt want to deploy another one just for this one clock to read.
OpenMQTTGateway listen every 55s for broadcasted data, there is no connection done to the BLE devices.
Behind that we use the servicedata broadcasted by the devices instead of making a BLE connection. Not all parameters can be retrieved like that (for instance mi flora doesnāt broadcast its battery value by servicedata) but the most interesting ones are there.
To add a little bit of history this functionnality is made possible by the great work of @nkolban & @chegewara on ESP32. You can check to see how the service data are extracted.
How many meters do you have between your ESP and the clock for my info?
It listen to broadcasts - perfect! That;s trhe best solution I think. Itās the same approach as the ESPhome guys took for MiFlora and Xiaomi LCD thermometer & hygrometer. For the battery life itās the best approach one can take.
Anyway - it turned out that ESPhome giys implemented support for this device as well in their newest version 1.14. I updated my tracker with their newest software and what really surprised me was that there are 2 think walls and a distance of ca 10 meters between my ESP32 tracker and this clock and the tracker receives all the parameters by BLE. Really beautiful. I donāt have to deploy another ESP32 to track the clock/themperature. Great news I wish the HA team could build integration with this clock in the same way - I mean without making a connection to it.