Give sensors a fixed name

ok, so i have 2 x synologys running on my network, so created 2 x platforms
see code below

but if i restart my HA, the sensors sometimes switch names

so i have a sensor coming from synylogydsm like :
sensor.used_space_volume_1
and
sensor.used_space_volume_1_2

but they switch
so sometimes volume_1 is synology1 and volume_1_2 is synology 2
if i then restart its possible that:
volume_1 is synology2 and volume_1_2 is synology 1
also if i go to the states page, i cant rename those sensors

so it seems the discovery of the synology’s at boot is random discovered
config : https://www.home-assistant.io/components/sensor.synologydsm/

thnx!

  - platform: synologydsm
    host: 192.168.0.14
    username: !secret synology_user
    password: !secret synology_pass
    scan_interval: 3600
    monitored_conditions:
      - disk_smart_status
      - volume_size_used
      - volume_size_total
      - volume_percentage_used
      
  - platform: synologydsm
    host: 192.168.0.7
    username: !secret synology_user
    password: !secret synology_pass
    scan_interval: 3600
    monitored_conditions:
      - disk_smart_status
      - volume_size_used
      - volume_size_total
      - volume_percentage_used

Try Configuration -> Entities Registry?

Thnx , but those sensors are not listed there :frowning:

OK, I thought it was worth a try. Perhaps somewhere in the .storage directory?

Also looked,not in there also :frowning:

If the order that platforms load doesn’t follow the order they’re listed in the configuration, then the only way to fix this would be to give them unique IDs so they can be changed in the entity registry or add a name: option to the configuration to set your own name.

You can copy the code to a custom component and do that yourself if you know Python. Otherwise, I’d suggest opening an issue on GitHub for it. It might get closed as a “feature request”, but I could see it being accepted as a bug as well.

Yeah, tried name, ok, gonna make a bug report , rhnxy

Hi everyone,

I have 2 Synology and I can’t rename my sensor.
Any update on this topic?

Thanks

I think you need to do it like this possibly? See the docs here

So add a
name: YOUR_NAME
for each device

  - platform: synologydsm
    name: DSM1
    host: 192.168.0.14
    username: !secret synology_user
    password: !secret synology_pass
    scan_interval: 3600
    monitored_conditions:
      - disk_smart_status
      - volume_size_used
      - volume_size_total
      - volume_percentage_used
      
  - platform: synologydsm
    name: DSM2
    host: 192.168.0.7
    username: !secret synology_user
    password: !secret synology_pass
    scan_interval: 3600
    monitored_conditions:
      - disk_smart_status
      - volume_size_used
      - volume_size_total
      - volume_percentage_used