Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.71k stars 1.64k forks source link

Friendly name and MQTT discovery #3374

Closed silvanverschuur closed 4 years ago

silvanverschuur commented 4 years ago

I'm not sure if this is a bug. I've added a friendly_name for all my devices so that Home Assistant is using this friendly name instead of the unique_id.

Until now every device that I own (Xiaomi smoke/temperature/buttons, Ikea power outlets/signal repeater, etc) is using this friendly name for MQTT discovery.

Recently I've added some Ikea bulbs and they get a different name in the MQTT discovery. They get a _light postfix.

Example:

'0xccccccfffe709b7e':
  friendly_name: ikea_filament_bedroom

This becomes light.ikea_filament_bedroom_light in Home Assistant while other devices keep their original name (as specified in the Zigbee2Mqtt configuration file).

Is there any reason why a light gets the _light postfix and other devices keep their original friendly name?

Debug Info

Zigbee2mqtt version: 1.12.0 Adapter hardware: CC2530 / CC26X2R1

Koenkk commented 4 years ago

This is expected, the reason for this is e.g. a sensor device. Lets say this sensor (my_sensor) exposes both temperature and occupancy, without the postfix we would end up in duplicate entity. But when we add the type not: sensor.my_sensor_temperature, sensor.my_sensor_occupancy. For consistency purposes this has been done everywhere.

silvanverschuur commented 4 years ago

Thanks for your explanation. Now I understand the reason behind it. Keep up doing the good work, I love z2m!