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

Thats really nice! Thanks for de update. I ordered it will get it tomorrow.

Got everything running, great! Took me more time to install HACS then your plugin. What is by the way the difference between the l1, l2 and l3 active power readings? And is the active_power_w the total of the three? Need to calculate some actual gas usage from the cumulative and then I am done! I also read out my solar power generated (solar edge API) so I can now also calculate my true home usage.

Really nice to see! Sadly it is not that easy to install HACS… But when you get over that point, it can help a lot with managing custom integrations!

Some meters are connected with 3 phases to the grid. Each phase is measured and exposed with L1, L2 and L3. Active_power_w is indeed the sum of L1, L2 and L3, according to you energy-meter.

Please let me know if you have found something for the gas usage! That would be awesome :v:

Thanks! Will post here if I get the gas reading working

Hi! I got the power usage working via configuration. But i havent gotten the gas to work from the “daily” view. I would rather get it into the configuration. As for the HACS, i cant install if, since im on an older version of Hassio. Wouldnt want to update atm, knowing a lot of repair would be needed, meh!

Help is appreciated! Thanks!

Today I made this lovelance board based on the available API’s. It includes the Gas and electric cost witch you can set with the input select. You can copy / past the code. I’m not a programmer so please feel free to improve and share it.

sensor:
#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: "€"



input_number:
    t2_energy_cost:
      name: Stroom import nomaal
      mode: box
      min: 0
      max: 100
      unit_of_measurement: "€/kWh"
      icon: mdi:currency-eur

    t1_energy_cost:
      name: Stroom import dal
      mode: box
      min: 0
      max: 100
      unit_of_measurement: "€/kWh"
      icon: mdi:currency-eur

    gas_energy_cost:
      name: Gas
      mode: box
      min: 0
      max: 100
      unit_of_measurement: "€/m3"
      icon: mdi:currency-eur

utility_meter:
  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
5 Likes

Have you tried to use the ‘utiility meter’?
https://www.home-assistant.io/integrations/utility_meter/

Hi, thanks for the info.

I tried both the above and the utility meter. the sensor wont display any information.
It stays at 0. For the eletricity it works on all levels.

i have no idea what i could be doing wrong. i’ll try it again tomorrow.
Thanks!

You need to input your tariffs, I think - that’s what the Tarieven card on that Dashboard of @MRO can be used for…

Also - it may take up to a day before the daily use of gas is shown?

What did you use to create that Dashboard? I can’t see how to get that neat arrangement of cards…

I used the card ´Vertical stack´. Its a standard card you can choose while adding a new card.

That’s right. It resets at 00;00 to zero. So when you at the utility meter for the first time you will see the right values the day after. The values correspond to the values in the app ‘Energy’ from HomeWizard. Like to see the € values in the API so we don’t have make this in HA. I will make a request to put this on there roadmap!

Tariffs and history data is managed server-side, so they can’t be exposed via the local API. But I will keep this idea in mind for any future development (can’t promise anything!)

I see. But a API from the server would be nice. That reduces the complexity to the end users a lot and makes it future proof. Thanks for your work! Its a great device and it´s really nice that this is plugin is available in HA!

1 Like

Hallo MRO - thanks very much for the code you supplied for the Lovelace board. I placed it in my Configuration file, and it’s working and the Lovelace components also.

However, my HA OS logs are complaining about the use of entity_id in the Configuration file:

2020-12-03 10:05:37 WARNING (MainThread) [homeassistant.components.template.sensor] The 'entity_id' option is deprecated, please remove it from your configuration

2020-12-03 10:05:37 WARNING (MainThread) [homeassistant.components.template.sensor] The 'entity_id' option is deprecated, please remove it from your configuration

2020-12-03 10:05:37 WARNING (MainThread) [homeassistant.components.template.sensor] The 'entity_id' option is deprecated, please remove it from your configuration

2020-12-03 10:05:37 WARNING (MainThread) [homeassistant.components.template.sensor] The 'entity_id' option is deprecated, please remove it from your configuration

2020-12-03 10:05:37 WARNING (MainThread) [homeassistant.components.template.sensor] The 'entity_id' option is deprecated, please remove it from your configuration

2020-12-03 10:05:37 WARNING (MainThread) [homeassistant.components.template.sensor] The 'entity_id' option is deprecated, please remove it from your configuration

2020-12-03 10:05:37 WARNING (MainThread) [homeassistant.components.template.sensor] The 'entity_id' option is deprecated, please remove it from your configuration

2020-12-03 10:05:37 WARNING (MainThread) [homeassistant.components.template.sensor] The 'entity_id' option is deprecated, please remove it from your configuration

2020-12-03 10:05:37 WARNING (MainThread) [homeassistant.components.template.sensor] The 'entity_id' option is deprecated, please remove it from your configuration

2020-12-03 10:05:37 WARNING (MainThread) [homeassistant.components.template.sensor] The 'entity_id' option is deprecated, please remove it from your configuration

2020-12-03 10:05:37 WARNING (MainThread) [homeassistant.components.template.sensor] The 'entity_id' option is deprecated, please remove it from your configuration

Apparently, a change was made in release 115 of HA to cause this.

I’m not sufficiently skilled in programmer knowledge to know how to correct this. Do you have any suggestions? Thanks.

I tried an experiment of commenting out all the entity_id definitions in the code of the configuration.yaml file. For example:

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

The resulting file passed the validity check, and it seems to be working, with no further warnings being reported …

1 Like

Great work! Using your config with some adjustments.

In the “energy” app i get a nice Gas graph under the day tab. Any idea how to get this graph in HA?

:tada:
I’ve released beta/0.5.0 on HACS. For the daredevils, I will encourage you to try this version! (Please select ‘Show beta versions’ in HACS to see this update)

Changelog
Please read the actual release notes before updating!

  • Support for auto discovery.
  • Make use of external library for the actual communication (which makes this integration more maintenance friendly).
4 Likes

You can use the mini graph addon for this.

I put your code in my configuration.
The only thing I get working is the live wattage:

What am I doing wrong :slight_smile: