Homewizard P1 meter binding update?

Hi all,

I just got a P1 meter from homewizard. I installed the binding and works great. But I see on API endpoints — HomeWizard Energy API documentation (homewizard-energy-api.readthedocs.io) that more parameters are available.
What is currently implemented is

<Request>
GET http://{IP address}/api/v1/data HTTP/1.1

<Response>
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: <length>

{
   "smr_version": 50,
   "meter_model": "ISKRA  2M550T-101",
   "wifi_ssid": "My Wi-Fi",
   "wifi_strength": 100,
   "total_power_import_t1_kwh": 10830.511,
   "total_power_import_t2_kwh": 2948.827,
   "total_power_export_t1_kwh": 1285.951,
   "total_power_export_t2_kwh": 2876.51,
   "active_power_w": -543,
   "active_power_l1_w": -676,
   "active_power_l2_w": 133,
   "active_power_l3_w": 0,
   "total_gas_m3": 2569.646,
   "gas_timestamp": 210606140010
}

But it appears that more data is available:

<Request>
GET http://{IP address}/api/v1/data HTTP/1.1

<Response>
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: <length>

{
   "wifi_ssid": "My Wi-Fi",
   "wifi_strength": 100,
   "smr_version": 50,
   "meter_model": "ISKRA  2M550T-101",
   "unique_id": "00112233445566778899AABBCCDDEEFF",
   "active_tariff": 2,
   "total_power_import_kwh": 13779.338,
   "total_power_import_t1_kwh": 10830.511,
   "total_power_import_t2_kwh": 2948.827,
   "total_power_export_kwh": 0,
   "total_power_export_t1_kwh": 0,
   "total_power_export_t2_kwh": 0,
   "active_power_w": -543,
   "active_power_l1_w": -676,
   "active_power_l2_w": 133,
   "active_power_l3_w": 0,
   "active_current_l1_a": -4,
   "active_current_l2_a": 2,
   "active_current_l3_a": 0,
   "voltage_sag_l1_count": 1,
   "voltage_sag_l2_count": 1,
   "voltage_sag_l3_count": 0,
   "voltage_swell_l1_count": 0,
   "voltage_swell_l2_count": 0,
   "voltage_swell_l3_count": 0,
   "any_power_fail_count": 4,
   "long_power_fail_count": 5,
   "total_gas_m3": 2569.646,
   "gas_timestamp": 210606140010,
   "gas_unique_id": "FFEEDDCCBBAA99887766554433221100",
   "active_power_average_w": 123.000,
   "montly_power_peak_w": 1111.000,
   "montly_power_peak_timestamp": 230101080010,
   "external": [
      {
         "unique_id": "FFEEDDCCBBAA99887766554433221100",
         "type": "gas_meter",
         "timestamp": 210606140010,
         "value": 2569.646,
         "unit": "m3"
      },
      {
         "unique_id": "ABCDEF0123456789ABCDEF0123456789",
         "type": "water_meter",
         "timestamp": 210606140015,
         "value": 123.456,
         "unit": "m3"
      }
   ]
}

Is anybody actually maintaining this binding? Or do i need to hack it myslef :wink:

Thanks,

Ramon

Hi,
i think the fastest way could be to use the http binding with a jsonpath transformation to get out anything you want if the binding does not support it yet.

2 Likes

Thx. Let me look into that!

I got it working:

Thing http:url:p1meter "Homewizard P1 meter" [
    baseURL="http://192.168.32.185/api/v1/data",
    refresh=5] {
        Channels:
		 Type string : wifi_ssid                 "Wifi SSID"     [ stateTransformation="JSONPATH:$.wifi_ssid", mode="READONLY"  ] 
		 Type number : wifi_strength             "Wifi strength" [ stateTransformation="JSONPATH:$.wifi_strength", mode="READONLY"  ]
		 Type number : smr_version               "SMR version" [ stateTransformation="JSONPATH:$.smr_version", mode="READONLY"  ]
		 Type string : meter_model               "Meter model"     [ stateTransformation="JSONPATH:$.meter_model", mode="READONLY"  ] 
		 Type string : unique_id                 "unique id"     [ stateTransformation="JSONPATH:$.unique_id", mode="READONLY"  ] 
		 Type number : active_tariff             "Active teriff" [ stateTransformation="JSONPATH:$.active_tariff", mode="READONLY"  ]
		 Type number : total_energy_import_total "Import total"  [ stateTransformation="JSONPATH:$.total_power_import_kwh", mode="READONLY"  ]
		 Type number : total_energy_import_t1    "Import T1"     [ stateTransformation="JSONPATH:$.total_power_import_t1_kwh", mode="READONLY"  ]
		 Type number : total_energy_import_t2    "Import T2"     [ stateTransformation="JSONPATH:$.total_power_import_t2_kwh", mode="READONLY"  ] 
		 Type number : total_energy_export_total "Export total"  [ stateTransformation="JSONPATH:$.total_power_export_kwh", mode="READONLY"  ]
		 Type number : total_energy_export_t1    "Export T1"     [ stateTransformation="JSONPATH:$.total_power_export_t1_kwh", mode="READONLY"  ] 
		 Type number : total_energy_export_t2    "Export T1"     [ stateTransformation="JSONPATH:$.total_power_export_t2_kwh", mode="READONLY"  ] 
		 Type number : active_power              "Power total"   [ stateTransformation="JSONPATH:$.active_power_w", mode="READONLY"  ] 
		 Type number : active_power_l1           "Power L1"      [ stateTransformation="JSONPATH:$.active_power_l1_w", mode="READONLY"  ] 
		 Type number : active_power_l2           "Power L2"      [ stateTransformation="JSONPATH:$.active_power_l2_w", mode="READONLY"  ] 
		 Type number : active_power_l3           "Power L3"      [ stateTransformation="JSONPATH:$.active_power_l3_w", mode="READONLY"  ] 
		 Type number : active_voltage_l1         "Voltage L1"    [ stateTransformation="JSONPATH:$.active_voltage_l1_v", mode="READONLY"  ] 
		 Type number : active_voltage_l2         "Voltage L2"    [ stateTransformation="JSONPATH:$.active_voltage_l2_v", mode="READONLY"  ] 
		 Type number : active_voltage_l3         "Voltage L3"    [ stateTransformation="JSONPATH:$.active_voltage_l3_v", mode="READONLY"  ] 
		 Type number : active_current_l1_a       "Current L1"    [ stateTransformation="JSONPATH:$.active_current_l1_a", mode="READONLY"  ] 
		 Type number : active_current_l2_a       "Current L2"    [ stateTransformation="JSONPATH:$.active_current_l2_a", mode="READONLY"  ] 
		 Type number : active_current_l3_a       "Current L3"    [ stateTransformation="JSONPATH:$.active_current_l3_a", mode="READONLY"  ] 
		 Type number : voltage_sag_l1_count      "Voltage sag L1 count"   [ stateTransformation="JSONPATH:$.voltage_sag_l1_count", mode="READONLY"  ] 
		 Type number : voltage_sag_l2_count      "Voltage sag L2 count"   [ stateTransformation="JSONPATH:$.voltage_sag_l2_count", mode="READONLY"  ] 
		 Type number : voltage_sag_l3_count      "Voltage sag L3 count"   [ stateTransformation="JSONPATH:$.voltage_sag_l3_count", mode="READONLY"  ] 
		 Type number : voltage_swell_l1_count    "Voltage swell L1 count" [ stateTransformation="JSONPATH:$.voltage_swell_l1_count", mode="READONLY"  ] 
		 Type number : voltage_swell_l2_count    "Voltage swell L2 count" [ stateTransformation="JSONPATH:$.voltage_swell_l2_count", mode="READONLY"  ] 
		 Type number : voltage_swell_l3_count    "Voltage swell L3 count" [ stateTransformation="JSONPATH:$.voltage_swell_l3_count", mode="READONLY"  ] 
		 Type number : any_power_fail_count      "Any power fail count"   [ stateTransformation="JSONPATH:$.any_power_fail_count", mode="READONLY"  ] 		 
		 Type number : long_power_fail_count     "Long power fail count"  [ stateTransformation="JSONPATH:$.long_power_fail_count", mode="READONLY"  ] 		 
		 Type number : total_gas                 "Gas total"     [ stateTransformation="JSONPATH:$.total_gas_m3", mode="READONLY"  ] 
		 Type string : gas_unique_id             "Gas ID"        [ stateTransformation="JSONPATH:$.gas_unique_id", mode="READONLY"  ] 
		 Type datetime : gas_timestamp           "Gas timestamp" [ stateTransformation="JSONPATH:$.gas_timestamp", mode="READONLY"  ]
} 

Thx again!

2 Likes