Open mihsu81 opened 3 months ago
I think thats the regular behaviour for sensors that arent continuously active. This also happens for other devices if I unplug them. (the showerhead loses power if its not running)
I have seen other integrations have implemented ways to restore the state of the sensor after a restart. Like https://github.com/custom-components/ble_monitor
If you think it is too difficult to add in this integration, do you have any examples of your approach in your instance of HA to get around this limitation?
Thanks.
Also, the sensors of the native Xiaomi BLE integration keep their last state after a restart. Or the last measurement from hours ago, like in the case of a Xiaomi bathroom Scale. So I guess something must be missing from the integration that adds this functionality.
@chkuendig a solution for something similar was implemented in https://github.com/codyc1515/ha-yeelock/pull/17 for the ha-yeelock custom integration.
from homeassistant.helpers.restore_state import RestoreEntity
Hi @chkuendig,
The sensors become Unavailable after 15 minutes of not receiving data from the shower head. HA shows a notification that the integration amphiro_ble doesn't provide these entities anymore. Is this expected behaviour? Is there any way to have the sensors keep their values? Thanks in advance.