You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A service to delete a deleted entity's stored state information. Not its History but the information (in the hidden.storage folder) used to restore the entity's state after a restart.
I recently discovered something that is either a feature or a bug. Either way, it can be a drawback in certain situations.
When you create a Trigger-based Template Sensor its state information is stored. That's a good thing because, after a restart, the entity's state and attributes are restored.
When you delete a Trigger-based Template Sensor its saved state information is not deleted (regardless if it has a unique_id or not). If you re-create the Trigger-based Template Sensor (i.e. with the same entity_id) it will be immediately assigned all of the stored state information.
Depending on one's point of view, or use-case, this is either a feature or a bug. For example, when experimenting with a Trigger-based Template Sensor, I might go through several versions and I want to purge any accumulated state information (typically lists or dicts in attributes) before proceeding to the next version. This doesn't work:
Delete it
Reload Template Entities
Re-create it (i.e. same entity_id)
Reload Template Entities
Deleting the entity doesn't automatically purge its stored information so the re-created entity instantly inherits the stored information. What does work is to edit the hidden file, containing the information, and deleting the entity's (previous) state information (directly editing this file isn't convenient nor free from risk).
FWIW, helpers behave the same way. Turn on an Input Boolean then delete it. Create another Input Boolean with the same entity_id and its state is instantly on.
It would be handy if Spook offered a way to delete a deleted entity's stored state information. Allow Spook to get rid of the zombies.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
A service to delete a deleted entity's stored state information. Not its History but the information (in the hidden
.storage
folder) used to restore the entity's state after a restart.I recently discovered something that is either a feature or a bug. Either way, it can be a drawback in certain situations.
When you create a Trigger-based Template Sensor its state information is stored. That's a good thing because, after a restart, the entity's state and attributes are restored.
When you delete a Trigger-based Template Sensor its saved state information is not deleted (regardless if it has a
unique_id
or not). If you re-create the Trigger-based Template Sensor (i.e. with the same entity_id) it will be immediately assigned all of the stored state information.Depending on one's point of view, or use-case, this is either a feature or a bug. For example, when experimenting with a Trigger-based Template Sensor, I might go through several versions and I want to purge any accumulated state information (typically lists or dicts in attributes) before proceeding to the next version. This doesn't work:
Delete it
Reload Template Entities
Re-create it (i.e. same entity_id)
Reload Template Entities
Deleting the entity doesn't automatically purge its stored information so the re-created entity instantly inherits the stored information. What does work is to edit the hidden file, containing the information, and deleting the entity's (previous) state information (directly editing this file isn't convenient nor free from risk).
FWIW, helpers behave the same way. Turn
on
an Input Boolean then delete it. Create another Input Boolean with the same entity_id and its state is instantlyon
.It would be handy if Spook offered a way to delete a deleted entity's stored state information. Allow Spook to get rid of the zombies.
Beta Was this translation helpful? Give feedback.
All reactions