Lovelace: Power wheel card

I must be very silly, because I am unable to configure it correctly :frowning:

Hi @DrewXT

I still can’t get it to work.

My Entities of Enphase are:

sensor.envoy_current_energy_consumption
sensor.envoy_current_energy_production

did you create a template based sensor for import / export ?

these are the extra sensors I create - if you don’t have the extra sensors calculated it won’t work

################################################################
#      Solar Stuff                                                                                                     #
################################################################

- platform: template
  sensors:
    grid_power_consumption:
      friendly_name: Grid power consumption
      unit_of_measurement: 'W'
      value_template: >
        {% if states('sensor.net_consumption_now')|int > 0 %}
          {{ states('sensor.net_consumption_now')|int }}
        {% else %}
          0
        {% endif %}

    grid_power_production:
      friendly_name: Grid power production
      unit_of_measurement: 'W'
      value_template: >
        {% if states('sensor.net_consumption_now')|int < 0 %}
          {{ (states('sensor.net_consumption_now')|int|abs )}}
        {% else %}
          0
        {% endif %}

- platform: template
  sensors:
    exporting:
      friendly_name: "Current Energy Exporting"
      value_template: "{{ [0, (states('sensor.envoy_current_energy_production') | int - states('sensor.envoy_current_energy_consumption') | int)] | max }}"
      unit_of_measurement: 'W'
      icon_template: 'mdi:flash'
    importing:
      friendly_name: "Current Energy Importing"
      value_template: "{{ [0, (states('sensor.envoy_current_energy_consumption') | int - states('sensor.envoy_current_energy_production') | int)] | max }}"
      unit_of_measurement: 'W'
      icon_template: 'mdi:flash'

- platform: rest
  name: "Net Consumption Now"
  resource: http://192.168.0.153/production.json
  value_template: '{{ "%.1f" | format(value_json.consumption[1].wNow) }}'
  method: GET
  unit_of_measurement: "W"

- platform: template
  sensors:
    energy_import_export:
      friendly_name: "Energy"
      value_template: "{% if (states('sensor.envoy_current_energy_production') | int - states('sensor.envoy_current_energy_consumption') | int) > 0 %}Exporting{% else %}Importing{% endif %}"
      icon_template: "{% if (states('sensor.envoy_current_energy_production') | int - states('sensor.envoy_current_energy_consumption') | int) > 0 %}mdi:arrow-up-box{% else %}mdi:arrow-down-box{% endif %}"

First of all, thank you very much for helping me further. Am very content with this.

Question, is resource: http://192.168.0.153/production.json the ip address pointing to my Envoy Metered S? and should I change it to my own ip address?

exactly this - I reserve my IP via a DHCP reservation

Dit you find this in the mean time?

Tried to use / config this card, but i can’t figure out which sensor’s i must use where in the card config.
Running the DSMR reader together with the SolarEdge modbus integrations .
I 've got a lot of sensors to choose from :

the card config i’ve tried

type: custom:power-wheel-card
title_power: Power distribution
title_energy: Energy distribution
title_money: Energy costs/savings
solar_power_entity: sensor.solaredge_ac_energy_kwh
grid_power_consumption_entity: sensor.dsmr_reading_electricity_currently_delivered
grid_power_production_entity: sensor.dsmr_reading_electricity_currently_returned
solar_energy_entity: sensor.solaredge_ac_energy_kwh
grid_energy_consumption_entity: sensor.
grid_energy_production_entity: sensor.
energy_price: 0.2
money_unit: €
solar_icon: mdi:white-balance-sunny
grid_icon: mdi:flash
home_icon: mdi:home-assistant
power_decimals: 2
energy_decimals: 2
money_decimals: 0
color_icons: true
consuming_color: '#33ff33'
producing_color: '#dd5500'
initial_view: energy
initial_auto_toggle_view: true
auto_toggle_view_period: 5

But this gives me a lot of Units not equal for all sensors for the energy view. error’s , so something is wrong, and i didn’t know what.
Is there anybody when can help me ?

So, I also still have questions about getting this card working. But what I see from the sensors you have used. The sensor for solar_power_entity: cannot be the same as for solar_energy_entity:For both you are using the sensor sensor.solaredge_ac_energy_kwh. This is not possible.
The rule of thumb which I have seen a few times here, is that for energy a sensor needs to be used the used kWh and for power it is W or kW.

