-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unavailable battery when (deep-)sleeping #10
Comments
Do you get information from the temp and humidity sensors? My device has stopped sending these while charging the battery and while I see new values transmitted in MQTT Explorer they don't register in Home Assistant. |
@EarMaster , temp & hum do update, but not on a fixed schedule. Perhaps they update only if the delta is big enough. |
Just to clarify: the device is always in deep-sleep. There is no other mode. It wakes up on a button press and every 10 minutes to post temperature, humidity and battery percentage. Then it goes back to deep-sleep. Last will and Birth messages are not used. Home Assistant will display the sensor entities as unavailable only based on time since last received MQTT message. This option is set in MQTT discovery sensor setup: @Zixim Are the button presses reliable for you? Does the battery percentage become available right after you press a button? Please check that you really receive messages every 10 minutes in MQTT Explorer or a similar app. Maybe your Wi-Fi is not reliable enough. Which Home Assistant version are you using? You can see two times in Home Assistant: Last changed and Last updated. But they only change if the value changes by a delta (see here). Which for battery, it doesn't very often. But for expiry, the actual time of the last received MQTT message is taken into account. So the Last changed can be longer than 10 minutes and the entity should still be available. Given that MQTT messages are received of course. @EarMaster Do the values you see in MQTT Explorer differ from the ones in Home Assistant? Charging should't have any effect on how the device works and when it posts sensor messages. |
@EarMaster Thanks. That's strange. I'll try reproduce it. What version of Home Assistant is this? Could you also please share what it says if you press MQTT INFO and then open payload for temperature. Should be something like this:
|
I think I found the issue. I think I tried to change the Device Name during initial setup, but it always gets reset, when you enter setup mode again. So the sensors are listening for my new device name (Mother) instead of the actual device name (Mother 9FF628) which I at some point kept because it didn't seem worth it to change it every time. I reloaded the MQTT integration and the sensor values now show up. |
|
@EarMaster Exactly, that was the issue. The topic was different. When entering Setup the random ID is appended to device name each time. Thats a bug. But when exiting the setup, MQTT discovery setup message is sent every time. So the topic in Home Assistant should update. I don't know why it hasn't in your case. If reloading the MQTT integration helped, maybe it was a problem there. @Zixim Your issue is not related to this one. I opened a new issue and referenced your post. |
This is a known symptom :
The battery % is unavailable while deep-sleeping for the Home Button, yet the % is normal for my other DIY esp32 battery powered projects.
The solution is to set the birth and last will messages to empty.
References : Esphome docs on MQTT and Reddit thread about this.
The text was updated successfully, but these errors were encountered: