Hei Guys,
I got some general questions abaout automations I wasn’t able to figure out:
How often are the triggers are validated?
I got a condition that evaluates a temperature sensor value against an input_number. (Triggered by Temperaturchange(how is this specified?))
Automation should run, if sensor value is below input_number value.
Last night sensor was 4.8°C and input_number value was 5.
The automation did not work. Are there any casts or conversions that inhibit going further?
Hope anybody can give me some clearance.
I was thinking homeassistant would be more convinient then writing some own solution but at the moment I can’t see the advanatges.
Depends on the trigger. But basically, whenever the relevant “things” change.
It’s always useful if you’re having problems with an automation to post that automation so we can see it. And please post it in YAML as text, properly formatted.
E.g., the trigger of your automation should probably look like this:
unfortunately I go no access to the yamls at the moment because HA is running at friend’s house.
OK. Thanks a lot. I got one last question.
What exactely does the mode “single” mean.
Is the automation triggered only once?
I’m calling a REST service when automation ist triggered. It seams like it is triggered once but never again.
This trigger will be evaluated whenever either sensor.TEMPERATURE or input_number.SET_TEMP changes. The trigger will only “fire” when the numeric value of sensor.TEMPERATURE changes from a value that is the same or higher than the numeric value of input_number.SET_TEMP, to a value that is lower than the numeric value of input_number.SET_TEMP.
Again, let’s be more concrete. Let’s say the numeric value of input_number.SET_TEMP is 5. And the numeric value of sensor.TEMPERATURE is 4.8. That alone does not cause the trigger to fire. Now let’s say the numeric value of sensor.TEMPERATURE changes to 4. That, too, will not cause the trigger to fire because the value didn’t change from 5 or above to below 5. Now the numeric value of sensor.TEMPERATURE changes to 5.1. Still no fire. But now the numeric value of sensor.TEMPERATURE changes to 4.8. NOW THE TRIGGER WILL FIRE, because it changed from a value of 5 or higher to a value below 5.
At this point the action(s) of the automation would run. The mode only applies if, while that action (or those actions) are still running the trigger fires again. (I.e., the sensor’s value changes to a value of 5 or above and then again to a value below 5.) It’s very unlikely that will happen in the time it takes to run the action(s) of the automation. So in the case of this particular automation, the mode probably doesn’t matter.
To be clear, the “single” mode does NOT mean the automation only ever runs once. It just means it can only be running once at any given time.
If that doesn’t help, then when you do get a chance to access the YAML files, please post the automation and we can talk more specifics.
appreciate your work in explaining this to a noob.
That did help a lot for understanding.
I’m going to get access tomorrow then I’ll post the yaml and hope we can discuss it.
Again, it will only trigger when the numeric value of the sensor changes from a value equal to or above the numeric value of the input number to a value below the input number. Just because the sensor updates every minute doesn’t mean it will trigger the automation. The value has to change as mentioned above. And, once it does trigger it won’t trigger again until the value becomes equal to or above the input number and then changes to a value below the input number.
So, yeah, as @123 asks, what are the sequence of sensor values that occur that you think should trigger the automation but doesn’t?
OK, got the functionality. We tested that successfull without issues on one sensor. We got six of them. Each one has an own automation (but they are all cloned from the same one). The others did not seam to be reliable. I’ll post updates tomorrow. Is there any loglevel I can increase to save more information about the automations ?
To make a first summary:
It works reliable for over 3 days now.
Thanks a lot guys.
But anyways: this is the worst case in engineering - it works and you don’t know why it didn’t
I hope it’ll work from now on.
Thanks a lot for your great help and information