Setting up custom attributes to entities in HA or in Node-Red

Hello,

here i can set up any attribute i want like this:

But how can i set them in HA in automation or configuration yaml or at least in node red?

Thanks!

Yes, and no. The custom attribute you set there won’t survive a restart.

For example, here I use it to create a new attribute named my_attribute.

After a restart, my_attribute no longer exists.

I don’t know of any service call that can dynamically assign a new, permanent attribute to an entity.

If you have entities based on either the Template or MQTT integrations, they allow for the creation of custom attributes. However, these attributes are part of the entity’s configuration. In other words, they don’t have a dedicated service call for dynamically creating custom attributes.

1 Like

Thanks.
It is not the worst problem, i can set them after restart again.
The main problem that custom attributes erases after every state update (for exmaple pusing the button)

Hi there, i’m looking for similar option and wondering if it’s available yet.
I can add custom attributes via restAPI state/ call but they disappear again on HA state update.

what i’m looking for is to be able to add permanent attributes to a entity via restAPI, do we know if that’s possible in the latest versions of HA ? Aware i can add via customize.yaml but would like to do it via a restAPI call

No. Nothing has changed.