Wi-Fi P1/DSMR dongle: HomeWizard Energy

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.

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 free time I am working to get the P1 meter integrated into HASS. I have started to create a custom component to make it easier.

Please let me know what you think! If you have any ideas or feedback, please let me know. I can pitch them to my company!

When calling http://<ip_address>/api/v1/data, the P1 meter returns:

{
  "smr_version":50,
  "meter_model":"ISKRA 2M550E-1011",
  "wifi_ssid":"myWifi",
  "wifi_strength":100,
  "total_power_import_t1_kwh":1234.567,
  "total_power_import_t2_kwh":1234.321,
  "total_power_export_t1_kwh":0,
  "total_power_export_t2_kwh":0,
  "active_power_w":5971,
  "active_power_l1_w":5971,
  "active_power_l2_w":null,
  "active_power_l3_w":null,
  "total_gas_m3":null,
  "gas_timestamp":null
}

(I have a single phase meter and no gas, also changed some things for privacy)

My configuration
With this I created a simple configuration to get me started, and I’m planning the create at least a custom component for this device.

# HomeWizard P1 meter
sensor:
- platform: rest
  name: P1 Meter
  resource: http://<YOUR_METER_IP_ADRESS>/api/v1/data
  method: GET
  value_template: '{{ value_json.active_power_w }}'
  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
- platform: template
  sensors:
    p1_total_power_import_t1_kwh:
      friendly_name: "Energy - Low Tarif"
      icon_template: mdi:weather-sunset-down
      unit_of_measurement: "kWh"
      value_template: '{{ states.sensor.p1_meter.attributes.total_power_import_t1_kwh | float }}'
      entity_id: sensor.p1_meter
    p1_total_power_import_t2_kwh:
      friendly_name: "Energy - High Tarif"
      icon_template: mdi:weather-sunset-up
      unit_of_measurement: "kWh"
      value_template: '{{ states.sensor.p1_meter.attributes.total_power_import_t2_kwh | float }}'
      entity_id: sensor.p1_meter
    p1_total_power_import_total:
      friendly_name: "Energy - Total import"
      icon_template: mdi:weather-sunset-down
      unit_of_measurement: "kWh"
      value_template: '{{ (states.sensor.p1_meter.attributes.total_power_import_t1_kwh | float + states.sensor.p1_dongle.attributes.total_power_import_t2_kwh | float) | round(3)}}'
      entity_id: sensor.p1_meter
    p1_active_power_w:
      friendly_name: "Energy - Usage"
      icon_template: mdi:flash
      unit_of_measurement: "W"
      value_template: '{{ states.sensor.p1_meter.attributes.active_power_w | int }}'
      entity_id: sensor.p1_meter
    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_total_power_import_t2_kwh
    cycle: daily
  weekly_energy_peak:
    source: sensor.p1_total_power_import_t2_kwh
    cycle: weekly
  monthly_energy_peak:
    source: sensor.p1_total_power_import_t2_kwh
    cycle: monthly
  daily_energy_offpeak:
    source: sensor.p1_total_power_import_t1_kwh
    cycle: daily
  weekly_energy_offpeak:
    source: sensor.p1_total_power_import_t1_kwh
    cycle: weekly
  monthly_energy_offpeak:
    source: sensor.p1_total_power_import_t1_kwh
    cycle: monthly
2 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