Mechanism for persisting arbitrary entities from REST API

I use home assistant to track bills by parsing emails from the billing companies and then using the REST API to send the bill data into HA.

Sadly, I have to run this every few minutes, because if HA restarts, the entities I create this way are gone from the system. It’d be nice if they didn’t go away, by setting some flag on the inbound payload perhaps?

Create a input_text entity and use that in your API calls, that will survive restarts.

But that doesn’t have custom extended attributes. I tried :frowning:

Have you looked into ?

As for attributes, that concept will slowly fade away overtime. In general attributes should have been separate entities that belong to a single device.

As for the counter case: State attributes are a pain, because if you want to automate against it, you’d need to use template or need to extract them first using a template sensor. Which would have been unneeded if it were separate entities to begin with.

1 Like

This is awesome!!!

Of course, that would increase the number of entities up by an order of magnitude, so better ways to present/find/filter them would be handy at the same time. Before your comment, I was actually tempted to open a Why the heck on this. It’s completely insane how much time users waste trying to figure out the correct template format to extract attributes. It’s not something a newbie-ish user is going to be able to figure out, yet attributes contain info they want/need (battery levels, as but one example).

Is the length limit of states going to be addressed then? Currently there are several integrations that have to use attributes to store information because the data can’t fit in an entity state.

Storing custom attributes is also the only way that I know of to store dynamic arrays within a HA entity, since it cannot be done with any available input.

There is not a solution for everything yet. However, when possible, we avoid introducing new attributes for quite some time already.