Template with number.set_value no longer works after HA update

Hello here in the forum,

Maybe someone has a similar problem and already has a solution:
For a few days now, presumably after the last update of the HA, my charging control calculation no longer works (:


      - service: number.set_value
        data:
          value: >-
            {{ ([5, int(states('number.charging_amps')) +
            float(states('sensor.zahler_sum_active_instantaneous_power'))/-230,
            16] | sort)[1] | round(0) }}
        target:
          entity_id: number.charging_amps

It calculates the new charge value for my car based on the current performance of the electricity meter.
The error seems to be in the number.set_value service
Any ideas?

What error do you get in your logs?

Hello Tom, thank you for your inquiry. The only error messages I found was “unknown error”. I finally found that it was caused when I handed it over to Tesla and simply restarted the car. Now it’s working again, I think the update for the Tesla integration was the problem, not the update to the home assistant.