enkama / hass-variables

Home Assistant variables component
89 stars 12 forks source link

Feature or Knowledge? How to delete attribute for "restore: true" #134

Open pickonedev opened 1 week ago

pickonedev commented 1 week ago

Hi!

I have a question, I don't know if you already can do this with the current version of the addon, or it could be a feature request... Let's say that I have a sensor like this:

variable_last_state:
  name: Last State Entities
  value: "ok"
  restore: true
  attributes:
    switch_toilet_toothbrush: 0
    switch_bathroom_toothbrush: 0
    switch_bathroom_water_flosser: 0

In this moment, if I want to delete an attribute, I need to delete the line attribute from yaml, then set the restore to false, restart HA or reload yaml, then set restore back to true and another restart.

There is any other way to remove attributes? Something easy like: delete the line attribute from yaml (just to not create confusion in the future), then run a service action somehow...

Thank you!