Solar energy use per device

Did anyone already create a dashboard for solar consumption percentage on a device by device basis?

We have this in the energy dashboard on an aggregated basis in the energy dashboard but it would be great to be also have it per device

Thank you

I don’t think you realise how complicated that would be.

Lets assume you draw 50% of your energy for the day from the grid and 50% from solar. How would you determine which devices used the solar?

Did they only use solar, or did they use some gird power too?

You can’t know this just by observing when the devices were on and when you were generating solar power.

Not without separate metered lines from the grid and from the solar inverter to each and every device.

You might have an air conditioning or heating unit that used all the solar power. Or did the dishwasher use some too? Or did all three draw so much that they used a little grid power as well?

How would you split the solar used up?

By time generating and consuming and the ratio of powers each device used?

How granular would you do this, every second, every hour?

I’m not saying you couldn’t estimate this, just that it would be very far from easy.

Hi Tom

Thanks for your reply

I believe you are over thinking this, but I do agree it won’t be perfect. I am also not proposing to track where solar generated electricity flows to

Maybe as a first point, having solar usage per device is nothing new, the Sunny Home Manager for example already does this. I have SHM but don’t like it as it is too limited

I believe you could either work by simply splitting the total solar usage evenly across the different devices, or by setting priority levels (I believe this is how SMA does it) and allocate solar based on those. This can be worked out in templates.

From your response it seems like there isn’t anything similar to that out there, which I assumed so because i could not really find it anywhere

tom_l is correct.

It would be extremely difficult to get just a barely usable value.

Devices fluctuate in power consumption and solar cell generation fluctuate too.
In order to get a somewhat reliable value you need to really lower the update frequency of all the sensors, like 1 second or preferably lower.
This will make it somewhat possible to catch that cloud that pass over the solar cells or that device that require 400% startup power for a second before dropping to its running power.
The problem with lowering the update frequency is that your sensors needs to report in sync or with a timestamp or the result will be skewed.

HA does not handle a lot of the of sensors with 1 seconds updates and they will definitely not be in sync either.

1 Like

Hi Wally

Thanks for your view.

I appreciate all the points made but I feel they would not be that problematic

For example, picking up a short spike in usage is not valuable, nor will it move the end result, in case you are trying to get a view on how much solar is used when using your heat pump as that is nearly constant power for a long duration. Similar for car, washer, dryer and dishwasher

Currently I assume you can learn a lot even from using a 5 or 15 min interval.

I am just going to give it a try myself and see where I end up.

Happy to take any tips you might have

No I have never seen anything like this.

Very interested to see your results. Post here if you need any help with template syntax.

did a quick test to see if I could advance my thinking

It is probably difficult to split the solar out evenly
in case sum of the devices total consumption is smaller than available solar – all 100% solar usage
in case sum is smaller, split evenly → you might get into a situation where a small user has over 100% usage. you would then need to reallocate that to the others. I feel this might lead to a long iterative process, but will give it some more thought

this would not emerge when you work based on priorities (which i assume is how SMA has done it)

the below gives an idea where my thinking is at (will be errors i’m sure). it gives priority to the devices as chosen by me, i just took 3 now as an example. This is instantaneous but it would be better to look every minute or so at how much consumption the devices had and how much solar was available and allocate on that basis. Need to figure that out, maybe with platform:integration creating new ‘energy’ counter

will look at it later again but too much solar for now so all at 100%
image

  - platform: template
    sensors:
     template_wmtp_solar_usage_prio:
        ### solar used by wmtp/heatpump if priority 1 - cannot be more than 100% of its own usage psupply2 is inverter ###
        friendly_name: "Wmtp solar usage % prio 1"
        unit_of_measurement: "%"
        value_template: >-
          {% if   states('sensor.template_wmtp_total') < states('sensor.psupply_2')  %}
            {{ 100 | int }}
          {% else %}
            {{((states('sensor.psupply_2') | float / states('sensor.template_wmtp_total') | float )*100)  | round(1) }}
          {% endif %}
      template_solar_left_after_wmtp:
        ### priority 1 for heat pump - solar left after allocating to heat pump###
        friendly_name: "Solar left after wmtp"
        unit_of_measurement: "W"
        value_template: >-
            {{(states('sensor.psupply_2') | float - states('sensor.template_wmtp_total') | float ) | round(1) }}
        device_class: power
     template_ev_solar_usage_prio:
        ### solar used by EV if priority 2 - cannot be more than 100% of its own usage###
        friendly_name: "EV solar usage % prio 2"
        unit_of_measurement: "%"
        value_template: >-
          {% if   states('sensor.template_ev_consumption_home') < states('template_solar_left_after_wmtp')  %}
            {{ 100 | int }}
          {% else %}
            {{((states('sensor.psupply_2') | float / states('sensor.template_ev_consumption_home') | float )*100)  | round(1) }}
          {% endif %}
      template_solar_left_after_ev:
        ### priority 2 for EV - solar left after allocating to EV###
        friendly_name: "Solar left after EV"
        unit_of_measurement: "W"
        value_template: >-
            {{(states('sensor.template_solar_left_after_wmtp') | float - states('sensor.template_ev_consumption_home') | float ) | round(1)}}
        device_class: power
     template_washer_solar_usage_prio:
        ### solar used by washer if priority 3 - cannot be more than 100% of its own usage###
        friendly_name: "Washer solar usage % prio 3"
        unit_of_measurement: "%"
        value_template: >-
          {% if   states('sensor.switch_a0_power') < states('template_solar_left_after_ev')  %}
            {{ 100 | int }}
          {% else %}
            {{((states('template_solar_left_after_ev') | float / states('sensor.switch_a0_power') | float )*100)  | round(1) }}
          {% endif %}
      template_solar_left_after_washer:
        ### priority 3 for washer - solar left after allocating to washer - this might remain unallocated###
        friendly_name: "Solar left after washer"
        unit_of_measurement: "W"
        value_template: >-
            {{(states('sensor.template_solar_left_after_ev') | float - states('sensor.switch_a0_power') | float ) | round(1) }}
        device_class: power

:slight_smile: Yup.

The assigning of priorities makes this entirely artificial and not representative of the real world.