I have automations that use max_temp and min_temp values for work.
Each value is an different input_number configurable via UI.
My problem is that all works fine if min_temp < max_temp but if by error the values aren’t correct (min_temp > max_temp) the automations doesn’t work as expected.
I wonder if it is possible to validate the user input in some way?
For example, when changing the value of min_temp with the slider automatically set max_temp to a higher value if min_temp reaches max_temp. And doing the reverse when setting max_temp.
The other option is to change automations to check the values and take into account the error condition, but i think is much better to do input validation first. Keeps automations cleaner and if there are many automations, avoid to do many code changes.
I think it would be useful to have a helper of range type. With a min-max slider selector or something similar.
Thanks for the reply.
It is possible that I could use the generic_termostate for my current purposes.
But I am doing the automations to learn how to develop in HA and in the future I would like to use this kind of min-max range for other variables than temperature (water level, awning opening angle, etc.).
So anyway I would like to know if it is possible to do what I was asking.
Thanks!