Automation to calculate battery charge percentages

      value: >-
        {% set charge_target = states('number.lux_ac_battery_charge_level') |
        float(0) %} 
        {% set current_charge = states('sensor.lux_battery') |
        float(0)  %} 
        {% set charge_topup = charge_target - current_charge %} 
        {{ [charge_topup, 0] | max | round }}

Also show us the values for the number and sensor.