Hopefully someone can help me work out where I’m going wrong.
I have an automation that when I turn on the outlet for my fan, it would wait for an hour, see if the temperature is below a set value, and if so it would turn off. However I can see in traces that the following error occurs:
Stopped because only a single execution is allowed
I’m thinking this might be down to the mode in the automation being single but I’m not sure what this should be set to, or if i’m going wrong elsewhere.
Some of the names are a bit odd I know. These were devices I added very early on. I also repurpose the outlet for some christmas lights later in the year, hence the condition.
Why the loop is stopped when the automation re-triggers is (as far as I am concerned) a bug. The second trigger should just be ignored and the loop should continue if the automation is in single mode.
However having said that your automation is not the way to do it.
You should not be waiting in an automation for hours.
Turn the light on with one automation that triggers on your switch turning on.
Turn the light off with another automation that triggers on your bedroom temperature (numeric state trigger) falling below 23, or (state trigger) your switch turning off. So two triggers.
The main thing I’m trying to achieve is for the fan to have a timer, so it will turn off after an hour, but only if the temperature is below a set value (thinking of making this a variable with a helper). So then if it is above that value, it will stay on until the temperature drops.
Good point about using entity ID instead. I’ll look at switching that out too
If the temperature drops below 23° (1st trigger) before the 1 hour is up you don’t want it turning off. The switch time condition will prevent this.
Also after the switch being on for 1 hour (2nd trigger) if the temperature is not below 23° you don’t want it turning off. The temperature condition will prevent this.
Is this the sort of thing you mean? I was wondering if it should be the switch is on for an our as the trigger, and the condition as temperature. Rather than both as temperature?
What about using a climate entity?
This way you can set your target temperature and when the temperature is reached the climate will turn off the switch.
And to make sure the fan does not start again, the automation switch off the climate entity.
To restart it again you just start the climate entity.