thomluther / ha-anker-solix

Home Assistant integration for Anker Solix Power devices
MIT License
294 stars 4 forks source link

Restructure organization of Hub related entities #141

Closed thomluther closed 5 days ago

thomluther commented 1 month ago

Checklist

Is your feature request related to a problem? Please describe.

The Anker cloud Api reports some data related to the account, which is the hub in the HA integration. Currently those common hub entities are reflected in a system when one was created in the account. If the user has multiple systems defined, those entites duplicate which does not make sense.

Describe the solution you'd like

A new device reflecting the account/hub should be implemented to contain all common entities that are not tied to a specific system. This account device should also refer to all devices that are managed under this account, so instead of 2 levels there will be 3 levels or device relations for each Hub configuration that is being created with the integration.

Describe alternatives you've considered

Leave it is as, but that is not logical, creates duplicate entities for the same information.

Additional context

The new account device should initially contain the switch for the Api usage (this affects all account communication) and the unread message sensor (this is independent of the system. Additional entitites may be added in future. The Action to export Api data should also be changed to the new single Api usage switch per account, so only one selectable entity appears per Hub configuration when using the Export System service (which is actual exporting everything for the account). This is a breaking change for dashboard, services and automations using any of those entities being moved to the new account device. This may also have dependencies on the Api Library. E.g. there should be a separate cache object reflecting such account fields instead of adding them to the site cache objects.