[Custom Component] HomeWizard Energy (Wifi P1 meter)

So, the Dutch company HomeWizard has introduced a device that plugs into the P1 port of a DSMR Smart Meter (mostly used by in The Netherlands). I work for this company and am highly involved in the development of this product.

The P1 meter is about €30 and can be used with the HomeWizard Energy app. This week we released a new firmware version which enables a local API.

UPDATE
I created an initial version for the custom component. Let me now what you think! I updated this post so it’s clear how to configure your HASS installation with this component. This component is available in HACS!
See: HomeWizard Energy - Custom Component on Github

Another update
HomeWizard released the public API for the HomeWizard kWh meter. You can use this integration to import data from the kWh meter directly into Home Assistant

My Home Assistant installation is not near my meter, so I wasn’t be able to use a serial cable with the default DSMR integration. I my own time I am working to get the P1 meter integrated into HASS. I have started to create a custom component to make it easier. This component is available at Github.

Please let me know what you think! If you have any ideas or feedback for this component, don’t hesitate to make any suggestions! If you find any bugs, please let me now.

Installation

  1. Install ‘HomeWizard Energy’ from HACS > integrations.
  2. Restart your HASS installation.
  3. Your device is discovered by Home Assistant, you can now configure it from the Integrations page

If your device is not discovered, try:

  1. Install ‘HomeWizard Energy’ from HACS > integrations.
  2. Restart your HASS installation.
  3. Goto configuration > Integrations (<hass_ip>:8123/config/integrations) add HomeWizard Energy.
  4. Search for ‘HomeWizard Energy’ and select this integration. When you can’t find it, refresh this page or check if you have the most recent version.
  5. Enter the IP address of your dongle. (You can test if this is the correct IP by going to http://<ip_address>/api/v1/data in your browser. You should get a JSON response.
  6. You are done! Now you can use this component to create graphs, automate things and collect data.

My configuration
With this I created a simple configuration, with the following result. Don’t forget to update your dashboard.

# HomeWizard P1 meter
sensor:
  - platform: template
    sensors:
      daily_energy:
        friendly_name: Daily Energy
        unit_of_measurement: kWh
        value_template: "{{ (states('sensor.daily_energy_offpeak')|float + states('sensor.daily_energy_peak')|float) | round(3)}}"
      weekly_energy:
        friendly_name: Weekly Energy
        unit_of_measurement: kWh
        value_template: "{{ (states('sensor.weekly_energy_offpeak')|float + states('sensor.weekly_energy_peak')|float) | round(3) }}"
      monthly_energy:
        friendly_name: Monthly Energy
        unit_of_measurement: kWh
        value_template: "{{ (states('sensor.monthly_energy_offpeak')|float + states('sensor.monthly_energy_peak')|float) | round(3) }}"
utility_meter:
  daily_energy_peak:
    source: sensor.p1_meter_total_power_import_t2
    cycle: daily
  weekly_energy_peak:
    source: sensor.p1_meter_total_power_import_t2
    cycle: weekly
  monthly_energy_peak:
    source: sensor.p1_meter_total_power_import_t2
    cycle: monthly
  daily_energy_offpeak:
    source: sensor.p1_meter_total_power_import_t1
    cycle: daily
  weekly_energy_offpeak:
    source: sensor.p1_meter_total_power_import_t1
    cycle: weekly
  monthly_energy_offpeak:
    source: sensor.p1_meter_total_power_import_t1
    cycle: monthly
8 Likes

Very cool thanks for your work.

Very nice work, let me know how to set it up for mine and ill test it

Hi!
You have to update your “configuration.yaml” file for now until I’ve created a custom component. Read here how: https://www.home-assistant.io/docs/configuration/yaml/. Use the examples im by previous post.

Find the IP address of your Energymeter and open http://<ip-address>/api/v1/data in your browser to see if it is up, and update configuration.yaml with the correct IP. Good luck!

Very nice.
How can i use sensor daily_energy_offpeak ?

In the example “p1_total_power_import_total” value_template says '“p1_dongle.attributes…”

I forgot to add the utility_meter component in my example. Please see the updated version!

Thx for the quick response

Much appreciated! love the product and the easy integration within HA thanks to your configuration. I read the info from the IP, but I could not really narrow it down to how to be able to read the gas part of the sensor. Thanks in advance!

Awesome to hear you like it!
It should be as easy as adding the gas parameter in json_attributes. Then copy, paste and update the sensors.

json_attributes:
    - total_power_import_t1_kwh
    - total_power_import_t2_kwh
    - total_power_export_t1_kwh
    - total_power_export_t2_kwh
    - active_power_w
    - active_power_l1_w
    - total_gas_m3 // like this

Or do you need help with the configuration file? Please check this post. I will create a custom integration in the near future so we all can just click on “add integration” :).

