Zigbee2MQTT and Grafana problem

I’ve just installed 3 double 13A sockets in the UK that have Zigbee allowing the sockets to be turned on and off and the power on each to be monitored. When I connected them to Zigbee2MQTT I gave them a Friendly name and updated the HA Entity ID. The original ID was something like ‘0x00168d00031779a8’, the friendly name was ‘Lounge Socket’. So now when I look at the Entities I can see ‘sensor.lounge_socket_power_left’ (and right) with units of ‘W’, and also ‘switch.lounge_socket_left’.
So now my problem…
When I come to use Grafana and enter ‘W’ as the unit of measurement, when I come to pick the ‘Entity ID’ the drop down list only contains the original ‘0x00168d00031779a8’ type IDs along with some other sensors I’ve previously set up which work fine. So when I pick any of the 6 x ‘0x00168d00031779a8’ format IDs I get ‘No Data’!
The Grafana drop down list does not contain the given friendly name format which I see everywhere else in Home Assistant.
I’ve restarted HA several times too.
I’ve tried entering the ‘friendly’ ID by switching to the SQL editor.
I should add that I have loads of other Z2M sensors that I have previously configured with a friendly name and not had this problem before.
I’m running HA on a generic x86-64 NUC and am at version 2023.9.1.

I’m not sure there is a good way to use ‘friendly names’ via SQL easily. I have struggled with sensor/devices naming via MQTT (and specifically Zigbee2MQTT) for some time. As a result, I turned off all of the ‘auto discovery’ and ‘friendly name’ automatic stuff for MQTT devices and just use their MAC address as a unique device name. This is at times a PIA, but it is only way I have found to be solidly in control of devices id’s. I can go back and add a ‘friendly name’ for viewing in Lovelace, and this attribute often comes along with the other meta data of the device, but when I reference the device, it is only via mac address mapped to the ‘unique ID’ of the device, this sometimes with me ending up with long and painful device names like. As I said, not an ideal path, perhaps you can find a better naming method :


I think there is some new work that is hitting production with the 2023.9.x and latest Zigbee2MQTT that might allow you to create a more ‘human’ and yet technically useful name at the source in Zigbee2MQTT, I have yet to explore this, so I could be wrong.

Also, be careful, you can end up with phantom devices when you change names and restart Home Assistant. These can really cause you to go down a dead end path and cause frustration and wasted time.

Good hunting!

I literally think I just found out I was being stupid! I hadn’t tried scrolling down the list of pickable devices. There’s no scrollbar until you hover over it. The 0x00… devices all appear at the top - I guess they are the ‘phantom’.