The power wheel and power to energy calculation

Hereby the my integration of the HACS Power Wheel and the calculation of the energy (kWh) from the measured solar power.

My first issue was that I only measure the power (kW) of my solar panel I found the following python script.

Energy Python Script (kW to kWh)

I adjusted the number of decimal in the script. Because it is using input_number variable instead of sensor I had to add a automisation to copy the sensor value to the input_number

- id: 'tranfer data solar'
  alias: move solar data
  trigger:
    - platform: state
      entity_id: sensor.solar_pv_power
  action:
    service: input_number.set_value
    data_template:
      entity_id: input_number.solar_power
      value: "{{ states('sensor.solar_pv_power')|float }}"


- alias: Energy Integration Solar
  initial_state: True
  trigger:
    - platform: state
      entity_id: input_number.solar_power
  action:
    service: script.turn_on
    entity_id: script.solarenergy

This resulted in the following pictures :slight_smile:

HA_Energy Distribution

HA_Power distribution

HA_netenergy

HA_nettpowetJPG

2 Likes