HomeWizard Energy Wi-Fi P1 meter Capacity Tarif (CAPTAR)

The HomeWizard P1 has a new firmware.
Since version v4.14, There are some extra fields added to the API.


So now it’s possible to read out the ‘Kwartierpiek’ and ‘Maandpiek’, that is used for calculating the ‘CapaciteitsTarief’ for Belgium customers.

It’s not in the HA integration yet, but it can be read (together with some other parameters) directly from the API, with a REST sensor.

This is the code (change the IP to your own :wink: )

rest:
  - resource: http://192.168.1.171/api/v1/data
    method: GET
    sensor:
    - name: "fluvius_dm_active_voltage_l1_v"
      value_template: "{{ value_json.active_voltage_l1_v | float(0) | round(1) }}"
      device_class: voltage
      state_class: measurement
      unit_of_measurement: V
    - name: "fluvius_dm_active_current_l1_a"
      value_template: "{{ value_json.active_current_l1_a | float(0) | round(2) }}"
      device_class: current
      state_class: measurement
      unit_of_measurement: A
    - name: "fluvius_dm_montly_power_peak_w"
      value_template: "{{ value_json.montly_power_peak_w | float(0) | round(0) }}"
      device_class: power
      state_class: measurement
      unit_of_measurement: W
    - name: "fluvius_dm_active_power_average_w"
      value_template: "{{ value_json.active_power_average_w | float(0) | round(1) }}"
      device_class: power
      state_class: measurement
      unit_of_measurement: W

These are all the parameters that can be read :

active_tariff
total_power_import_kwh
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
active_voltage_l1_v
active_current_l1_a
active_power_average_w
montly_power_peak_w
montly_power_peak_timestamp
total_gas_m3
gas_timestamp
1 Like

Nice job!

For nontechie users; these sensors are implemented and will be added in Home Assistant 2023.2.

1 Like

I can see the peak_demand_current_month but not the timestamp. will this also be added?

Any chance of having the timestamp added to the p1_meter_*_peak_demand_current_month sensor as an attribute?

You can always try to add it yourself by opening a PR at GitHub. At the moment I have not enough time to work on this.

Took a different path and decided to create a custom sensor to retrieve the data directly from the P1 meter.

sensor:
  - platform: rest
    resource: http://<IP_OF_P1_METER>/api/v1/data
    name: P1 Meter Custom Peak Demand Current Month Timestamp
    unique_id: p1_meter_custom_peak_demand_current_month_timestamp
    value_template: >-
      {{ strptime(value_json.montly_power_peak_timestamp | string, '%y%m%d%H%M%S') | as_local }}
    device_class: timestamp
2 Likes