You used the value_template option incorrectly. In fact, you used it twice (incorrectly).
You can only have one value_template option. It’s for computing the value that will be used by the above (and/or below) option. You didn’t do that; you used it to perform a comparison.
If you explain what you are trying to do, I can help you achieve it. As it stands, it’s unclear to me how you want to compare the thermostat’s temperature with the input_number and external temperature and the threshold value of 2.
thank you for your willingness to help me. I would like to obtain a “true or false” result by comparing the value set in “slider” and the outside temperature.
I need it to be able to turn on a stove when the outside temperature goes below 2 degrees c ° from the value set in “slider”
What’s unclear to me is where does the temperature attribute of climate.bagni fit into all of this? You used it in the Numeric State Trigger but your requirements only mention comparing the input_number and external temperature.
I’m sorry if I still bother you. Your suggestion works but I can’t (just can’t) figure out how to extract the value “true” “false” to execute the trigger that will activate my user.
I have read the HA tutorials but to no avail.
I was thinking of creating a boolean input where to see the state but this road has also closed.
This is the code that should be executed.
I created a boolean input which should receive true / false from value template.
I understand that the code is garbage but I am trying them all.
I just have to turn on and off a miserable stuff with the result of the template you wrote me and that works with the simulation.
If you mean the entity input_boolean.termometer will be assigned true or false by the value_template in the automation’s Template Trigger then, no, it will not. There’s nothing in Home Assistant that works like that.
If input_boolean.termometer is an existing entity, its state value will be either on or off (not true/false).
The following automation can work but it’s still unclear to me if that’s what you want.
ok, be patient, I try to explain myself. The trigger works but the problem is that I don’t know how to connect the true \ false state with the on \ off value of the boolean input. Basically I don’t know how to make them meet.
All entities are present and visible.
Sorry but that still makes no sense. There’s simply no connection between what the Template Trigger produces and the input_boolean’s state. They don’t “meet”.
Let’s try another approach: explain what you want the automation to achieve in simple terms. For example, here’s what the one posted above does:
When the external temperature is at least two degrees less than an input_number AND an input_boolean is on, it turns on a switch.
That’s what the example I posted does except it also tests if input_boolean.termometer is on. If you don’t want that additional test then remove the condition.
I solved it after several tests and thanks also to your code. In practice I was wrong to write the boolean entity and I had to restart the raspberry …
I understood that the trigger is activated when the model is true (read on the tutorials) and based on this I have also regularized the Boolean entity.
I just need to do the automation that turns off the heater and I’m done.
And an analog, similar, for the decrease.
The defect is that the increase (and decrease) of the set point does not stop, but despite having set the max_temp to 28 it continues to increase.
I have been trying for hours to stop the increase at 28 ° c by copying models found in the forum but to no avail.
Do you have any suggestions. Thanks in advance
max_temp limits the maximum temperature a user can set using the Thermostat card. It does not limit the maximum temperature you can set using the climate.set_temperature service call.
You will have to enhance script.temperature_up so it rejects attempts to increase the temperature above 28 (similarly script.temperature_down will need to ignore requests to decrease below 15).