snarky-snark / home-assistant-variables

A custom Home Assistant component for declaring and setting generic variable entities dynamically.
Apache License 2.0
274 stars 16 forks source link

Variable initial value will not update #110

Closed tescophil closed 4 months ago

tescophil commented 5 months ago

When a variable is first configured with an initial value. if a change is made to the initial value configuration and home assistant restarted the variable keeps the first initial value and ignore the new settings.

This is my config entrys

Screenshot_2024-03-28-11-16-07-77_c3a231c25ed346e59462e84656a70e50

and these are the actual values

Screenshot_2024-03-28-11-38-42-44_c3a231c25ed346e59462e84656a70e50

Which don't match the values set in the config (apart from the standing charge variables which have not changed)

The values seen are the previous values when the variables where first used.

These variables are not updated or changed anywhere else, just a static value set in the config file.

snarky-snark commented 4 months ago

This is the expected behavior. Initial value is for the first time the variable entity is initialized on the home assistant database. If you want to reinitialize on startup, you need to hook the HA startup event.