Lovelace: Power wheel card

Hi @robi Please see the consuming and producing from the perspective of your home. It’s your home that’s producing to the grid or consuming from the grid. In this way also all the consuming colors and producing colors match intuitively to costing money resp. earning money.

But you’re not alone. It has been mentioned before. :wink:

1 Like

Yeah! It’s me! :rofl:

@robi, i edit the .js file after every release of the card.
If you’re interested, i’m doing this only for the power view.

Search the line

this.data.grid = this._makePositionObject(this.data.grid.val, this.config.grid_power_entity, this.config.grid_icon,
          'mdi:transmission-tower', this.config.power_decimals);

and add a ‘-’ before this.data.grid.val

this.data.grid = this._makePositionObject(-this.data.grid.val, this.config.grid_power_entity, this.config.grid_icon,
          'mdi:transmission-tower', this.config.power_decimals);

Auswahl_321

You can’t do this if you’re using HACS for the card. You need to install it manually!

Hi!
That’s a wrong perspective given the current appearance and design of the card. If the solar panel and the home wold graphically grouped somehow to suggest that they represent together the home, I would accept this sight.

But I see the system composed of 3 separate units: grid, solar panels, home. These are completely independent from each other. Correspondingly the icons also appear this way. The arrows already show correctly the direction where power travels, the correct engineering approach is to also color the icons accordingly.

I agree that in the money view it is correct as you wrote, thus the current coloring scheme should apply only there. But in the power/energy view it should be from engineering perspective.

This is how it appears in Fronius SolarWeb (with the dots moving animated according to the arrows here):
kép
This reflects also the engineering perspective, emphasizing more on the system components (the solar panel and the inverter/smartmeter shown as separate units).

Thanks a million. I will also edit this each time. It also works if it’s within HACS if you delete the js.gz.

I suggest to make this option configurable so that anyone can choose the perspective they want.

1 Like

Yes, I remember a ‘half of the world’ discussion. :rofl: It’s almost a cultural thing, the way people look at producing and consuming. @robi also has a point in his engineering view. So, let’s introduce a flag for this kind of driving left or right side of the road thing. :wink:

@VDRainer and @robi if I would implement the suggestion of the invert_grid_color flag that @VDRainer did earlier, would that be only for the power view? I see @VDRainer changes the code in this way, but in the response of @robi I see he’s wanting it for energy view also. (I feel like the energy view and money view should behave the same).

1 Like

You have to store the midnight values. That can be done with the input_number.

input_number:
  grid_energy_consumption_midnight:
    name: "Grid energy consumption 00:00"
    min: 0
    max: 999999
    mode: box
    unit_of_measurement: 'kWh'
    icon: mdi:flash-circle

When you have an automation that triggers at midnight, the input_number can get its value. (So you have to wait a day before you see the effect the first time.)

automation:
  - alias: set_energy_midnight
    trigger:
      - platform: time
        at: '00:00:00'
    action:
      - service: input_number.set_value
        data_template:
          entity_id: input_number.grid_energy_consumption_midnight
          value: >-
            {{ states("sensor.grid_energy_consumption") }}

Then you can make the special sensor for the amount of energy that is consumed since midnight:

sensor:
  - platform: template
    sensors:
      grid_energy_consumption_today:
        friendly_name: 'Grid energy consumption today'
        unit_of_measurement: 'kWh'
        value_template: >-
          {{ (states("sensor.grid_energy_consumption") | float - states("input_number.grid_energy_consumption_midnight") | float) | round(3) }}

In the card setup you have to use this new sensor:

grid_energy_consumption_entity: sensor.grid_energy_consumption_today

Of course you have to repeat this for grid_energy_production and solar_production. You would end up with 3 times an input_number for this and 3 actions in the automation and 3 template sensors.

This is the DIY way, but there’s also an integration in home assistant that can be of help here: utility meter.

:pray:
Thanks so much @gurbyz.
I’m using only the power view (at the moment) but i think it would be great to have this flag on every view.

+1 for both the power and energy view.
Thank you.

Version 0.1.1

New features

  • Custom color for active arrows. New card parameter active_arrow_color.
  • Invert grid icon coloring for consuming/producing. New card parameter invert_grid_colors. Default false.

Fixes

  • Provisional fix for icon sizes (as of HA 0.110.0). Issue #48.
1 Like

Hi Gerben,

Must confess I am somewhat confused by the requirements you describe in the documentation, and the accompanying config example…

please let me ask, if my config, which seems to work alright, is according to specs:

solar_power_entity: sensor.zp_actuele_opbrengst
solar_energy_entity: sensor.solar_energy_entity

