Hi everyone! I’ve been experimenting with virtual components and template lights in Home Assistant to create virtual devices for storing data, which I then use in my automations. For instance, I have a virtual light called ‘Next Wash Cycle’ that helps determine when my washing machine will start the next day based on its brightness level. This setup isn’t directly linked to other devices; instead, Node-RED uses these attributes to define a time variable later on.
I wanted to clarify this because I noticed that most users creating template lights or virtual components link them directly to other services in their configuration.yaml, which isn’t my case. However, I recently discovered that both template lights and virtual component lights don’t retain their state after a Home Assistant restart. This is a bit of an issue for me since I’m constantly tweaking my setup and restarting HA several times a day. Plus, I’d like my system to survive a power outage.
So, does anyone have a recommendation on how to create virtual lights that keep their state after a restart? I need some that only have brightness and others with both brightness and color. I already use many input_booleans, which do keep their states, and it would be fantastic to have similar helpers that function as dimmer lights.
Thanks for all the help! Rodrigo