zachowj / hass-node-red

Companion Component for node-red-contrib-home-assistant-websocket to help integrate Node-RED with Home Assistant Core
MIT License
442 stars 181 forks source link

How the heck do I get NR:HA devices and related NR:HA sensors friendly_name and entity_id's the way I want in HA?? #248

Closed danielbrunt57 closed 2 months ago

danielbrunt57 commented 5 months ago

Version of the custom_component

2.2.0-beta3

Configuration

yaml? from where?

Describe the bug

NR sensor creation has Name & Friendly Name. I presume that should end up being entity_id and friendly_name in HA but HA seems to have other ideas. I'm trying to create a device named Moon with related binary & non-binary sensors named sensor.moon_xxx_yyy but with a friendly name minus the device name but HA seems to want to prepend the Device name to the name except when HA detects the friendly name already starts with the device name in which case it does not. I've been messing with this most of the day and short of deleting the device & 17 sensors and starting over (which may culminate in the same futility), I'm at my wits end. If I edit the entity_id in HA, it disappears from the device and becomes or orphaned entity. If I edit the NR sensor's Name &/or Friendly name in NR, sometimes it changes but sometimes not, in HA.

Debug log

(not sure what to provide here)

image

image

image

image

image

danielbrunt57 commented 5 months ago

I would expect to be able to edit the HA entity_id to whatever I want and still have it linked to the same device like is possible with other integrations!

danielbrunt57 commented 5 months ago

I did another test now and renamed the first entiy_id from sensor.above_horizon to sensor.moon_above_horizon which caused it to disappear from the HA device. I then restarted HA and it now appears under the device with the correct entity_id. I then renamed the 16 other entities which caused them to orphan and then just reloaded the companion app integration but nothing changed. I restarted HA and the renamed entities are now associated. I would expect an integration reload to do the same steps it does when HA is starting up but in this case, it does not.

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.