Lovelace: Power wheel card

I’ve started using this again now that it works better with my setup. There are 2 things that are bugging me.

  1. On the energy view, is it possible to hide the value under the grid icon? For me this is useless and is the difference between what I export and what I’ve used. So if I’ve exported 10kWh, and used 7kWh, it will show 3kWh. This is totally useless and pointless to me.

  2. On the money view, is it possible to have different rates for importing and exporting power? I pay 24.22cents per kWh used and earn 12.7cents per kWh I send back to the grid.

Thanks. :slight_smile:

Thanks for your feature requests.

< :wink: > O, no, that could be the most important value on the card. It’s our footprint on earth. It’s the net energy we consume. It’s the number we should all decrease. You almost make me want to implement a blinking value here. < / :wink: > But, no kidding, I don’t want to hide this value, because adding up these values is exactly what the card is meant for.

Yeah. That’s a good one. But then I have to solve a design question first. Let’s say you have energy values E1, E2 and E3 like in the image:
Home_Assistant%202
And you have ‘cp’ for the prize you earn for producing to the grid (exporting). And you have cc for the prize you pay for consuming from the grid (importing).

Then the question: how would one value the part of the solar energy that’s directly consumed in ones house (and not exported to the grid), the c... in the image. Should it be cc or cp?
Home_Assistant

Should it be cc because that’s the prize you otherwise had to pay for it when you didn’t have solar panels or when there wasn’t enough sun?

  1. ok. That makes sense. Never looked at it like that before.

  2. Personally I’d like to see the solar that’s consumed by the house to have the same value as what I’d otherwise pay if from the grid. That way I’d see how much I’ve saved. So it should be cp.

i have the sensors now polling from emoncms so it should be updating all at the same time.
but still i have:
image
probably the problem of the 1W difference?

Update:
test my theory but still:
image

Update 2:

Hi. You must have missed one of the requirements for the power view for the solar sensor: The sensor state value should be a positive number when producing power. I think yours has a negative value when producing power (-2221.17W). Are you familiar with creating template sensors? You could make an extra sensor by e.g.:

sensor:
  solar_power:
    friendly_name: Solar power
    unit_of_measurement: 'Watt'
    value_template: >-
      {{ 0 - states('sensor.emoncms2_solar') | float }}

Then you can use this sensor instead of the emoncms2_solar as input for the card.

Same for your grid_production sensor. The requirements are here if you want to read them again.

I hope you made a typo there. Based on your explanation, it think you meant cc: the rate you otherwise should have payed for importing/consuming the energy from the grid.

But I like your explanation and have put it in the 0.0.13-dev version. Maybe you can check it out on the dev branch and use the new card parameters energy_consumption_rate (‘import’ in your words) and energy_production_rate (‘export’ in your words). Please look into the readme of the dev branch to see further explanation. You can search for the word rate.

haha, yep. my bad.

Just looked at the 0.0.13-dev. Seems to work very well. Lines up almost perfectly with the rates I have on pvoutput.org. The only difference is that I have a daily supply charge that your card doesn’t take into account. Other than that, this is perfect.

Version 0.0.13 has been released

Deprecation warning. Please replace energy_price by energy_consumption_rate in your setup when you use it.

Issue with the card? Please use the bug report of GitHub after reading the wiki to check what you can do before reporting a bug .

New features

  • Split energy rates for consuming from the grid and producing to the grid.
    • Use new card parameters energy_consumption_rate and optional energy_production_rate.
    • DEPRECATED. Current card parameter energy_price is deprecated and its value will be used as value for energy_consumption_rate for a while.
      Please replace energy_price by energy_consumption_rate in your setup.

Improvements

  • Hide values near arrows in more cases.
  • Code improvements.

getting back to trying this card, after having updated hA to 91.2: is there something in the HA versions that blocks the card?
I have the exact same config with the same version card and all identical sensors, and it shows correctly in HA 84.3 while I get the famous red card in 91.2…

still using version 09 dev (had 013 installed but thought that version bump caused the error. apparently not)

----update—

forget my post above, it was this Lovelace: Power wheel card I had forgotten about…

Just a thank you for this, working great with my Smappee which sends usage data over MQTT every second.

