You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have updated to the latest available Home Assistant version.
I have cleared the cache of my browser.
I have tried a different browser to see if it is related to my browser.
I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.
Describe the issue you are experiencing
When entities are grouped into a device, their names do not update in real-time in the Overview dashboard of the Lovelace UI, while their values do update correctly. The same entities update their names instantly when not grouped into a device, or when included in a custom dashboard (i.e. not the Overview).
This appears to be a Lovelace frontend issue since:
Entity values update correctly in real-time regardless of device grouping
Entity names update correctly in the More Info dialog
Entity names update instantly when not grouped in a device
Entity names only update in the UI for device-grouped entities after a page refresh/navigation
The issue happens only in the Overview dashboard where entities are added automatically
Describe the behavior you expected
The grouped entities should update their name instantly like the non-grouped entity does, or like they do when not in the Overview dashboard.
Steps to reproduce the issue
Create a custom integration with this minimal example below
Add the integration to the UI, so that three entities are added to the Overview dashboard: one standalone and two grouped in a device
Wait for the coordinator to update the data (every 10 seconds) without switching page
Observe the behavior in Lovelace UI using standard Entity cards: EntityOne gets its name refreshed automatically, while EntityTwo and EntityThree do not (as they're included in a device called Prefix)
"""Sensors implementation."""fromhomeassistant.components.sensorimportENTITY_ID_FORMAT, SensorEntityfromhomeassistant.config_entriesimportConfigEntryfromhomeassistant.coreimportHomeAssistantfromhomeassistant.helpers.device_registryimportDeviceInfofromhomeassistant.helpers.entity_platformimportAddEntitiesCallbackfromhomeassistant.helpers.typingimportDiscoveryInfoTypefromhomeassistant.helpers.update_coordinatorimportCoordinatorEntityfrom . importDOMAIN, TestCoordinatorasyncdefasync_setup_entry(
hass: HomeAssistant,
config: ConfigEntry,
async_add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType|None=None,
) ->None:
"""Initializes and creates the sensors."""# Get the coordinatorcoordinator=hass.data[DOMAIN][config.entry_id]
# Create the entititesentities: list[SensorEntity] = []
entities.append(EntityOne(coordinator))
entities.append(EntityTwo(coordinator))
entities.append(EntityThree(coordinator))
async_add_entities(entities, update_before_add=False)
classEntityOne(CoordinatorEntity, SensorEntity):
"""Sensor with name and value changing, NOT in a device."""def__init__(self, coordinator: TestCoordinator) ->None:
super().__init__(coordinator)
self.coordinator: TestCoordinator=coordinatorself.entity_id=ENTITY_ID_FORMAT.format("entity_one")
self._attr_unique_id=self.entity_idself._attr_has_entity_name=Trueself._attr_name="Entity One"self._attr_available=Falseself._attr_native_value: int=0self._attr_should_poll=Falsedef_handle_coordinator_update(self) ->None:
"""Receives data from coordinator."""ifself.coordinator.value_counter>0:
self._attr_native_value=self.coordinator.value_counterself._attr_name=f"Entity One ({self.coordinator.name_counter})"self._attr_available=Trueelse:
self._attr_name="Entity One"self._attr_available=False# Update Home Assistant statusself.async_write_ha_state()
classEntityTwo(CoordinatorEntity, SensorEntity):
"""Sensor with name and value changing inside a device."""def__init__(self, coordinator: TestCoordinator) ->None:
super().__init__(coordinator)
self.coordinator: TestCoordinator=coordinatorself.entity_id=ENTITY_ID_FORMAT.format("entity_two")
self._attr_unique_id=self.entity_idself._attr_has_entity_name=Trueself._attr_name="Entity Two in a device"self._attr_available=Falseself._attr_native_value: int=0self._attr_should_poll=False# This belongs to a deviceself._attr_device_info: DeviceInfo= {
"identifiers": {(DOMAIN, "")},
"manufacturer": "Me, a developer",
"name": "Prefix",
}
def_handle_coordinator_update(self) ->None:
"""Receives data from coordinator."""ifself.coordinator.value_counter>0:
self._attr_native_value=self.coordinator.value_counterself._attr_name= (
f"Entity Two in a device ({self.coordinator.name_counter})"
)
self._attr_available=Trueelse:
self._attr_name="Entity Two in a device"self._attr_available=False# Update Home Assistant statusself.async_write_ha_state()
classEntityThree(CoordinatorEntity, SensorEntity):
"""Another Sensor with name and value changing inside a device."""def__init__(self, coordinator: TestCoordinator) ->None:
super().__init__(coordinator)
self.coordinator: TestCoordinator=coordinatorself.entity_id=ENTITY_ID_FORMAT.format("entity_three")
self._attr_unique_id=self.entity_idself._attr_has_entity_name=Trueself._attr_name="Entity Three in a device"self._attr_available=Falseself._attr_native_value: int=0self._attr_should_poll=False# This belongs to a deviceself._attr_device_info: DeviceInfo= {
"identifiers": {(DOMAIN, "")},
"manufacturer": "Me, a developer",
"name": "Prefix",
}
def_handle_coordinator_update(self) ->None:
"""Receives data from coordinator."""ifself.coordinator.value_counter>0:
self._attr_native_value=self.coordinator.value_counterself._attr_name= (
f"Entity Three in a device ({self.coordinator.name_counter})"
)
self._attr_available=Trueelse:
self._attr_name="Entity Three in a device"self._attr_available=False# Update Home Assistant status (different method)self.async_schedule_update_ha_state()
What version of Home Assistant Core has the issue?
core-2024.11.1
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
Microsoft Edge 131.0.2903.112
Which operating system are you using to run this browser?
Windows 10 22H2 19045.5247
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
No response
Additional information
Adding the three entities to a custom dashboard does not result in any issue. The name is refreshed instantly, like the value does.
The text was updated successfully, but these errors were encountered:
Checklist
Describe the issue you are experiencing
When entities are grouped into a device, their names do not update in real-time in the Overview dashboard of the Lovelace UI, while their values do update correctly. The same entities update their names instantly when not grouped into a device, or when included in a custom dashboard (i.e. not the Overview).
This appears to be a Lovelace frontend issue since:
Describe the behavior you expected
The grouped entities should update their name instantly like the non-grouped entity does, or like they do when not in the Overview dashboard.
Steps to reproduce the issue
EntityOne
gets its name refreshed automatically, whileEntityTwo
andEntityThree
do not (as they're included in a device calledPrefix
)Test Integration Code
File:
manifest.json
File:
__init__.py
File:
config_flow.py
File:
sensor.py
What version of Home Assistant Core has the issue?
core-2024.11.1
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
Microsoft Edge 131.0.2903.112
Which operating system are you using to run this browser?
Windows 10 22H2 19045.5247
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
No response
Additional information
Adding the three entities to a custom dashboard does not result in any issue. The name is refreshed instantly, like the value does.
The text was updated successfully, but these errors were encountered: