Lovelace: Power wheel card

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.

Hi Gurbyz, thanks so much for your quick reply, I am quite new into Home-assistant and need to find out how to manually install from Github, didn’t find a description, maybe you can give me a hint.
Thanks

It’s doable but can be tricky. Nowadays everybody uses HACS, but you can find the old way to install a custom component in the readme file.

Ok thanks, I will try with the readme today.

Not sure why you would say installing manually is tricky.

As long as people get the Raw version of the resource it’s easy-peasy.

Especially compared to the confusion HACS regularly sees on this community forum.

That’s a good point, Marius: use the raw file (or use wget).

There are some more “as long as…” things to my opinion. :smiley: Choosing the right branch (dev, in this case). Having a way to put the file on the filesystem (for hassio the samba share plugin is an option). Having a folder there (maybe not reusing the folder that HACS uses? using the ssh plugin?). Get the folder permissions right. Don’t mess it up with the HACS version of the card that’s already installed (uninstall it?). And of course find your way around caching issues that will arise (use the ?v=<a number> parameter is a good start, but don’t forget to alter it when putting a new file in place).

Maybe not “tricky”, but all together it has some pitfalls. Especially for people who are “quite new to home assistant” as dietlman says. But there is always the help from the community. So don’t hesitate to start with all this fun stuff!

Speaking of that: since I’m away for the next few weeks, I won’t be able to respond or help.

granted.
still you make it sound much more difficult than it really is. And, lest not forget, it seems issues with cache, branches and versions are more abundant with HACS than with manual downloading.

I’d even dare to say if people get around installing HACS, they’re most certainly up to maintaining a small resources.yaml file and refreshing after updating the latest version :wink:

but, as always, your mileage may vary.
cheers, and have a good few weeks!

1 Like

Version 0.1.0 is released.

Here’s a relevant part of the README.md file:

BETA battery feature in power view

Battery support in the power-wheel-card is currently a BETA feature.
Many people asked for it and many people helped during development. Thx!

What does BETA for battery support mean: expect issues! There are known and unknown issues to be solved. The values and arrows don’t show correctly all the time. Expect things that work now will break in future changes of this feature.

If you want to use the BETA battery feature in the power view:

  1. Comply to all the requirements of the power view first.
  2. Supply the card parameter battery_power_entity.
    • The sensor state value should be a positive number when the battery is charging.
    • The sensor state value should be a negative number when the battery is discharging.
  3. Supply the card parameter battery_soc_entity.

Known issues for the battery feature

For now battery support is implemented with a set of rules in mind. The ruleset is very basic and not complete.

  1. Solar power is consumed by home first.
  2. What’s left of solar power (after home did consume) is used for charging the battery.
  3. What’s left of solar power (after home and battery did consume) is produced to the grid.

I think that the ruleset can be extended but possibly only by supplying an extra input parameter to the card. This is the point where extra rules have to take in account the behaviour of the battery depending on the state of charge. Possibly this behaviour is dynamic and not depending on a strict threshold of the SoC. And possibly the extra rules differ per battery make. Because I don’t own a battery myself, further implementation gets a bit more difficult. I will watch recent and future issue reports to make changes.

For now battery support is implemented in the current layout grid. This is why the battery shows up in two different places and is visible only when in use. This however should be temporary.
First priority is to get all the values and arrows right and improve later. If it functionally works with a battery completely, then it’s time to change the layout into a better interface. Many suggestions for the final UI have been given.

Changelog version 0.1.0

New features

  • BETA. Basic support for a battery in the power view.
    • New card parameter battery_power_entity. Charging should have positive values.
    • New card parameter battery_soc_entity to display the state of charge.
    • New card parameter battery_icon to override the default icon.

Improvements

  • Total rebuild of the core functions.
  • Moved from web-components-tester to Karma.
  • DEPRECATED. Visual warning if still using card parameter energy_price which is deprecated since version 0.0.13. Please replace energy_price by energy_consumption_rate in your setup.
  • Log version to console also when not in debug mode.

Fixes

  • Number of decimals can be set to zero in energy view and money view. Issue #39.

Love the card, absolute love it. I worked like a charm out of the box for me, thanks much.

My suggestion for further improvement: Is it possible to provide instructions on how to create the energy sensors that have daily eneger (produced, consumed) ?

This is particularly interesting as the power view on my end is somewhat inacurrate as my solar system (SolarEdge) is only providing 10 min. average Solar power values. My grid meter Consumption and Production sensors are showing 10 second values.

For the Energy view this short term inaccuracy is not an issue. However I would not know how to convert my actual 10 second values into cummulative energy since last midnight. That would make it perfect!

Did I already say that I love the card :wink:

Great card, thank you.

Regarding the icon colors, I think the grid icon color is not quite correct.
There’s a consuming_color and a producing_color, but for the grid icon, it applies wrongly:

When the PV system produces more than the house needs, extra power feeds into the grid. In this case, grid icon color should be consuming, not producing. So the house icon and the grid color should be the same consuming_color, as both are drawing power from the PV system.
And vice-versa: when the house needs more power than the PV system can give, the grid icon should be producing color. In this case the PV icon and the grid icon should be both producing_color, since house draws power from both sources.

Any place where I should look to fix this?