dawidchyrzynski / arduino-home-assistant

ArduinoHA allows to integrate an Arduino/ESP based device with Home Assistant using MQTT.
https://dawidchyrzynski.github.io/arduino-home-assistant/
GNU Affero General Public License v3.0
508 stars 119 forks source link

Unique entity names per device #90

Closed daniloc closed 2 years ago

daniloc commented 2 years ago

Hello again.

I'm working on a project where multiple devices will be deployed with identical configurations.

Right now, there's a good strategy shared in the examples for making the top-level device itself unique, based on the MAC address. How would you recommend uniquing the individual components? Currently the entities generated in Home Assistant don't have ID's that map to the parent device: sensor.entity_name.

Ideally, they'd appear as sensor.aa00aa00aa00.entity_name or similar. Appreciate any guidance here, as the dynamic construction of all these identifiers seems like it could get gnarly. Thanks again!

daniloc commented 2 years ago

Ah, disregard: digging into the MQTT logging I see this behavior is already implemented and HA figures out the entity ID's independently. Great stuff!