Looks good. If the availability template changes to False
(because one of the sensors is unavailable) your main sensor will report unavailable
and not pollute your sensor history with incorrect readings.
Actually as you are doing division, you should check that the denominator is not zero as well, as division by zero will throw an error:
availability: >
{{ states('sensor.daily_yield') not in [ unknown, unavailable, none ] and
states('sensor.energy_production_today') not in [ unknown, unavailable, none, 0 ] }}