I cannot for the life of me get this to work correctly.
What I am trying to do:
If ‘sensor.solis_battery_soc’ is greater than or equal to ‘input_number.eco7_target_soc’ then set ‘input_number.eco7_target_soc’ to match ‘sensor.solis_battery_plus_3’. if ‘input_number.eco7_target_soc’ less than ‘sensor.solis_battery_soc’ do nothing.
My automation:
trigger:
- platform: time
at: "00:00:00"
condition:
- condition: template
value_template: >-
{{ states.sensor.solis_battery_soc.state | int >=
states.input_number.eco7_target_soc.state | int }}
action:
- service: input_number.set_value
entity_id: input_number.eco7_target_soc
data:
value: "{{ states.sensor.solis_battery_plus_3.state | int }}"
The problem: The automation updates the state of ‘input_number.eco7_target_soc’ to match ‘sensor.solis_battery_plus_3’ even when ‘input_number.eco7_target_soc’ is less than ‘sensor.solis_battery_soc’ as well as higher.