Thanks! Awsome. Like to use the component

Ordered one yesterday and received it today. Installation was easy, intergration in HA was a breeze thanks to your supplied documentation.
I have a ISKRA 2MT382-1004, smr_version":22. Gas meter seems to be connected through my power meter as it also picks up my gas usage.
Great product, tnx

1 Like

First of all many thanks for providing this wonderful product! It is easy to install, very affordable and allows easy integration due to the local API!

Honestly I’m not a home assist user, but couldn’t find any other way to provide some feedback.

I’m running a small linux server that has php, influxdb and grafana. I use it to get data from multiple sources and create nice dashboards. PHP scripts call the API and feed influxdb. Since a couple of days one of the sources is the P1.

I’m still solving some problems, so I might have more feedback later on. For now:

  • Calling API via file_get_contents took almost a minute, so I switched to curl. Although running PHP 7.2, it might be caused by incorrect behavior of the P1 webserver. https://stackoverflow.com/questions/3629504/php-file-get-contents-very-slow-when-using-full-url
  • it would be nice to see the firmware version it is running and have a link to the release notes
  • it would be nice to be able to get some hourly/daily statistics (and maybe for last X hours or last X days)
  • it would be nice to be able to get the totals since previous request
  • it would be nice to change what it sends to the internet (the homewizard cloud), e.g. enable/disable/change frequency of sending metrics to the HomeWizard cloud and enable/disable automatic updates of the firmware (and perform them manually)

Oh, btw… It would also be very nice to extend the Smartwares 868Mhz thermo-hygrometer with a wifi chip and API to get actual temperature/humidity (and also carbon-dioxide levels?) the same way. I’m now considering a Shelly H&T (https://shelly.cloud/products/shelly-humidity-temperature-smart-home-automation-sensor/) or a custom build based on arduino.

Great to hear you like the product and great ideas! I’ll see what I can do with them, but I can’t promise anything :slight_smile:

Let’s keep this topic to the HASS integration. The best thing you can do is fill in this form, that way you can get in contact with with correct persons within HomeWizard. HomeWizard is also active on Tweakers, where anyone can share feedback about HomeWizard Energy!

Thanks, will do!

Hi All

I created an initial version for the custom component.
HomeWizard Energy - Custom Component on Github

To use this, add the folder custom_components/homewizard_energy_p1 to your config folder (where all the config files are located). Restart HASS and add it as a normal component!

Please let me know what you think!

Configuration.yaml

# HomeWizard P1 meter
sensor:
# << Remove the REST sensor >>
- platform: template
  sensors:
    p1_total_power_import_t1_kwh:
      friendly_name: "Energy - Low Tarif"
      icon_template: mdi:weather-sunset-down
      unit_of_measurement: "kWh"
# << Rename the sensors: >>            \ ----------------  /
      value_template: '{{ states.sensor.homewizard_p1_meter.attributes.total_power_import_t1_kwh | float }}'
      entity_id: sensor.p1_meter
 
1 Like

hi there, what ever i do home assistant wont see the folder i placed in the config dir, below you find the path i used… anyone knows what’s wrong?

Oke, update, i just found it in the integration list, however, when i click it for installation it will refuse and goes back to the list with all the integrations… i even did try to login on a different browser… So, still ongoing

Hi!
Did you pick the most recent version from Github? When so, please rename the folder to “homewizard_energy”. I renamed the component in manifest.json (see domain) but not the folder. I think that could be the issue.

Also, the folder custom_component, readme.md and LICENCE should not be in the here. Don’t know how it ended up there, but just to be sure, better remove it :slight_smile:

Please let me know it that solved it!

It shows up in the integration list, but again when clicking for installation it fires me back to the integrations list…

Here a little video how it acts when clicks and the stucture on how the folder and files are placed