monitor_docker icon indicating copy to clipboard operation
monitor_docker copied to clipboard

Request: unique_id registry for entities, to allow giving sensors an Area and UI customization

Open jtaseff opened this issue 4 years ago • 5 comments

Right now all of the automatically created sensors and switches just reside under the area "Switch" and "Sensor" in lovelace and the entity list. Would love to be able to group them into their own area, either using the UI or a config flag.

Been messing with it a bit to give a unique_id, and can get it to show up with "integration" of "monitor_docker" sometimes, but always errors when its tries to add to the entity registry.

This entity ("switch.docker_homeassistant") does not have a unique ID, therefore its settings cannot be managed from the UI.

jtaseff avatar Apr 28 '21 04:04 jtaseff

Hi @jtaseff, I wanted the same thing so I did a bit of digging. You can change instances of entity_id to unique_id in the sensor.py and switch.py scripts, these are located in the custom_components/monitor_docker folder. Then when you restart Home Assistant you should be able to add them to areas.

heinz-matt avatar Nov 20 '22 21:11 heinz-matt

Hi @ualex73,

I'm also interested on this request because I have my own naming convention for the id.

I've seen suggestion from @heinz-matt but the problem is that I would need to make the change any time there is a new release.

As it looks the change is not complex at all, maybe @jtaseff and I will be lucky for the next release as a Christmas present.

Thanks for this great integration.

mcarlosro avatar Dec 31 '22 07:12 mcarlosro

The problem is that we do not have a real unique identifier to generate "unique_id" from, normally things like a MAC/serialnumber is used for this (I use the MAC in one of my other integrations).

Using the docker name itself for "unique_id" is more a hack, not a real proper solution. In the new year I will investigate if I can add a switch for it (so leave the current behavior, and make "unique_id" possible if you want to use it).

Anyway, PRs are always welcome.

ualex73 avatar Dec 31 '22 07:12 ualex73

+1

Hadatko avatar Sep 30 '23 08:09 Hadatko

Hi @jtaseff, I wanted the same thing so I did a bit of digging. You can change instances of entity_id to unique_id in the sensor.py and switch.py scripts, these are located in the custom_components/monitor_docker folder. Then when you restart Home Assistant you should be able to add them to areas.

Hello @heinz-matt , do you have an example on what to change in the py scripts? Simply changing all entity_id to unique_id did not do the trick for me.

Thank in advance

QuaiGoner avatar Jan 02 '24 06:01 QuaiGoner

any update on this? even now with labes and categories a unique_id would be great.

deluxestyle avatar Apr 10 '24 12:04 deluxestyle