@nick67 wrote:
I’m trying to figure out the most HA-appropriate way to store and edit arbitrary values - i.e. variables.
Example: guest mode
I want a virtual switch in Lovelace that lets me set a Boolean for whether or not I have guests visiting. This Boolean will interact with the rest of the system in 2 ways:
- I’ll have automations listening for a Boolean state change that will do some things as soon as this switch is flipped
- Other automations will have this Boolean as a condition, and only run if guests aren’t here
Example: ideal brightness
- I want to store an integer ideal light brightness based on time of day. A series of automations would set this “ideal brightness” variable to 60 at sunset, 15 when I press my goodnight button, 40 at 6am, and 100 an hour after sunrise.
- When I turn on a light, the brightness in the turn on automation will be templates off of this ideal brightness variable.
- Unlike the guest Boolean, I don’t need to expose or edit this variable in the UI
Are these “variables” both virtual sensors of some kind? (One a binary sensor, one a numeric sensor). If so how do I create arbitrary virtual sensors and how do I update them? Am I thinking about this architecture all wrong for the HA paradigm?
Posts: 3
Participants: 3