Repository navigation
Conversation
Bluetooth only exposes the current state, not consumption history. If
enabled in the options flow, a second coordinator reads lifetime totals
and the error list from the BLANCO Smart Home API every 15 minutes via
blanco-smart-home-api-client, and adds sensors for water dispensed (in
total and per water type), error counts and the last error.
The cloud dev_id is derived from serial number and service code, which
the BLE coordinator already reads, so enabling needs no input. One app
id is registered and kept in the options. The token is only held in
memory, because writing it to the entry would reload the entry through
its update listener.
Three config entry mocks in test_init gain options = {}.
|
I already thought about bringing this into core but it will probably cose some time cleaning up the code to home assistant standards. I think i wouldn't include cloud for now when there is a separate integration that handles all the cloud part. |
|
@Nailik coming back to your point about a separate integration for the cloud part: core#168250 has been stuck in review since April. Changes are still requested, and the reviewer had to ask several times to stop replying with LLM output (home-assistant/core#168250 (review)). It is now cut down to two error count sensors, the water statistics are deferred to later PRs. So that data won't reach Home Assistant through it soon. Would you take the cloud part here as an opt-in after all, or should I move it into its own integration? |
|
I'll have a look at it and test how it feels in the integration. |
Bluetooth gives the current state but no consumption history. This adds an option, off by default, that reads lifetime totals and the error list from the BLANCO Smart Home API every 15 minutes and exposes them as sensors: water dispensed in total and per water type (device class water, so it works in the Energy dashboard), critical errors, warnings and the last error code. Tested on a CHOICE.All, the totals match the statistics in the UNIT app.
It uses blanco-smart-home-api-client from PyPI. The API runs on BLANCO's own backend, and the library comes from the author of home-assistant/core#168250, an open PR for a cloud-only BLANCO integration with two error sensors. The serial number and service code this integration already reads over BLE are enough to derive the cloud device id, so enabling the option only needs access granted once in the UNIT app.
How would you like to continue with this integration? With a cloud integration on its way into core, it could make sense to bring this one to core as well, as the local Bluetooth counterpart. Happy to help if you want to go that way.