grid_power_entity: sensor.netto_verbruik
grid_power_consumption_entity: sensor.grid_power_consumption
grid_power_production_entity: sensor.grid_power_production

grid_energy_entity: sensor.grid_energy_total
grid_energy_consumption_entity: sensor.calculated_totaal_dag_afname
grid_energy_production_entity: sensor.calculated_totaal_dag_levering

especially the bit about the grid_power_entity and the consumption and production entities.
thanks if you could double check!

Does anyone have the correct settings for the card with a Solax Inverter? Mine is currently set as:

battery_power_entity: sensor.solax_battery_power
battery_soc_entity: sensor.solax_battery_capacity
grid_power_entity: sensor.solax_measured_power
solar_power_entity: sensor.solax_pv_total_power
title: TOCK Power Usage
type: 'custom:power-wheel-card'

and seems to work as I get the following card

image

Just wanted to check my settings are right?

However, the reason I ask is that my inverter also has an sensor.solax_inverter_power that is the actual consumption of the house but when I change to

battery_power_entity: sensor.solax_battery_power
battery_soc_entity: sensor.solax_battery_capacity
grid_power_consumption_entity: sensor.solax_inverter_power
grid_power_production_entity: sensor.solax_measured_power
solar_power_entity: sensor.solax_pv_total_power
title: TOCK Power Usage 2
type: 'custom:power-wheel-card'

image
the calculations seem completley wrong

I know battery is currently beta so maybe thats a bug messing up the calculations?

Here are the actual inverter readings
image

Maybe it me just using the wrong sensor for consumption

Your grid_power_consumption_entity will be from a meter connected to the mains where the electrical grid connects to your home. This would measure your import/export of power.

Thanks

My inverter has a built in CT clamp and is the sensor.solax_measured_power and shows this as a single + or - figure based

As you can see, using the “single” grid power entity matches up the readings I am getting direct from the inverter

So, basically as I dont actually have a consumption & production sensor, I should stay with the single sensor setup and wont work unless I actuall have two, one for consumption and one for production only, not a combined one

Split your +/- to consumption/production (or vice versa). The meter I have on my mains does + for importing from the grid (consumption) and - for exporting (production). I just split them with a template sensor.

Hi Marius,

Normally you would use

grid_*_entity

OR

the combination of grid_*_consumption_entity and grid_*_production_entity

depending on having your sensors split or not. So normally you wouldn’t use all 3 of them together. 99% of the users can stop reading here.

There is one exception if you don’t want the same grid icon for all 3 views of the card (power/energy/money view) or even want a dynamically changing icon based on events you want to define by yourself. For normal use, if you want the same grid icon for all 3 views, you can use grid_icon to change to anything other than the default icon.

If you want more than that (and I remember vaguely you were one of the users that especially asked for this feature :smiley: ) the card uses the icon of e.g. grid_power_entity if it’s there. And if you belong to the happy few that is able to dynamically change this icon, the icon on the card will change accordingly. To serve this feature for both types of input parameter sets (see top of this message, the two choices), some people will end up with 3 sensors for power and possible 3 sensors also for energy.

I think that’s the reason you use all 3 of the parameters two times.

2 Likes

Thank you for the new active_arrow_color card parameter.

1 Like

Was thinking of creating a template sensor

Can you post what you have as a template?

Cheers

Sure thing:

...
    # Power Sensor Templates
    grid_power_consumption:
      friendly_name: 'Grid power consumption'
      unit_of_measurement: 'W'
      value_template: >-
        {% if states('sensor.power_meter_power')|float > 0 %}
          {{ states('sensor.power_meter_power')|float | round(2) }}  
        {% else %}
          0
        {% endif %}
    grid_power_production:
      friendly_name: 'Grid power production'
      unit_of_measurement: 'W'
      value_template: >-
        {% if states('sensor.power_meter_power')|float < 0 %}
          {{ (-1 * (states('sensor.power_meter_power')|float)) | round(2) }}  
        {% else %}
          0
        {% endif %}   
    solar_power_production:
      friendly_name: 'Solar power production'
      unit_of_measurement: 'W'
      value_template: >-
        {% if states('sensor.emoncms_solar')|float > 0 %}
          {{ states('sensor.emoncms_solar')|float | round(2) }}  
        {% else %}
          0
        {% endif %} 

That last one is because my inverter uses about 10-15W of power at night so I just trim that to 0 as far as production goes.

Cheers Mate

1 Like

i upgraded to ha 0.110.0 and i notice the icons are much smaller … is there a way to increase the size? i’m using the latest version of power-wheel