Also when seeing the error Units not equal for all sensors for the energy view.Please check within Home Assistant (on the left side in the menu choose Developer Tools) f the sensor chosen has the equal output (kWH or W/kW).

What Krizzziz says is correct: the unit of measurement should be the same. In this case (simplified): kW is the current energy consumption/production, kWh is the energy consumed/produced in one hour.

The powerwheel shows the current production/consumption, so you should use a kW sensor (or W). In your case, energy production from your solar panels is Solar Edge (AC Power).
For your DSMR I don’t see sensors with UOM kW or W. Can you check if there are others that do?

i think i forgotten to show all the sensors the DSMR intergration shows :

1 Like

That makes sense. The DSMR sensors you should use are sensor.dsmr_reading_electricity_currently_delivered and sensor.dsmr_reading_electricity_currently_returned. It looks like that’s already correct. So if you replace sensor.solaredge_ac_energy_kwh with the correct SolarEdge sensor I mentioned above, you should be good to go.

Please note: the SolarEdge sensor is in W, the others are in kW. You will have to make sure the are all in the same UOM, otherwise it doesn’t make sense. For that, you can make a calculation in configuration.yaml.

For example:

  - platform: template
    sensors:
      powerwheel_solar_production_current:
        friendly_name: 'Powerwheel Solar Current'
        unit_of_measurement: 'kW'
        value_template: "{{ (states('sensor.solaredge_current_power') | float / 1000) | round(3) }}"

Where you should replace sensor.solaredge_current_power with your sensor.

Another tip: try to make the simple version work first (so current production/usage only). This is what your lovelace card would look like:

type: 'custom:power-wheel-card'
title: Opwekking en verbruik
solar_power_entity: sensor.<your solaredge sensor here>
grid_power_production_entity: sensor.dsmr_reading_electricity_currently_returned
grid_power_consumption_entity: sensor.dsmr_reading_electricity_currently_delivered
power_decimals: 3
debug: false

thnx ! So i supose that the sensor.solaredge_energy_today needs recalculation also:

  - platform: template
    sensors:
      powerwheel_solar_production_Engery:
        friendly_name: 'Powerwheel Solar Engery'
        unit_of_measurement: 'kW'
        value_template: "{{ (states('sensor.solaredge_energy_today') | float / 1000) | round(3) }}"

So the card sensors should be something like :thinking:

solar_power_entity: powerwheel_solar_production_current
grid_power_consumption_entity: sensor.dsmr_reading_electricity_currently_delivered
grid_power_production_entity: sensor.dsmr_reading_electricity_currently_returned
solar_energy_entity: powerwheel_solar_production_Engery
grid_energy_consumption_entity: sensor.???
grid_energy_production_entity: sensor.???

where the : grid_energy_consumption_entity should be :sensor.dsmr_day_consumption_electricity_merged ( this also need recalculation because this is kWh )

and the grid_energy_production_entity should be the solar edge sensor : sensor.solaredge_energy_today ( this also need recalculation because this is Wh )

so this is

type: custom:power-wheel-card
title: Opwekking en verbruik
solar_power_entity: powerwheel_solar_production_current
grid_power_production_entity: sensor.dsmr_reading_electricity_currently_returned
grid_power_consumption_entity: sensor.dsmr_reading_electricity_currently_delivered
power_decimals: 3
debug: false

But stil error fout

What happens if you put them in an entities card? And can you try adding them all in your configuration.yaml, to ensure output formatting is the same?

Thank you @gurbyz and guys for great card and all the configs! Managed to made it work, now it’s time to tweak a little bit :slight_smile: Keep up the good work fellas!

wow that looks cool, how can we make this one?

Someone has done it!

Same here!

I finally got round to writing up a little readme for the NewMotion power meter. You can find the repo here: NewMotion Energy Sniffer.

This is a very, very limited description and unfortunately I have no pictures. I’m also hesitant to elaborate the description because I would not want to motivate people with limited knowledge of electronics to start experimenting with this.

(FYI: @duittenb, @Peter_de_Jong)

Hi, I’m using this card and I really love it.
Using it in power view. I have solar entities and grid production/consumtion entities.
The power wheel card nicely calculates the actual power usage in home.

Is this calculated (by your card) “home power usage” … available as a sensor somewhere? So i can use it for historical graphics for example? Would be great. Many thanks and keep up the good work!