A way to separate manual vs programmatic interactions

To illustrate the reason why this is needed, let me give you a real-life (first world) problem I have: I have a fan that turns on when a sensor goes above a certain temperature and off when it goes below it. Unfortunately, temperature is a tricky thing and sometimes 25 (Celsius) feels hot and sometimes not that much. So if the fan turns on and it becomes a bit too much, I would like to turn it off without it turning itself back on a minute later when the sensor reports again and end up in me disconnecting the fan altogether to avoid the battle.

Way back when I was a Webcore user and they had this cool little feature in which you could filter on whether an “interaction”, as the call it, was physical or programmatic. Something like this:

It was super useful! It allowed you to choose different actions based on whether I manually turned on a light or whether it was an automation that turned it on, for example.

Even more useful would be if you could also check the source of the last interaction as well. That would allow you to create the much needed “manual override” feature without resorting to creating separate helper entities like input booleans for every automation that you might want to have an override for. In other words, an automation could trigger and not perform any actions if the last interaction was manual but run normally if it wasn’t.

Maybe there’s already another way to achieve this today without the use of a whole bunch of helper entitites. If there is, please let me know. Otherwise, I think this would be a great addition to automations.

Nice! I did not know this!

Do you know of a way to get the value of the previous {{trigger.to_state.context.user_id}} and not the current one?