Shellies Discovery Script

I have some issues with the utility meter when I reboot my HA.
My utility meter looks like this in my configuration.yml:

utility_meter:
  daily_solar_energy:
    name: Solar Total Energy Daily
    source: sensor.shelly_em_solar_meter_total_returned_0
    cycle: daily

It gives me a peak number when I want to check the Energy panel when I rebooted my HA.
I think there might be a problem described like here:

So a availability_template with a check on the is_state (as described in the article in te link) should resolve the problem (I hope). But I do not know how to the availability_template to the template of the sensor (for example: sensor.shelly_em_solar_meter_total_returned_0)

Any idea how to solve this please?

Thanks a lot

Marijn