Now I want to add a virtual switch on the same card where the main relay switch is and the humidity readout.
This switch controlls the first automation, if on, automation is active, if off automation will be ignored/off.
Seems like your ‘virtual switch’ is just added complication - just add the automation to the dashboard, it will appear with a toggle switch to turn it on and off.
The only way to do that would be with a timer, but to be perfectly honest it’s pretty pointless and you’ll spend ages coding it to get it working and then in a couple of months you’ll realise that you don’t spend your whole day looking at the dashboard so the timer is pointless and remove it anyway.
The process with homeassistant is always the same.
Start doing cool automations
Design an amazing dashboard with a load of super-cool things on it to show off to your friends
Start refining your automations so that you hardly ever need to look at your dashboard because your home is smart and ‘just works’
Reduce your dashboard to a minimalist functional affair
I don’t want to stifle your journey through that process, but having a visual timer for this purpose is about 40 lines of code that doesn’t achieve anything.
Very well - in that case, instead if a simple automation that triggers after 10 minutes you’re going to need…
A timer configured
Your first automation to start the timer.
Another automation to monitor whether the timer needs to be stopped and reset and/or restarted (ie - if the temperature goes back up).
Another automation to fire when the timer reaches zero, to do what your original automation did
And even then, I have a feeling that lovelace might not represent it properly if the timer gets stopped and restarted (ie - the temperature spikes up and immediately back down), so you might have to add an extra step to the middle automation, but that might be overkill, will have to see what happens)
13 month later I don’t knkw what you decide buy maybe a graph or a journal would have done the job done in a simple manner and/or adding a “last change” info to your switch