Lovelace: Power wheel card

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?

Use the integration integration to create kWh sensors for the card.

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.

1 Like

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.

Check this out:
Created something you might want to use:

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.

HACS does that for you :slight_smile:

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?

You’d have to ask leedus about his design decisions. :slight_smile:

1 Like

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”.

Hi Gurbyz, thank you for your answer.
I have exactly this schema in my grid setup:


The value of the power is always positive.
SoL

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.

Likely the change has broken the card.

Are you on the latest version?
No problems here with 0.106.0.

EDIT: I tested it! :upside_down_face:

2 Likes

Fixed! Thank you.

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.

1 Like

Yeah! That’s a HACS issue, but fixed i latest beta.
This is the only card i don’t use with HACS, because i always edit the js after an update to invert the color of the grid icon and @gurbyz will not implement this. :stuck_out_tongue:

Hi All!
I have a fronius inverter and a battery as well. Does anybody have a configuration to use with Power wheel card adopted to also show the battery and add figures for the battery like charge_level and so on?
@gurbyz maybe you can help with this and extend the Power wheel card and add a battery to the card?
Would be really nice to find a nice solution for that purpose.
thanks!

Hi Dietlman, there is a feature request for adding a battery here were we try out some things already. It’s not part of the distributed versions yet. And it’s not fully functional yet. Especially soms edge cases are missing. And layout is far from final.