This automation is intended to work out the battery charge time required (in hours) to boost the batteries by a certain percentage (input_number.battery_topup_level) and update the entity (input_number.batery_topup_to_charge_time) with this number. So, in the automation below, if the battery charge percentage required is between 19% and 36%, the entity (input_number.batery_topup_to_charge_time) should be updated to 1. Except that it doesn’t do this. (input_number.battery_topup_level) is 26% at the moment. Is the percentage causing the problem?
Plus you have constrained the Numeric State Trigger to monitor a specific attribute of the Input Number called initial. Is that really what you want it to monitor? Because I think you want it to monitor the Input Number’s state value in which case you should remove attribute: initial
If you want to act on all values between 18 and 37, use a State Trigger with a Numeric State Condition.