cereal2nd / velbus-aio

Velbus Asyncio
Apache License 2.0
15 stars 12 forks source link

Mark status LED's as secondary entities #27

Closed wlcrs closed 2 years ago

wlcrs commented 2 years ago

My HA now contains a plethora of pretty useless LED-entities.

Since HA 2021.11 it is possible to mark such entities as 'Diagnostic': https://developers.home-assistant.io/blog/2021/10/26/config-entity .

In order to update the Velbus-integration to do this, we need to be able to differentiate between these type of LED's and real light-entities. Can we add an attribute (to Channel? ) to them to mark them as such?

To elaborate: I think we should even consider add entity_registry_enabled_default=False to the Button-entities from Velbus. This prevents them from appearing automatically in the HA entities list, while the user can still enable them manually if desired. The VMBELO and VMBGPOD in my installation have now created over 50 entities each, most of which don't have any value at all.

A small illustration:

image image image image

cereal2nd commented 2 years ago

the button-lights are disabled by default (this is code in hass):

class VelbusButtonLight(VelbusEntity, LightEntity):
    """Representation of a Velbus light."""

    _channel: VelbusButton
    _attr_entity_registry_enabled_default = False
wlcrs commented 2 years ago

Ok, thank you for clarifying that. When looking at git blame I see that this was not yet the case when I added the integration to my HA, and this is not retroactive of course. I will manually clean out my HA-instance.

Some follow-up requests/thoughts:

cereal2nd commented 2 years ago

the diagnostic idea is a good idea, and everyone should be able to ahndle this, its a verry small code change in hass. same for the button entity, its a good idea but this is relative new in hass, so did not have time to look at it.

about the alarms and velbus-button, currently i do not know (in hass) that these are special channels, so i have no way to handle them seperatly inside hass.

cereal2nd commented 2 years ago

in velbusaio we know these are special channels, so in theory it should be possible but this requires some work: these steps below are the same for the 2 requests

1- create a new type of category (button and thermostatchannel or something similar) 2- make sure the get_categories in channels.py returns the correct type 3- in the hass component, handle these 2 types differently and make sure they end up in the correct entity for this type of category 4- build the hass entity

wlcrs commented 2 years ago

Hi @Cereal2nd , thanks for being so responsive!

about the alarms and velbus-button, currently i do not know (in hass) that these are special channels, so i have no way to handle them seperatly inside hass.

We can also think in reverse: which binary_sensors should be enabled by default? I think that enabling motion-detector channels by default makes sense (and even then: only the first channel per motion sensor), but all other channels could be disabled by default.

What you're proposing sounds fine. I also think that this library should contain the detection logic to categorize them into different categories, which the HA-integration can then use to configure the entities correctly.

cereal2nd commented 2 years ago

yeah maybe this is something to think about These are all nice ideas, but currently i do not have enough free time to implement this