If I have a single grid sensor in kW, which is positive when consuming from the grid, and negative.
At the end of the game I need two daily energy sensors in kWh for grid consumption and grid production, both as positive numbers.
Would the first step be to use the integration sensor to create two distinct sensors : one for production and one for consumption, both positive values) ? If so, I guess I should first start with creating 2 template sensors, based on +/- status of the grid sensor, then integrate each new sensor ?
But then these would integrate for ever. So If I want daily energy counters both for production and consumption, would I finally need to create 2 additional sensors based on the Utility Meter, with a daily cycle ? Or is it possible to reset the integration sensors on a daily basis ?
Everything is working, but I wonder how accurate these integration/utility meter sensors are.
My SolarEdge inverter has, among others, 2 sensors:
sensor.solaredge_solar_power : solar production power, in kW
sensor.solaredge_energy_today : solar energy produced today, in Wh
Both sensors are updated every 10 minutes.
I made an integration sensor based on sensor.solaredge_solar_power called “sensor.solaredge_solar_power_int”, than used that new integration sensor with the Utility Meter sensor to get both a daily (sensor.daily_solar_prod) and a monthly value (sensor.monthly_solar_prod). I wanted to compare this approach with the “energy today” reported directly by the SolarEdge inverter, and the results are very much different:
sensor.solaredge_energy_today : 2529.0 Wh so 2.5 kWh
sensor.daily_solar_prod : 4.607 kWh
How could someone explain such difference between the 2 ? I have no clue if SolarEdge counts the variation in intensity in between data update intervals and that would be the reason for such difference.
Or am I wrongly using the various transpositions, ie going from the invertor kW sensor to an integration kWh sensor than going with it to utility meter sensors ?
If I did it right, then it also means my grid_consume and grid_produce sensors in Wh are worth nothing (they are based on the solaredge power consumption modbus option), and the only way to get proper readings for grid consumption is to have some type of sensor (like a smart meter) that would report directly on energy (Wh or kWh) and where the reported data takes into account any consumption/production event and variation that took place in between the data report intervals.
Do you mean the utility meter sensor is also integrating, so I don’t have to integrate 2 times (first with integration sensor than with utility meter sensor)?
The utility meter does not integrate, what I mean is that you don’t require the integration of sensor.solaredge_solar_power to account energy use. You can use SolarEdge_energy_today and the utility meter will work fine accumulating monthly, yearly, whatever…
I’ve recently installed a Solaredge PV system with the optional modbus power meter which measures your internal consumption.
I’ve got his set up using the built-in HA integration via solaredge web API
Thought it would be good to install this custom card. Like a few others here, and I assume all solaredge users, the built in solaredge sensors don’t conform to the +ve/-ve values for import/export.
Solaredge has:
‘sensor.solaredge_solar_power’ which gives solar production in kW
‘sensor.solaredge_grid_power’ which is the import (+ve) and export (-ve)
in addition, ‘sensor.solaredge_power_consumption’ tells me how much the house is consuming… I FOUND USING THIS ENTITY JUST CONFUSES ALL THE NUMBERS IN THE POWER WHEEL CARD!!
To make this work I needed both export and import to be positive values. To achieve this I created two template sensors, the first to read export and convert it to a positive value, the second to read import.
Export: this looks at ‘sensor.solaredge_grid_power’. if value is -ve (exporting) it converts to positive. if value already +ve it reads 0.
In the ‘sensors’ section of your config.yaml
I’m looking to use this card to replicate my Sense monitor’s Solar ‘wheel’ in HA. Issue is I don’t know if I have the right sensors to use this card.
I have two sensors: First is sensor.energy_production which is my instantaneous solar production measured in watts (provided by my Sense monitor). Second is sensor.energy_usage which is my instantaneous house consumption (from both solar and grid) measured in watts. I don’t have sensors for what I’m pulling from the grid or what I’m exporting to the grid.
Can I use just these two sensors to drive the Power Wheel card? Or do I have to create a value template to do the math required to determine the grid import/export amounts? Is that template as simple as grid_nett = sensor.energy_production - sensor.energy_usage?
With the 2 values you have you will need to create 2 more. the maths is the easy bit, getting the syntax correct can take some trial and error.
Grid usage = house consumption - solar generation (when > 0)
Grid export = solar generation - house consumption
best way to learn is copy someone else’s code and modify to suit your needs.
If you get really stuck I’ll see what I can do to assist
After getting this up and running I went down another track of installing Floorplan ans whilst this is predominantly as the title suggests, it can be used to create any card where you want graphics to change state.
I integrated my own version of the power wheel and have the arrows change direction and colour based on the value.
I’ve got quite a bit more going on but there’s nothing to stop you making a card using floorplan purely for the power wheel.
I assume this Reimann intregral is to get from my current instant Power values to an energy-over-time value? Thanks, I’ll keep it in mind if I decide I want that view.
Sense already provides sensors for solar energy produced and total energy consumed for daily/weekly/monthly/yearly.
Thanks for the response. Looks like you can actually do it with just a single additional template value: Net Grid Export (positive when you’re exporting power to the grid and negative when you’re importing power from the grid). This is the YOUR_GRID_POWER_SENSOR called out in the power wheel github docs. And using the optional grid_power_entity (C) parameter for the lovelace card.
Here’s my code for future readers:
In Sensors.yaml:
- platform: template
sensors:
grid_power_export: # Grid Power Export for Sense Power Wheel
friendly_name: 'Grid power export'
unit_of_measurement: 'W'
value_template: >-
{{ (states("sensor.energy_production") | float | int) - (states("sensor.energy_usage") | float | int) }}
And here’s my Lovelace Manual Card config:
type: 'custom:power-wheel-card'
solar_power_entity: sensor.energy_production # <-- the Sense monitor's sensor
grid_power_entity: sensor.grid_power_export # <-- the template value I created in sensors.yaml
Reminder to install the power wheel card plugin from the HACS marketplace. Also add the module text to your resources section of your lovelace.yaml.
Any idea why HACS requires you to take a 2nd action to add the required module to your lovelace.yaml file? You click the install button, HACs installs, but then it prompts you to click a second button (‘add to lovelace’ or something like that). Why require the two separate actions? Why not just include the ‘add to lovelace’ step in the install process?