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

Hey @fversteegen. Do you mean Active Power (in Watts) or something like ‘daily’? Because “energy consumed by my house” means to me “the imported/exported energy” :wink: .

Active power is available as entity, so if that does not show up somehow something is wrong. Daily usage is something that is displayed in the energy dashboard and/or can be added via a template. Please let me know if you want something else!

Active power is, as I am typing, -3.818 watts so that is probably something like energy produced - energy consumed.

Imported/exported is great to calculate my energy bill. If I wouldn’t have solar panels than the imported energy would display exactly what I am looking forward for, but since I have solar panels it is rather useless for my purpose.

What I am looking for is the energy (or power) that my house consumes regardless of the source. I would like to monitor it to see if I can lower my overall power consumption.

Hope this clarifies my question.

I think you have to make a template or something that subtracts active power from your solar panel from your home usage. As the smart meter only know how much power is flowing through the meter.

Example: If your solar panels are collecting 2000 Watts and you house uses 500 Watts, then you smart meter is measuring -1500W Active Power.

You need something like this:

{{ states('sensor.p1_meter_active_power') | float - states('sensor.kwh_meter_active_power') | float }}
Will return what your house is actually measuring

I will be amazed if this was possible without the above with the P1 serial cable (I think this component?

I think you are right (as expected :grin:). I installed my old P1 cable through DSMR and get the following graphs (top one is power consumption sensor from P1. The below one is my solaredge power). It’s clear that if solar panel production goes up the power consumption goes down (which shouldn’t).

Will try your solution for a template and report back.

1 Like

:saluting_face: Add sensors for HomeWizard Watermeter by DCSBL · Pull Request #74756 · home-assistant/core · GitHub

1 Like

MitchVL posted a solution a solution to the P1 meter thread at Tweakers to retrieve Volt (and potentially more) from the P1 meter and expose it to Home Assistant. I asked him if I can share this. Maybe this can be used for some of you while HomeWizard is working to integrate Volt and more in the API.

I’ve adjusted the config a bit so the entity is accepted as a ‘native’ entity that can be customised. It even has statistics and stuff. How it will help!

rest:
  - authentication: basic
    scan_interval: 10 # Lower has more resolution, but voltage is a bit 'noisy' so it fills your database fast. Be careful.
    resource: http://<ip_address>/api/v1/telegram
    sensor:
      - name: "Voltage L1"
        device_class: voltage
        unique_id: <something_random_or_serial_id>_volt_l1 # It does not matter what is added here, but it has to be unique.
        state_class: measurement
        unit_of_measurement: V
        value_template: "{{ (value|regex_findall_index('1\\-0\\:32\\.7\\.0\\([0-9.]*')).split('(',1)[-1].strip() | float }}"
      
     # Optional, if you have a 3-phase meter:
      - name: "Voltage L2"
        device_class: voltage
        unique_id: <something_random_or_serial_i >_volt_l2
        state_class: measurement
        unit_of_measurement: V
        value_template: "{{ (value|regex_findall_index('1\\-0\\:52\\.7\\.0\\([0-9.]*')).split('(',1)[-1].strip() | float }}"
     - name: "Voltage L3"
        device_class: voltage
        unique_id: <something_random_or_serial_id>_volt_l3
        state_class: measurement
        unit_of_measurement: V
        value_template: "{{ (value|regex_findall_index('1\\-0\\:72\\.7\\.0\\([0-9.]*')).split('(',1)[-1].strip() | float }}"
2 Likes

This is really helpful, thanks for it!
I’ve added the sensors for the actual current usage (in A) as well. This makes calculations for e.g. load balancing easier as it already computes the power usage in W over the actual voltage.

      - name: "P1 Current L1"
        device_class: current
        unique_id: p1_hw_current_l1 # It does not matter what is added here, but it has to be unique.
        state_class: measurement
        unit_of_measurement: A
        value_template: "{{ (value|regex_findall_index('1\\-0\\:31\\.7\\.0\\([0-9.]*')).split('(',1)[-1].strip() | float }}"
      - name: "P1 Current L2"
        device_class: current
        unique_id: p1_hw_current_l2
        state_class: measurement
        unit_of_measurement: A
        value_template: "{{ (value|regex_findall_index('1\\-0\\:51\\.7\\.0\\([0-9.]*')).split('(',1)[-1].strip() | float }}"
      - name: "P1 Current L3"
        device_class: current
        unique_id: p1_hw_current_l3
        state_class: measurement
        unit_of_measurement: A
        value_template: "{{ (value|regex_findall_index('1\\-0\\:71\\.7\\.0\\([0-9.]*')).split('(',1)[-1].strip() | float }}"
1 Like

Nice! Make sure to use “device_class: current” ;). That automates a a few UI things.

