Here is my issue: Sensor returns correct value while shelly is working and available (Custom sensor does some Maths on Power Consumption using shelly sensor). However, once shelly goes offline this custom sensor also goes unavailble. I would like it instead of going unavailable to just display its last known value. Any help on this would be greatly appreciated, here is the custom sensor template:
power_consumption:
friendly_name: House Power Consumption
value_template: >-
{{ ((states('sensor.solar_channel_2_power') | float + states('sensor.solar_channel_1_power') | float) | round) }}
unit_of_measurement: "Watt"