If you used your sensor.ioatawatt_solar as solar_power_entity you could add a minus sign in value_template: ‘{{ -value | round(1) }}’ but that would effect your dashboard everywhere where this sensor was used. You also could derive an extra sensor of it and feed that to the card:
@firstof9, you also need this, because your image shows a negative solar power value and the card needs a positive one. Then the card values make more sense and the right arrow starts becoming active.
@Mariusthvdb, also not trying to knowing better here but my energy provider calls me a ‘producer’ when I’m delivering back to the grid. And most of the time I’m a consumer according to them, the grid.
Fact is: half of the world is familiar with A, the other half with B. Half of the world likes to see + and - numbers on the card (perfectly understandable @cjsimmons) and the other half likes positive values with color to show the difference. I can’t serve both worlds or maybe I could, but then the complexity rises (extra parameters, code complexity, etc). And there are already some that say that complexity has risen too far.
This is about energy, not power. (On the power view this couldn’t happen.) There are times during the day that energy produced by your solar panels wasn’t consumed immediately by your house, but ‘produced’ to the grid. This was the case for 0.90 kWh. But sometimes your house was consuming the produced solar energy immediately, which is shown by the 2.76 kWh at the right arrow. Probably your house was consuming even more than your solar panels did produce, because you were consuming from the grid another 17.43 kWh.
(Same goes for the money view where all the energy values are simply multiplied by the (evt. averaged) energy_price).
Currently I’m working on the upgrade to a higher version of lit-element and I will think about the phenomenon of backward counting energy sensors (@firstof9) . And I want to stay away from breaking changes for a while.
exactly, you are of course a producer when you are, as you state correctly, delivering back to the grid. But, that is from the power company’s point of view, and they don’t care if you have true sensors in your HA that are the real producers… and have to make a logical distinction between that sensor, and the returned to grid energy that has taken into account that production and substracted that from the total usage…
and yes, creating a negative value would also be better. right now you choose the third best option I fear. Colors are always customizable, so that could be left to the individual choices.
but hey, its your card…
Thought as much, thanks! but, tbh, can’t imagine that happened yesterday… but will have an extra eye on that to check if this shows the real situation correctly. In an all grey and rainy day, my house almost always consumes more than that tiny fraction of solar power :-((
otoh, if your card shows me that right now, that would be all the more valuable information.
you really should have a look at this thread, talking about insight in power consumption… so cool.
EDIT
also have a look at this graph, which shows tin another way. Export (returning to the grid, production in your card) being the total of the real production minus self consumption.
Ah, then you’re okay with the polarity of the input sensor. Sorry, the arrows don’t start pointing the other way around. They can’t cope with the negative values. In my household the energy consumption of the inverter is part of the (bottom-right) home energy.
I think i’m categorie B, i want too see the grid icon as consuming when the power goes to the grid.
As i only use the power view, i changed line 150 from
Now the color is OK for me. @gurbyz, what about a simple flag invert_grid_color: true ?
Was totally unhappy that the home_power_entity is no more used, as i have a battery.
I’m now using the card twice with the conditional card.
Only changed the solar_power_entity to the battery sensor, and the icon.
If the sun is down and the power comes from the battery, it shows the sun as battery.
First of all thanks for all the great effort. I will get my solar panels in a month and wanted to start with the lovelace configuration before so everything is ready when they arrive. So… I just migrated to HA 0.86.1. And now lovelace is default. I wanted to wait to implement everything until now. However I was able to set this up before but now I started from scratch. If I understand this correct I now press the plus sign in the gui, choose a card to add but as this card is not default I press skip and is presented with an editor. I just do not get the syntax here. Would anyone want to share their code if you are able to edit the card. I wanted to do this in the gui prior to use the raw editor as I am afraid to mess everything up.
Hi @Mariusthvdb Please see the message above your message. It’s the CORS error. It was caused by firebaseapp.com. Maybe they weren’t too happy that everyone switched from unpkg.com to them (because of the ‘localhost issue’ that occurred on the original unpkg.com CDN a while ago.)
It’s fixed in release 0.0.7 yesterday.
That’s part of the changes that lit-element had between version 5.2 and 6.5. In fact, almost all the changes of release 0.0.7 are because of this reason. I have a few major changes of lit-element to go before I get to your suggestion (to include the local version of lit-element).
Should be fine, because the lit-element is taken from the CDN, not from HA itself. It’s independent.
What did you do to update the power-wheel-card to 0.0.7?
your were quicker than I could be deleting my post…
I edited my older card, and have replaced it with your new card now, and it is showing!
thanks.
now that i have your attention
would you consider adding a config option for the font-styles, and especially the central toggle-view one, which now is rather large and bold…
? It seems really out of content with the rest of the Ha style.
I probably can edit the style in the card, but making the a config option would make everyone happy?
I want to switch to a different layout a.s.a.p. Nice big curvy arrows to make it a circle and the ‘wheel’ part of the name starts to make sense. All styling requests are postponed till after that.
But first, the backwards counting energy sensor and the confusing names issue to solve…
Ah yes, but don’t forget power distribution doesn’t always cycle like a wheel… maybe you shouldn’t focus as much on that for layout, especially when batteries are going to be used more in the nearby future. combined with domestic car electricity.
+1 on that
start with ditching the word entity, and the config will become much cleaner… (changed grid_production to grid_return, cause that’s what it is, and solar is the only production entity… in the current setup.
- type: 'custom:power-wheel-card'
title: 'Power distribution'
# Watt units, as in real_time power
solar_power_production: sensor.zp_actuele_opbrengst #production = opbrengst
grid_power: sensor.netto_verbruik
grid_power_consumption: sensor.grid_power_consumption
grid_power_return: sensor.grid_power_return
# kWh units, as in total day energy
solar_energy_production: sensor.solar_energy_production
grid_energy: sensor.grid_energy_total
grid_energy_consumption: sensor.calculated_totaal_dag_afname
grid_energy_return: sensor.calculated_totaal_dag_levering #return = levering
color_icons: true
power_decimals: 2
energy_decimals: 2
energy_price: 0.51
initial_view: energy
hope im not yet again asking a stupid question, but since I updated yesterday to your newest card version, I have this issue in a power returning situation:
as you can see a double minus…
and NaN in the card:
you must have changed the calculations in your CC, because my template is unchanged:
I did change the calculations, but it’s the input sensor that behaves a bit strange. The value probably isn’t parsable as a number. Maybe you could try changing your sensor to this:
grid_power_production:
friendly_name: Grid power production
unit_of_measurement: 'Watt'
value_template: >
{% if states('sensor.netto_verbruik') | float < 0 %}
{{ 0 - states('sensor.netto_verbruik')|float|round(2) }}
{% else %}
0
{% endif %}