i am using the following:
input_number:
ac1_auto_min:
name: 'AC1 Min'
min: 10
max: 30
step: 0.1
ac1_auto_max:
name: 'AC1 Max'
min: 10
max: 30
step: 0.1
i want that the difference between the two will be a minimum of 2 and that if the max is always higher than the min
so for example if min = 20 and max=25 and i change max to 20, min will be automatically changed to 18.
trying this doesn’t change as expected:
- id: ac1_max_changed
trigger:
platform: state
entity_id: input_number.ac1_auto_max
condition:
condition: template
value_template: "{{ (float(trigger.payload) - 2) < float(states('input_number.ac1_auto_min')) }}"
action:
- service: input_number.set_value
data_template:
entity_id: input_number.ac1_auto_min
value : {"entity_id": "input_number.ac1_auto_min","value": {{ float(trigger.payload) - 2 }}}
it is valid, but not sure what is wrong - what am i missing?