#hey anyone I m developing my first

1 messages · Page 1 of 1 (latest)

arctic yew
#

in first version of component I didn't use coordinator and my entity states were updated each ~30 sec. what to know what is the correct way to update entities in my case.

rustic cove
#

The passive Bluetooth coordinator is great, but it’s for when your data is in Bluetooth advertisements, so I think you made the right call there. It doesn’t need to maintain a persistent connection to the device, so it’s great for battery life and you don’t have to worry about connection failures. Where as start_notify you’ll have to deal with maintaining a connection to the device yourself. I don’t know if there is a good example of this kind of device, non of the ones I have worked with have done that.

#

homekit_controller does use start_notify but the target device usually drops the connection within 30s of no polling or writing, and switches back to doing the notification’s through advertisement data because it’s more reliable, faster, cheaper on power, etc

arctic yew
#

I've installed Bluetooth LE Scanner on my phone and it seems that my device sends its status updates by UUID only after connection. btw it's powered by mains, so battery life doesn't matter.

#

so do I understand correctly, that my choice should be regular DataUpdateCoordinator in this case?

#

so inside callback for BleakClient::start_notify(UUID, callback) I should call coordinator.async_set_updated_data(data) to update entity states?

rustic cove
#

That could work, but you also need something to restart the connection (and call start_notify) after the connection is lost.

#

And you need to listen to any advertisements to figure out which route to use (in case there are esp Bluetooth proxies)

#

Led-ble is probably best integration to look at for ideas