Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only state is restored, not "set" attributes #116

Open
NateEaton opened this issue May 26, 2024 · 4 comments
Open

Only state is restored, not "set" attributes #116

NateEaton opened this issue May 26, 2024 · 4 comments

Comments

@NateEaton
Copy link

My use case involves having a list of attributes that are set in an automation with each being the name of a battery sensor and the date it was changed. The automation also sets the value of the variable to the latest sensor/date set as an attribute.

However, after a restart of HA, the state is restored but the only attribute restored is the one defined in the initial configuration (Friendly Name).

I am not sure whether this is a bug or a feature request as the documentation only references state, not attributes, but it seems reasonable to expect that both would be restored.

@estegewr
Copy link

Up to version 0.15.0, I was able to restore attributes by initializing the attributes in the configuration file to an empty string. I think that this was more of a side effect and not a planned behavior. Since version 0.15.1 this is no longer possible.
Therefore I would like to join the feature request. Restoring attributes in the same way as status values would be very helpful. if it simplifies the implementation, I would also name the attributes to be restored in the configuration.

@amandatennent
Copy link

I came across this issue as well, my work around (in case anyone else finds it helpful) is to create a script and have it run on home assistant start up

@estegewr
Copy link

estegewr commented Jul 18, 2024

Where do you get the values to restore them in the init script, @amandatennent?

@amandatennent
Copy link

I guess my use case is different, the attributes on my variables are static and aren't modified after they're created. I mis-read the initial issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants