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

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