Configuration new entity

Dear team,
I want to make new entity in my home assistant.

- sensor:
      - name: Remaining energy
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: kWh
        state: "{{ states('125')|float(0) - states('sensor.sonoff_energy')|float(0) }}"
        availability: "{{ has value('125') and has_value('sensor.sonoff_energy') }}"

125 value is my quota energy.

still not Woking.
Somebody please help…

big thanks for everyone…

This part is invalid. ‘states’ acts against entities not string representations of a number (enclosed in quotes, it’s now a string’)

states('125')

Either create a number helper and store your ‘quota’ in it and then use it to feed that state or get rid of it entirely and replace it with float(125)

Id do the helper in case that quota number needs to change in the future.