Can you give an entity created by "set_state" in AppDaemon an "unique_id"?

Depending on the answer, this might not be strictly an “AppDaemon only” question, but can you create an entity (in AppDaemon, in my case) and assign it an unique_id?

I create a bunch of entities in AppDaemon, but none of them have a “unique _id”. For most, it’s no big deal, but for a few I would like to e.g. change icon or set “area” from UI. And just in general, I kind of like the idea of an unique_id.

So, can this be done? The closest I got the this was this post about doing the same from REST API - , and this post about doing it with MQTT, but there are no replies to either.

bump
Interested too

With set_state() you should really only be creating sensor or binary_sensor but yes, you can do it with HA’s MQTT discovery. AD can be a device that is controlled via MQTT, you’re just telling HA what topics, commands, etc to issue to the broker. MQTT - Home Assistant

1 Like

Can you point me at an example? TY

Have a look at MQTT - Home Assistant - this section explains exactly what you need to send to MQTT in order to register a device (that will have an ID)