Convert Unavailable value from inverter to zero

Hello there,

im new here and comming from iobroker.
Home Assistant is really great, but I can’t solve one problem. It’s probably just a syntax error.

The photovoltaic system goes into the “unavailable” state at night and the tiles then have an error.
So I want that when a non-numeric value comes, that it is then replaced by “0”.
I also found a code that basically does this correctly - but it adds two sensors. How do I get that for one sensor at a time?

Working:

template:
  - sensor:
    - name: Solar_ohne_0
      unique_id: Solar_ohne_0
      unit_of_measurement: W
      device_class: Power
      state_class: total
      state: >
        {{ float(states('sensor.solartisch_power'),0) + float(states('sensor.balkonkraftwerk_power'),0) }}

This gives me the correct value for both inverters.
But I also want to have each one individually, but I’m too stupid to rewrite it. No matter what I do it doesn’t work.

I thought it goes like this:

template:
  - sensor:
    - name: SolarTisch_ohne_0
      unique_id: SolarTisch_ohne_0
      unit_of_measurement: W
      device_class: Power
      state_class: total
      state: >
        { float(states('sensor.solartisch_power'),0) }

  - sensor:
    - name: SolarBKW_ohne_0
      unique_id: SolarBKW_ohne_0
      unit_of_measurement: W
      device_class: Power
      state_class: total
      state: >
        { float(states('sensor.balkonkraftwerk_power'),0) }

Where is the mistake?

Thank you very much!!

Ouch.
Found the bug myself. Any improvements?
In case anyone needs it, here is the code:

template:
  - sensor:
    - name: SolarTisch_ohne_0
      unique_id: SolarTisch_ohne_0
      unit_of_measurement: W
      device_class: Power
      state_class: total
      state: >
        {{ float(states('sensor.solartisch_power'),0) }}

  - sensor:
    - name: SolarBKW_ohne_0
      unique_id: SolarBKW_ohne_0
      unit_of_measurement: W
      device_class: Power
      state_class: total
      state: >
        {{ float(states('sensor.balkonkraftwerk_power'),0) }}