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?
Anyo9ne having trouble with the production is positive value? I used to have ‘false’, but this is now changed to ‘1’. When I try to change it to negative 1 or 0 or 2 (trying to work out the false equivalent) it keeps reverting to 1 on save?
Hi everyone,
first thank you for your work!
I’d like to use this card but have a (noob) question about grid power production.
The solar power production sensor is retrieved by a PZEM-004 installed at the exit of my solar system.
The grid power consumption sensor is retrieved by a PZEM-004 installed at the exit of the energy meter.
How can I retrieve values for grid power production? Do I need a 3rd PZEM-004?
Thank you,
SoL
Hi SoL, does the PZEM-004 also gives you the direction of how the power is flowing? E.g. by giving a negative or a positive value of the power? Because otherwise you don’t know if you are measuring consumption (import) or production (export) at “the exit of the energy meter”.
On 0.106.0, I’m seeing originally working card now showing as:
“production_is_positive” is read-only
Delete production_is_positive: true gives me:
can’t define property “production_is_positive”: Object is not extensible
Has 0.106 changed anything that would break this custom card? The 0.106 blog post does link to here, but I can’t see anything that might cause this error.
I am on latest version, 0.0.16, managed by HACS and hadn’t touched it after upgrade HA to 0.106. Inspired by your issue report on possible download problems, I pressed Reinstall in HACS and the card started to work after a refresh.