So I have a Wemos D1 Mini with a Dallas Temp Sensor DS18B20 probe.
The probe is inside a paddling pool and is providing temperature readings.
I also have a small pump that is connected to power through a Tapo TP105 plug.
What I want is:
Wemos reports the water temperature every 5 minutes
If the temperature is under 29 degrees, the pump must turn on
If the temperature is over 29 degrees, the pump turns off
All the above needs to be done between 09:00 and 18:00
Triggers only happen when the test in it changes from false to true
Each condition you have also needs a trigger
The reasons why can be found in this post:
To get it to work reliably, you need to add triggers for the start of the timeframe, and with it also extra conditions that test for the temperatures (again). That is the bit in the post linked above with the title " My automation does not always work (AKA: why won’t the trigger always fire)".
It will complicate using trigger ids in the action part, so using separate automations for on and off might be a lot easier to read and understand.
Your automation is designed to trigger when the temperature crosses the threshold value of 29 degrees. In other words, at the moment in time when the temperature decreases from above 29 to below 29 or vice versa. So if the current temperature is 27, nothing will happen until the moment it rises above 29.
After it crosses the threshold value, it checks if the current time is between 9:00 and 18:00. If it is then it proceeds to either turn on or turn off the switch. If it is not within the time range, nothing happens and nothing will happen until the automation is triggered again.
The automation does nothing when the time becomes 09:00 or 18:00 because there’s no Time Trigger.
Hi @123
No, it’s not, I have definitely messed it up, but I cannot get my head around how to introduce this check to be done periodically instead of only when crossing the threshold, or how to introduce a Time Trigger.
For the first part, I am completely clueless.
For the second, I can create a simple automation that turns the pump on at 09:00 and turns it off at 18:00. I think that’s the easy part.
No worries, it’s very common to misunderstand how a Numeric Trigger works. It only triggers when the value crosses the threshold because, for most applications, that’s the most efficient method.
It would, but as explained in the post I linked it is not the best way to go about it, and it is not necessary to check every five minutes. For one, it could now take up to 5 minutes to respond to temperature changes. And if you want some form of manual control, you cannot.
if your automation only fires on the temperature trigger and at the one time of the day time the automation should start being active, or at the end of the period if that is when it should turn off, then that is enough. So at 9:00 and 18:00 like you said in your first post.
It is all explained in the post I linked. You need one trigger on temperature and one on a specific time (9:00 for on, 18:00 for off), and also a condition for the temperature and the time range.