Energy Management in Home Assistant

Only for the period of production, and only when production is higher than consumption.

Yes, otherwise there would be nothing to return to the grid :wink:

I’d like to completely “disconnect” the production (solar panel) from the consumption - as I always return 100% of the production to the grid… no matter what the consumption is…

possible?

Wiring-wise, how does the grid know how much solar power you are selling them? I can only phathom that concept with two separate circuits, one for your panel supply and a separate one for the solar production…

Your power meter can ‘see’ in which direction the current is flowing.
Old style spinning disc meters would actually spin backwards !

How does he sell back 100% of what he produces? His solar panels would have to be hooked up directly to the grid with a meter for them to know I would think…

I don’t think he can view the numbers the way he wants, based on these graphs since it looks like it assumes you are consuming your own solar first with any excess/shortfall going to or coming from the grid…

The return to grid sensor would need a flag informing HA whether the net positive difference is sent to the grid or 100% in which case Returned to grid would be 32.1 kWh, non-fossil consumed would be 100% and self-consumed solar 0%…

Exactly! Two separate circuits with two separate meters (one “input”, one “output”)… very common here for older solar installations (due to bad governmental incentives, see above)

Not sure if I’ve missed this elsewhere, especially as I know there’s other people out there using ‘Amber Electric’ and the custom integration for it… but as Amber pass through the wholesale price for both grid consumption and the solar feed in the sensor for the feed in price can (and does) go negative, meaning that I’m being charged to export to the grid. Equally at times the grid consumption price goes negative and I get paid to consume electricity.

I’ve noticed that the Energy configuration page ‘complains’ when the price sensors go negative as it’s expecting positive numbers, presumably so that the ‘cost’ entities can be ‘always increasing’.

I haven’t yet worked out what it means in terms of the accuracy of the daily cost amounts but curious whether anyone else is in the same boat and whether they know if this will cause any issues?

I figured as much, as strange as it sounds to us in the rest of the world! I don’t see how the current HA Energy can show you want you want. I think it would need internal reprogramming and have a flag to indicate whether solar generation is consumed (< consumption) / sent to grid (> consumption) or 100% is sent to the grid for those graphs to be correct. I don’t even know if the calculated costs of consumption and credit for generation would be correct. If you added the solar sensor kWh with a negative cost, or created a template sensor that is the negative of the reported kWh, to the grid consumption, the cost calculations should be correct but the graphs wouldn’t show solar. Not ideal…

Sounds similar to @cavalon 's dilemma…

As good as the Energy stuff is in the last two iterations of Home Assistant, I feel that the dev(s) had no idea of the international issues involved. Different countries (and I suspect different regions and different scalpers energy suppliers) do things different ways. In NZ you are lucky to get 0.08c when selling power to the grid, yet the grid charges you around 0.30c. Some places seem to just set them off.

All crazy, and meanwhile we all go to hell in a handbasket…

… I don’t think, “the rest of the world” works all the same either :wink:

I think a workaround for my case is the following: Either use “solar production” (Input: total_increasing of my solar panels) OR “return to grid” (Input: total_increasing of my solar panels). But not both at the same time… and therefore only have half of the nice metrics and graphics… I will test and calculate the results, once I get my “input-meter” sensor…

BTW: I get around 0.45€ per kWh returned to the grid (fixed rate, incl. the gov. incentives, for the next 15 years, 25 years in total) and pay around 0.2€ per kWh I consume… That’s way it does not make any sense to self-consume the energy I produce. As I said, IMHO a poor form of incentive…

Edit: These forms of incentives don’t exist anymore (btw: Switzerland), as they incentive to max. production (and do nothing on the the consumption side). Today you get a compensation against your investments (~20% - 30%) and get “market” prices for energy returned to the grid (~0.1€). In this case, one has the incentive to max. the usage of the self-generated energy and to low the consumption as a whole…

Maybe a stupid question, but in the past my Homeassistant was relying on an awful lot Utilitity meters (daily, monthly, yearly, hi and low tariff). Is it now correct to assume that with the new Energy Management solution I no longer need those utility meters? I only care in the statistical data per day, month and year and believe the Energy Management solution could do the same…

Can anyone confirm?

That’s correct

I’ve just set up a utility meter since my rate here is stepped based on usage.

Since the “return to grid” is the net difference which is not accurate in your case, what if you configure the solar production and then add a grid consumption that is negative of the solar production (new entity = 0 - solar production kWh)? The monthly energy cost would be correct in that case…

You mean like demand metering ?

