I currently have two input_numbers that I want to use to determine when my battery charger should switch on. They look like this:
- platform: template
sensors:
niu_start_charge:
friendly_name: Niu Start Charge
value_template: "{{ states('input_number.niu_battery_min') | float > states('sensor.niu_battery') | float }}"
- platform: template
sensors:
niu_end_charge:
friendly_name: Niu End Charge
value_template: "{{ states('input_number.niu_battery_max') | float < states('sensor.niu_battery') | float }}"
niu_start_charge
is on when the battery level is below the value input_number.niu_battery_min
and niu_start_charge
is on when the battery exceeds the value of input_number.niu_battery_max
. sensor.niu_battery
is the current charged level of the battery.
I can use these binary_sensors to establish when to start and stop the charging process but it requires two seperate automations. I’d like to be able to combine the two binary_sensors given above into just one, which only returns true when the battery level is below the minimum value and below the maximum level. But, it should not be on when it is above the minimum level even if that is below the maximum charge level.
So… Is there a way to combine those two binary_sensors into one? If so I’d appreciate a nudge in the right direction.
Thanks