corbanmailloux / esp-mqtt-rgb-led

MQTT RGB LEDs Using JSON for Home Assistant
MIT License
270 stars 74 forks source link

How to set unique id for home assistant #63

Closed sidequestboy closed 2 years ago

sidequestboy commented 2 years ago

Thanks for this code - I got it working on a wemos d1 mini and RGB LED strip without much trouble!

In home assistant I have the light set up in my configuration.yaml following your instructions, and I have mosquitto addon as my mqtt broker and the mqtt integration as well, and my device shows up but I can't assign it to an area because home assistant says: "This entity ("light.bedroom_rgb_led_strip") does not have a unique ID, therefore its settings cannot be managed from the UI. See the documentation for more detail."

Is there a way to make sure such an ID is assigned? I had defined the mqtt client id in the firmware:

#define CONFIG_MQTT_CLIENT_ID "BEDROOM_RGB_LED_STRIP" // Must be unique on the MQTT network

but it doesn't seem to use this to create a unique id for the entity.

corbanmailloux commented 2 years ago

You should be able to set the unique ID in your Home Assistant configuration.yaml file by setting it manually for the light: https://www.home-assistant.io/integrations/light.mqtt#unique_id