Similar, but rather than a higher charge for any peak usages in a month, my rates are based on any usage above a threshold for the billing cycle. My billing cycle is on or around the 10th so the number of days in the billing cycle varies, therefore the threshold kWh for that cycle varies.

from Yukon Energy…

“A demand meter looks very much like the meters that are installed at residential homes. Residential meters measure the amount of electricity consumed by a household, allowing utilities to determine how much that household should be charged for power on any given month. Demand meters are installed for all businesses. As well as measuring the amount of electricity used, these meters also record the peak consumption of power. It’s necessary for the utility to have this information, since Yukon business customers are required to pay not only an energy charge but also a demand charge for peak usage.”

BCHydro

Residential Conservation Rate

Most residential customers are charged under the Residential Conservation Rate. Residential customers under the Residential Conservation Rate receive service under rate schedule 1101 of the Electric Tariff.
Customers are charged one rate for electricity up to a certain threshold in each billing period, and a higher rate for all electricity use beyond that threshold. This “stepped” rate is designed to encourage conservation.

How your threshold is determined

On your bill, the threshold for the lower Step 1 rate is calculated by multiplying the number of days in the billing period by 22.1918 kWh per day.

Customer meters are read on different days so billing periods can vary from bill to bill. The 22.1918 kWh per day is the daily equivalent of 1,350 kWh for the average two month billing period.

For example, a 60-day billing period would have a Step 1 threshold of 1,332 kWh (60 days x 22.1918 kWh per day). A 58-day billing period would have a 1,287 kWh (58 days x 22.1918 kWh per day) Step 1 threshold.
image

I fuddeled through and set up some cost sensors using templates. You prob need to make cost sensors with if statements and then do a total. Mine has a diff rate over 2000 kWh but I do not think I will reach that. My billing is on the second of the month, so I am going to live with it. (I am not totally sure of cost yet from my provider, taking a guestimate)

template:
   sensor:
      - name: Minute Power Cost
        state_class: measurement
        unit_of_measurement: USD
        device_class: power
        icon: mdi:transmission-tower
        state: >
          {% set production = states('sensor.power_shop_123_1min') | int %}
         
          {{ (production * 0.00009) }}  
          
      - name: Month_Power
        state_class: measurement
        unit_of_measurement: USD
        device_class: power
        icon: mdi:transmission-tower
        state: >
          {% set production = states('sensor.power_shop_123_1mon') | int %}
         
          {{ (production * 0.09) }}

I am using sensor day for the energy tab so it calculates that. I actually need to add the basic $17 a month flat rate charge to my monthly cost.

I have mine set up this way:

utility_meter:
  monthly_energy:
    source: sensor.current_cost_kWh
    name: Monthly Energy
    cycle: monthly
    offset:
      days: 10
    tariffs:
      - step_1
      - step_2
template:
  - binary_sensor:
      - name: Current Cost Monthly Energy Tariff Limit
        state: {{ states('sensor.monthly_energy_step_1')|float >= states('sensor.number_of_days_in_this_month')|float * 22.1918 }}

image

and 2 automations:

alias: BCHydro Monthly Tariff Change
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.current_cost_monthly_energy_tariff_limit
    to: 'off'
    id: step_1
  - platform: state
    entity_id: binary_sensor.current_cost_monthly_energy_tariff_limit
    to: 'on'
    id: step_2
condition: []
action:
  - service: utility_meter.select_tariff
    target:
      entity_id: utility_meter.monthly_energy
    data:
      tariff: '{{trigger.id}}'
mode: single
alias: BCHydro Set Current Rate
description: Sets the BCHydro Current Rate when the Tariff level changes
trigger:
  - platform: state
    entity_id: utility_meter.monthly_energy
    to: step_1
    id: step_1_rate
  - platform: state
    entity_id: utility_meter.monthly_energy
    to: step_2
    id: step_2_rate
condition: []
action:
  - service: input_number.set_value
    target:
      entity_id: input_number.bchydro_current_rate
    data_template:
      value: '{{ states("input_number.bchydro_" + trigger.id) }}'
mode: single

My basic charge is only $0.2080/day plus a transit levy of .$00624/day totaling only about $8/month

Good morning,

I do apologise if this has been covered elsewhere. Let me start by way of introduction. I use HomeAssistant in my own home, and I am a software developer working for Victron Energy. I would like to start working on an integration for the Victron GX-device, most likely through our existing modbus-TCP interface, but potentially also possible through MQTT if that is easier.

Is there any documentation explaining exactly what is required, or possible, for an integration that supports energy management? Or do I just start with an existing project, such as the Fronius one, and use that as an example?

Looking forward to this!

3 Likes