1 Like

How do I get mine to work like yours Gadgetuk
Both sides of solar

Here’s my config, I’ve got CT’s on the main incomer to the house, and the feed from the solar panels as shown in the diagram below.

  - cards:
  - type: 'custom:power-wheel-card'
    grid_power_entity: sensor.smapppower_house_power
    production_is_positive: false
    solar_power_entity: sensor.smapppower_solar_power
    title: Power

GridMetering

What sensor do you have for grid_power_production_entity? I see it starts with sensor.sola... and that makes me think you’re using a sensor of your solar panels there. It should be a sensor of your grid.
It depends if you have one sensor for your grid or 2. Pls read the readme where it says ‘requirements for the power view, point 2’. There is some explanation about these two situations. Which situation do you have? i or ii?

EDIT: You can compare your config with the one of @GadgetUK. You are configuring like 2ii and he is like 2i for the power view.

So I could make a template sensor that is what my house is using minus the solar to get the same reading you get for grid_power_entitity:
And then just use my solar sensor for solar_power_entitity: and use your config?
Does your grid sensor see the solar power as well ? Making it go minus ?
I have seperate sensors for every plug in my house and then a sensor for the solar

views:

  • id: example_view
    cards:

    • type: custom:power-wheel-card
      title_power: “Current Watts”
      title_energy: “KWH Today”
      title_money: “Energy costs/savings”
      solar_power_entity: sensor.solar_power
      grid_power_consumption_entity: sensor.grid_power_consumption
      grid_power_production_entity: sensor.solar_power
      solar_energy_entity: sensor.solar_kw_today
      grid_energy_consumption_entity: sensor.grid_energy_consumption
      grid_energy_production_entity: sensor.solar_kw_today

    solar_power:
    friendly_name: ‘Solar power production’
    unit_of_measurement: ‘W’
    value_template: >-
    {{ states.switch.solar.attributes[“current_power_w”] | replace(" W", “”) | float }}
    grid_power_consumption:
    friendly_name: ‘Grid power consumption’
    unit_of_measurement: ‘W’
    value_template: >-
    {{ (states.switch.theatre_ac.attributes[“current_power_w”] | replace(" W", “”) | float +
    (states.switch.ups.attributes[“current_power_w”] | replace(" W", “”) | float) +
    (states.switch.theatre_fridge.attributes[“current_power_w”] | replace(" W", “”) | float) +
    (states(“sensor.laundry_pow_power”) | float)) }}
    grid_power_production:
    friendly_name: ‘Grid power production’
    unit_of_measurement: ‘W’
    value_template: >-
    {{ states.switch.solar.attributes[“current_power_w”] | replace(" W", “”) | float }}
    grid_energy_consumption:
    friendly_name: ‘Grid energy consumption’
    unit_of_measurement: ‘kW’
    value_template: >-
    {{ (states.switch.theatre_ac.attributes[“today_energy_kwh”] | replace(" kW", “”) | float +
    (states.switch.ups.attributes[“today_energy_kwh”] | replace(" kW", “”) | float) +
    (states.switch.theatre_fridge.attributes[“today_energy_kwh”] | replace(" kW", “”) | float) +
    (states(“sensor.laundry_pow_kwh_today”) | float)) }}

Let’s do this step by step. About the requirements for the power view, please see my question a few messages up:

Could you answer this?

There’s also a list in the same readme of all the features of the card. I got the feeling that you’re expecting the card to have other features than available. E.g. this feature of the card:

  • Calculates the current power that your home is consuming: home power. Input for the calculation is the power that your solar panels produce and the power consumed from and produced to the grid.

So the card calculates the home power. You seem to have that value available and want to use it as input, but it’s output of the card.

If you want to use the card, you should have a sensor somewhere near the point the power line is entering your house. So people use a Smart Meter for that. (Common in the Netherlands). Other people put sensors around power cables. That could also work as grid sensor.

Another remark: please take notice of the big animated gif in the header of every topic in this forum. It will help you formatting your code properly when you copy something into a message on this forum.

I’m using 2i

I don’t have a clamp on my grid but could I create a sensor that is my house power consumption munis solar which in term would be the same reading you would get for

Sorry I’m learning :slight_smile: