Dummy sensor whose state can be set by automations

I read a lot in the forums now but I still dont understand the standard solution for a very simple problem.

In my setup there are HA events generated by my sensors and automations. Now I want a sensor, which is visible in the GUI like let’s say a mqtt sensor. I now want this sensor to change it’s state according to specific events. For example there is an event A which shall set the sensor state to “on” and an event B that sets the sensor state to “off”.

I am symply looking fo a “dummy sensor” which’s state can be set by an automation. I can’t find such a sensor.

More abstractly spoken: I am looking for a global variable whose state can be shown in the GUI and can be set by automations.

What is the right way to achieve this?
Or is this really not possible?

Use an input_boolean for this. It should do exactly what you want. If you want it to be visible among the other sensors as well however you can make a template sensor with the state being {{ states.input_boolean.YOUR_BOOLEAN.state }}


You totally made my day!

Somehow I was so fixated on sensors or switches that I didn’t see this component.

Thanks a lot and have a great day

1 Like

I use an input_select to accomplish this. I’ve recently found this project for real variables, but I haven’t tried it yet.


Thanks for the link!

Yes that seems to exactly address my idea. Sadly it’s not a standard component by now. It’s good to see that I am not the only one wth this approach. I will follow that discussion.

@Jolanrensen. Appreciate your feedback here. I’m trying to create a ‘dummy’ switch I can control with Google/Alex that fires a script. I see the template switch which looks ideal but I have no off action to load into the config. Any idea how I’d create the switch with a null off action?