I’m trying to create a binary sensor that switches on when a battery has a charge lower than that defined via an input_number. The battery value is reported via a sensor as a percentage.
Here’s what I’ve got so far, but this doesn’t work. I’m assuming it’s because the sensor.niu_battery is reported as a percentage.
- platform: template
sensors:
niu_end_charge:
friendly_name: Niu End Charge
value_template: "{{ states(input_number.niu_battery_max) | float < (sensor.niu_battery) | float }}"
Any ideas as to what I’m doing wrong? Suggestions for things to try?
Thanks.