HomeWizard Energy (Wi-Fi P1 meter, kWh meter, Energy Socket and Water Meter)

Have you set your tariffs? They are zero out of the box.

A i see. :slight_smile: My bad.
How do i need to fill it in? my power costs: €0.19 cent per KW.

i have tried is as: 0,19 and also as 0.19 but i get errors in the config.

I just added a Lovelace card for the energy costs and input the values there. I followed the example shown in MRO’s screenshot here:

1 Like

I think I will release the current beta soon, so I’ve a question for the beta testers: Did/do you had/have any problems with installing, configuring and/or using this integration (beta/0.5)? Also: are there any errors/warnings in the HA log?

When so, please let me know! :v:

Havent got the time to test it yet, sorry.

My recorder records to a MySQL database, and i’ve created the following SQL sensor to get the last value of a specific month. This way you can gather monthly usage and show it in HA. There would be better ways to do this, but it is something.

  - platform: sql
    db_url: !secret db_mysql
    queries:
      - name: sql_kwh_maandelijks_december
        query: "SELECT * FROM states WHERE entity_id = 'sensor.energy_import_total_maandelijks_kwh' AND state != 'unknown' AND DATE(created) = LAST_DAY('2020-12-1') ORDER BY state DESC LIMIT 1;"
        column: 'state'
        unit_of_measurement: kWh

I copied the whole code to my config, but al the sensors that where created stays at 0.
any idea whay i am doing wrong?

You should check if all the sensors and utility meters are created, with the right corresponding names. You also need to fill in the tarifs.

Well, i’ve been busy with my dashboard. Much code and sensors, so not really efficiënt yet. But i wanted to get a overview of monthly usage and costs so i did that by creating SQL sensors with the example i have given in one of my previous posts.
Still a work in progress…

8 Likes

Great ! Got this working and very easy to use !

1 Like

Thank you for the good work.
Will the Kwh meter be included in future releases ?

The kWh meter currently has no API. HomeWizard has promised that they are working on that.

When the API is available, I will off course add support for the kWh meter :v:!

2 Likes

Due to the change in the setup flow (from manual to Discovery), I had to change some internal stuff. These changes made the it that the old configuration was not usable.

But… I have added a ‘migration’ method so upgrading without losing data should be possible. This fix is added in Release 0.5.0-beta-6. Anyone want to test this to see if there are (breaking) issues that I’ve missed during testing? To help me:

  • Have version 0.4.2 installed and working
  • Update to 0.5.0-beta-6
  • Restart Home Assistant and check if the integration works as expected
1 Like

Installed it with HACS, all ok , no issues after reboot…

1 Like

Like to test this. How can I update to the beta? Just delete the custom component and reinstall with the beta files? I like to keep the history.

Do you make use of HACS? Then you can simply select ‘re-install’ and then ‘show beta versions’. Otherwise just replace the files indeed.

But, if you want to make sure you keep your history, don’t install the beta. It’s called beta because I want to make sure nothing gets deleted after installation!

I tried to use your code but I have my config split up.
No errors, but unfortunately it does not show the cost. (al sensors stay zero)
Under integrations I have a sensors.yaml file with :

sensor: !include_dir_merge_list ../entities/sensors

and a utility_meters.yaml with:

utility_meter: !include_dir_merge_named ../entities/utility_meters

I made a homewizard.yaml file in the \entities\sensors\ folder containing:

#Export electra
  - platform: template
    sensors:
      energy_export_t2_dagelijks_eur:
        friendly_name: 'Opbrengsten vandaag nomaal tarief (T2)'
        value_template: "{{ (states('sensor.energy_export_t2_dagelijks')|float * states('input_number.t2_energy_cost')|float)|round(2) }}"
        unit_of_measurement: "€"

  - platform: template
    sensors:
      energy_export_t1_dagelijks_eur:
        friendly_name: 'Opbrengsten vandaag dal tarief (T1)'
        value_template: "{{ (states('sensor.energy_export_t1_dagelijks')|float * states('input_number.t1_energy_cost')|float)|round(2) }}"
        unit_of_measurement: "€"

  - platform: template
    sensors:
      energy_export_total_dagelijks_eur:
        friendly_name: 'Opbrengsten export vandaag dal + normaal'
        value_template: "{{ (states('sensor.energy_export_t2_dagelijks_eur')|float + states('sensor.energy_export_t1_dagelijks_eur')|float)|round(2) }}"
        unit_of_measurement: "€"

  - platform: template
    sensors:
      energy_export_total_dagelijks_kwh:
        friendly_name: 'kWh export vandaag dal + normaal'
        value_template: "{{ (states('sensor.energy_export_t2_dagelijks_eur')|float + states('sensor.energy_export_t1_dagelijks_eur')|float)|round(2) }}"
        unit_of_measurement: "kWh"
          
