Helper Group of Sensors unavailable if one is unavailable

I have a template sensor to monitor unmonitored power use:

  - platform: template
    sensors:
      unmonitored_power:
        friendly_name: Unmonitored Power
        unique_id: Unmonitored_Power
        device_class: power
        unit_of_measurement: W
        value_template: "{{ (
        (states('sensor.legrand_din_power_consumption_module_electricalmeasurement') | float(0))
        - (states('sensor.presa_home_network_active_power') | float(0))
        - (states('sensor.presa_mobile_tv_active_power') | float(0))
        - (states('sensor.presa_lavatrice_active_power') | float(0)) 
        - (states('sensor.presa_pompa_piscina_active_power') | float(0)) 
        - (states('sensor.presa_asciugatrice_active_power') | float(0)) 
        - (states('sensor.presa_friggitrice_power') | float(0)) 
        - (states('sensor.presa_frigorifero_active_power') | float(0)) 
        - (states('sensor.presa_lavastoviglie_active_power') | float(0)) 
        - (states('sensor.shelly_bagno_power') | float(0)) 
        - (states('sensor.shelly_camera_cassettiera_power') | float(0)) 
        - (states('sensor.shelly_camera_letto_power') | float(0)) 
        - (states('sensor.shelly_cameretta_scrivania_power') | float(0)) 
        - (states('sensor.shelly_taverna_mobile_power') | float(0)) 
        - (states('sensor.shelly_taverna_scrivania_power') | float(0)) 
        - (states('sensor.shelly_sala_divano_power') | float(0)) 
        - (states('sensor.shelly_caldaia_power') | float(0))
        ) | float(0) | round(0)}}"

The issue with this is that every time I add a new power monitoring device, I have to manually edit the template sensor.

To make this easier to maintain I was looking in creating with helpers a group of those sensor with the sum of their power usage so to replace the above list with just one overall monitored power sensor.
The group is working fine till one of the power monitoring devices in the group became unavailable, one single unavailable device makes the group status unavailable as well and it stop summing all other sensors consumption.

Is there a way to have all sensors in an helper group that will still operate even if some sensors are unavailable ?

Thank you!

You are my hero, actually the template I set up is based on tips I saw from you here and there on the forum.

Unfortunately there are some entities with the _power that are actually something else and should not be included, in fact the result of your template return me a negative number :frowning:

EDIT: It might be counting my actual unmonitored power sensor as I tetsted it in the template before doing the modification. I will now try modifying the sensor itself.

I might be renaming the _power I want to monitor with something unique like _powerxxx that should allow me to just rename the entities I want to include, right ?

Can we eventually modify the template to gather the power status from the entities of the group I created ? This will prevent me from renaming the entities and I’ll only have to maintain the group.

Yes mate, renaming the entities could be the solution, I was just wondering if the template could be modified to only get from a certain group to make it easier and avoid the entities renaming steps. I dont have the skills to re/write the template and I was hoping you can make the trick. If it cant be done, no worries you already helped me way more than expected :slight_smile: