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

Already set the polling interval to 10 seconds. The problem is that the PV (solar panels) generated power has effect on the power reported by the P1 meter. So when the PV generated power increases and they are not sample at the same time strange differences might occur.
Let me explain, the P1 meter reports 200W used at time ‘0’ after 10 seconds it reports 2200W used. At time ‘0’ the sun was shining and at time ‘10 seconds’ there is a cloud in front of it so the PV panels generate 2000W less. But when the PV meter samples at time ‘5 seconds’ the cloud might not be casting a shadow. If you use those numbers to calculate the actual power usage of the house you end up with strange numbers. If the output of the PV’s is constant over time, there is no problem. But the generated power can change rapidly.
I hope this clarifies it…

Since updating the Home Assistant Core to version 2021.7.1 the Home Energy Wizard integration no longer works. I see these errors in the Core log:

2021-07-10 07:46:48 ERROR (MainThread) [custom_components.homewizard_energy.sensor] Error connecting to the Energy device at 192.168.178.143
2021-07-10 07:46:48 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up homewizard_energy platform for sensor
Traceback (most recent call last):
  File "/config/custom_components/homewizard_energy/sensor.py", line 128, in async_setup_entry
    await energy_api.initialize()
  File "/usr/local/lib/python3.9/site-packages/aiohwenergy/hwenergy.py", line 50, in initialize
    await self.update()
  File "/usr/local/lib/python3.9/site-packages/aiohwenergy/hwenergy.py", line 54, in update
    status, response = await self.request('get', 'api')
  File "/usr/local/lib/python3.9/site-packages/aiohwenergy/hwenergy.py", line 96, in request
    raise RequestError(
aiohwenergy.errors.RequestError: Error requesting data from 192.168.178.143: Server disconnected
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/homewizard_energy/sensor.py", line 136, in async_setup_entry
    raise ConfigEntryNotReady
homeassistant.exceptions.ConfigEntryNotReady: None

Any thoughts on how this can be fixed? Thanks.

Everything seems to work on my side. If I can remember correctly, there were more problems in the past with your setup. Please check if you have the most recent version of the integration installed (0.7.1) with all the files and that your P1 meter still can be found at 192.168.178.143.

Thanks. The P1 meter is still at 192.168.178.143. I’ve used HACS to reinstall the integration, restarted HA, and now everything is back to normal.

Dunno what happened there, I’ve not touched anything other than install 2021.7.1 a couple of days ago…

Before changing anything it it the local api setting? on/off

I seem to have a similar problem.
after a few days, HA is not able to read the results anymore from P1 meter.
When I reboot, everything is fine again for a few days, and then it stops again,

The custom component version is ": “0.7.1”

Up to the HA updates, there has never been a problem.
Any ideas on how to solve this ?
Let me know if you need me to do additional debugging.

I see this in the lovelace dashboard.

Impossible energy consumption measure of total

In the logs I see this:




July 14, 2021, 8:40:35 PM – (ERROR) helpers/entity_component.py

Error while setting up homewizard_energy platform for sensor

July 14, 2021, 8:40:33 PM – (ERROR) Sensor (custom integration)

Error connecting to the Energy device at 192.168.0.92

July 14, 2021, 8:40:33 PM – (ERROR) Homewizard Energy (custom integration)
July 15, 2021, 9:49:15 PM – (WARNING) Home Assistant WebSocket API

Error unloading entry P1 meter for sensor
Impossible energy consumption measure of total
July 15, 2021, 9:49:15 PM – (WARNING) Home Assistant WebSocket API
Error unloading entry P1 meter for sensor
July 14, 2021, 8:40:35 PM – (ERROR) helpers/entity_component.py
Error while setting up homewizard_energy platform for sensor
July 14, 2021, 8:40:33 PM – (ERROR) Sensor (custom integration)
Error connecting to the Energy device at 192.168.0.92
July 14, 2021, 8:40:33 PM – (ERROR) Homewizard Energy (custom integration)

Oh and by the way, is it already possible to read out the Homewizard kWh meters with Home Assistant ?

Hi Defisit,

Can I ask how you added the extra sensors for voltages from the /telegram API endpoint?
( I’m pretty new )

Thx!

Annoying! I tried to reproduce this issue, but without success. Can you open an issue on GitHub, so we can keep all issues in one place.


Oh and by the way, is it already possible to read out the Homewizard kWh meters with Home Assistant ?

Yes, just enable the API in the latest app release.

Yes, just enable the API in the latest app release.

But how will HA read this data, is there something included in your custom component for this ?

The API for the kWh meter (SDM230-wifi and SDM630-wifi) and the P1 meter is almost* the same, and the component accepts all devices that react to these endpoints correctly. The integration exposes all available datapoints.

So in case of the kWh meter, the integration will expose active_power_w and total_power_import_t1_kwh in the list of entities when you add the kWh meter.

Does this answer your question?

*) It is missing data like total_gas_m3 and smr_version, and product_name is different of course.

Hi everyone,

Can somebody help? I’m trying to get data from the telegram endpoint. But I don’t see new entities, I also have a warning in the logging :

Logger: homeassistant.components.rest.sensor
Source: components/rest/sensor.py:177
Integration: RESTful (documentation, issues)
First occurred: 21:34:34 (1 occurrences)
Last logged: 21:34:34

REST result could not be parsed as JSON

This is my code, most of the entitities are “unknown” but I’m only interested in the voltages :slight_smile:

# P1 meter >Telegram API
  - platform: rest
    resource: http://192.168.0.109/api/v1/telegram
    name: "P1_meter_telegram"
    headers:
      content-type: text/plain
    json_attributes:
          - "unknown 1"
          - "unknown 2"
          - "unknown 3"
          - "stroomimport piek"
          - "stroomimport dal"
          - "stroomexport piek"
          - "stroomexport dal"
          - "unknown 4"
          - "unknown 5 kW"
          - "unknown 6 kW"
          - "unknown 7 kW"
          - "unknown 8 kW"
          - "unknown 9 kW"
          - "unknown 10 kW"
          - "unknown 11 kW"
          - "unknown 12 kW"
          - "Voltage U1"
          - "Voltage U2"
          - "Voltage U3"
          - "Current I1"
          - "Current I2"
          - "Current I3"
          - "unknown 13"
          - "unknown 14"
          - "unknown 15"
          - "unknown 16"
          - "unknown 17"
          - "unknown 18"
          - "unknown 19"
          - "Total gas"

Well, /telegram does not return JSON, but the raw telegram. Please take a look at the documentation.

If you want to read voltage, you have to parse the telegram (and I don’t know if that is easily done from configuration.yaml).

I will open a feature request to have voltage present in the /api endpoint, as I got this question a couple of times now. But I can’t give guarantees about if and when.

2 Likes

Hi, I was able to set everything up but I’m having an issue getting any of the daily amounts to reset. Instead, they are added together each day and the total displayed is the total amount since I set up the sensors, not the total of the current day.
Anyone know how to fix this? I looked through the .yaml file and based on my limited knowledge it seems okay, but I mostly just copied everything from this thread and adjusted the names as needed.

Here is my dashboard with the graphs showing a sum of all days combined rather than the sum of the current day:

I set up the utility_meter integration as follows:


utility_meter:
  energy_import_t2_dagelijks:
    source: sensor.p1_meter_total_power_import_t2
    cycle: daily

  energy_import_t1_dagelijks:
    source: sensor.p1_meter_total_power_import_t1
    cycle: daily

  energy_export_t2_dagelijks:
    source: sensor.p1_meter_total_power_export_t2
    cycle: daily

  energy_export_t1_dagelijks:
    source: sensor.p1_meter_total_power_export_t1
    cycle: daily

  energy_gas_dagelijks:
    source: sensor.p1_meter_total_gas
    cycle: daily

and the sensors like this (based on MRO’s code):


#import electra 
  - platform: template
    sensors:
      energy_import_t2_dagelijks_eur:
        friendly_name: 'Cost import today standard rate (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: 'Cost import today offpeak rate (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: 'Cost import today offpeak + standard'
        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 today offpeak + standard'
        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: 'Cost today electric'
        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: 'Cost today 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: 'Total net energy costs'
        value_template: "{{ (states('sensor.energy_gass_eur')|float + states('sensor.energy_total_dagelijks_eur')|float)|round(2) }}"
        unit_of_measurement: "€"

any help would be appreciated. Thanks!

Tomorrow, Home Assistant will release a new version that is in beta for a few days. This version adds a native energy and costs dashboard. @dawnchorus, maybe this is all you need. (if not, I can take a look into your problem).

Thanks for the update. Might be a stupid question… but how do I install the beta? I tried to search HACS for home assistant 2021.8.0 beta but couldn’t find anything.

Home Assistant is not managed by HACS, as it is for custom integrations and frontend addons. You can look for ‘how to update’ if you search for for installation method (eg ‘supervised’).

I think the best thing for you to do is to wait for the official release of HA (every ‘major’ release is the first Wednesday of the month, aka tomorrow). And install is like you’ve done before.

Looks somehow promissing, let’s see when it’s released

I think it’s the setup of your cards… just post the code of one…

here is my simplest card, just an entity displaying the total electric cost of the day

type: entity
entity: sensor.energy_import_total_dagelijks_eur
icon: mdi:currency-euricon: mdi:currency-eur

and here is one of the mini card graphs I have that is supposed to show the cost of each day:

type: custom:mini-graph-card
icon: mdi:currency-eur
entities:
  - sensor.energy_import_total_dagelijks_eur
name: Electricity consumption
hours_to_show: 168
aggregate_func: max
group_by: date
show:
  graph: bar

my bad, I got confused between HomeWizard 0.8.0 and HA 2021.8.0. I’ll wait for the HA release and then update HomeWizard from HACS.