#import electra 
  - platform: template
    sensors:
      energy_import_t2_dagelijks_eur:
        friendly_name: 'Kosten import vandaag nomaal tarief (T2)'
        value_template: "{{ (states('sensor.energy_import_t2_dagelijks')|float * states('input_number.t2_energy_cost')|float)|round(2) }}"
        unit_of_measurement: "€"

  - platform: template
    sensors:
      energy_import_t1_dagelijks_eur:
        friendly_name: 'Kosten import vandaag dal tarief (T1)'
        value_template: "{{ (states('sensor.energy_import_t1_dagelijks')|float * states('input_number.t1_energy_cost')|float)|round(2) }}"
        unit_of_measurement: "€"

  - platform: template
    sensors:
      energy_import_total_dagelijks_eur:
        friendly_name: 'Kosten import vandaag dal + normaal'
        value_template: "{{ (states('sensor.energy_import_t2_dagelijks_eur')|float + states('sensor.energy_import_t1_dagelijks_eur')|float)|round(2) }}"
        unit_of_measurement: "€"

  - platform: template
    sensors:
      energy_import_total_dagelijks_kwh:
        friendly_name: 'kWh import vandaag dal + normaal'
        value_template: "{{ (states('sensor.energy_import_t1_dagelijks')|float + states('sensor.energy_import_t2_dagelijks')|float)|round(2) }}"
        unit_of_measurement: "kWh"

#Netto electra (kosten - opbrengsten) Bij teruggave zal er '-' zichtbaar zijn
  - platform: template
    sensors:
      energy_total_dagelijks_eur:
        friendly_name: 'Kosten vandaag electra'
        value_template: "{{ (states('sensor.energy_import_total_dagelijks_eur')|float - states('sensor.energy_export_total_dagelijks_eur')|float)|round(2) }}"
        unit_of_measurement: "€"


#import gas
  - platform: template
    sensors:
      energy_gass_eur:
        friendly_name: 'Kosten vandaag gas'
        value_template: "{{ (states('sensor.energy_gas_dagelijks')|float * states('input_number.gas_energy_cost')|float)|round(2) }}"
        unit_of_measurement: "€"

#Totale netto kosten (Gas + electra)
  - platform: template
    sensors:
      energy_gas_en_elektriciteit_eur:
        friendly_name: 'Totale netto kosten energie'
        value_template: "{{ (states('sensor.energy_gass_eur')|float + states('sensor.energy_total_dagelijks_eur')|float)|round(2) }}"
        unit_of_measurement: "€"

In the file \entities\utility_meters\homewizard.yaml

energy_import_t2_dagelijks:
  source: sensor.p1_meter_total_power_import_t2_kwh
  cycle: daily

energy_import_t1_dagelijks:
  source: sensor.p1_meter_total_power_import_t1_kwh
  cycle: daily

energy_export_t2_dagelijks:
  source: sensor.p1_meter_total_power_export_t2_kwh
  cycle: daily

energy_export_t1_dagelijks:
  source: sensor.p1_meter_total_power_export_t1_kwh
  cycle: daily

energy_gas_dagelijks:
  source: sensor.p1_meter_total_gas_m3
  cycle: daily  

And I created the input_number entities with ‘helpers’
Can someone tell me what I do wrong ?
(I have the ‘tarieven’ filled in)

If I’m correct you need to remove kwh from the utility meters

sensor.p1_meter_total_power_import_t2_kwh your sensor should be sensor.p1_meter_total_power_import_t2 in HA

1 Like

Hi guys,

Anyone else having the same problem? I removed it & installed it again. Also rebooted my router but the connection is still failing. It works fine for weeks

  • Which version are you using? (HA and the integration)
  • Can you still reach your P1 meter? (From app and <ip>/api/v1/data)
  • Do you see anything in the log? You also can turn on the ‘debug’ level in logger.