Forecast.solar down .. unavailable v unknown | default - my learning

Hi
just thought i would share my learning today with forecast.solar down - and see if someone has a better way to deal with it.

I learned that while I thought I had created robust solution(s) in templates/jinja by using | default () it does not work as I had expected, like today with forecast.solar returns ‘unavailable’ and down stream sensors = ‘unknown’ … I have had to explicitly define these cases better, what I have done is, eg

whereas
sensor is your sensor or whatever
default = default value, maybe 0? depends on your template

{{ set variable = default_for_variable if (sensor in ['unknown','unavailable'] or sensor2 in ['unknown','unavailable']) else formula_sensor_and_sensor2 }}

with that said, maybe there is a better way than this?

Currently, all I see is that the host is offline, so one can assume that the site and the API will come back online.