Some meters only sends a full integer for Current (1.23*A → 1A). Keep this in mind while doing calculations.

Good one, edited my post to incorporate this.

What’s the benefit (if using HA) of this device over a normal USB P1 cable? If I don’t plan on using the other HomeWizard readers, is there any benefit except not having a cable?

Starting out with HA, so I don’t just want to buy everything that I see without seeing the pro’s/con’s or I’ll be broke in no time :smiley:

Good question!

Basically: no cable :wink:

Long answer: everything that the P1 meter itself adds if you wish to use the cloud. And most importantly, the (hardware) support and the guarantees you get with a non-DIY product.

1 Like

Hiya, I have a P1 meter from HomeWizard and Energy+ with it. My local API is activated in the HomeWizard app, but within Home Assistant I get Unavailable readings every day or so. I can then unplug the meter and plug it back in, which fixes the problem for another day, sometimes shorter. But after that, I’m back at square one again and it gets unavailable again. Is there anything I can do to fix this?
Ps. The Home Wizard app, both on my phone and on desktop, give normal readings. Schermafbeelding 2022-07-23 105935

Edit/ I’ve checked my error logs and this came up:
Logger: homeassistant.components.homewizard.coordinator
Source: helpers/update_coordinator.py:237
Integration: HomeWizard Energy (documentation, issues)
First occurred: July 21, 2022 at 1:44:10 PM (133 occurrences)
Last logged: 7:09:28 AM

Error fetching homewizard data: Device did not respond as expected

@juliet, hmm annoying! A few troubleshooting questions:

  • Is the API able to restore it self over time or do you really need to power cycle the meter?
  • How is your WiFi connection? If the meter is too far (or to close) the connection can drop out. Because the API is local poll it is a bit more sensitive for dropouts.
  • Are there other programs (or network scanners) that maybe try to access your meter?

There is a known issue that the meter only accepts a certain amount of active connections. If the connection is not closed properly the API gets blocked. This can happen when the WiFi connection disconnects randomly or when the caller does not close the connection. This should rarely happen, but if it happens too often (in your case) maybe something else is going on. I am not saying that this is the issue but let’s see how we get from here.

1 Like

Thank you for your reply

The API doesn’t restore itself, I need to power cycle the meter and then (as the API shuts of when the meter gets unplugged) re-enable the API in the app once the meter has powered back up. The weird thing is, all that time (well unless during the unplugging, of course), it shows up perfectly fine in the app.

The wifi connection is excellent, I’ve downloaded Fing on my phone to see if any downtime occurs on my network, and it does in my shed (secondary access point) but not near my P1 meter (it’s sitting next to the router). But I’ve never given any thought to the fact the proximity to the router could be too close, so I’ve set an alert in Fing to let me know if it disconnects.

I don’t think other programs or apps are trying to access the meter, except for the home wizard app itself.

Second reply, sorry for that!

There is a network issue, indeed. I didn’t notice it before, but it seems my access point has somehow reset itself and has decided to act as DHCP server, giving conflicts with the network. (That was something I had turned off for obvious reasons). I only just found out, so I will need to monitor the P1 meter for a while to see if no more outages appear, but I think it’s safe to say I found a culprit, if not the culprit.

Thanks so much again for your answers!

1 Like

Got one, working like a charm!

I managed to configure these REST scripts in configuration.yaml and HA shows the values now.
But in the History graphs I miss the min and max values and the graph is not a fluent line. (blocked)
Any suggestion?

Hi,

I’m just getting started with HomeAssistant and managed to get it up and running in a docker on my Synology NAS and added a few things to it already, however I’m unable to add my HomeWizard P1 meter.

I’m running the latest docker image.

The P1 meter is added to a separate smart home SSID and gets an IP via DHCP (unlimited lease time), when adding the IP to the homewizard integration it responds with ‘unexpected error’.

I’ve enabled and disabled the API in the P1 app to no avail.

Can someone help me with this issue?

Is your separate network accessible from the network where your NAS is?

If I want to replace my USB P1 cable for the homewizzard P1 Meter do I lose my old measurements?