Page 2 of 2

Re: HomeWizard P1 Wifi into Domoticz

Posted: Friday 06 January 2023 20:23
by azonneveld
Create file "p1.lua" in "/home/pi/domoticz/scripts/lua_parsers/" containing:

Code: Select all

------ BEGIN ------
local idGas = <IDX>
local idEnergy = <IDX>

-- Read API values
s = request['content'];

--
-- Gasmeter
--

local a = domoticz_applyJsonPath(s,'.total_gas_m3')
domoticz_updateDevice(idGas,'',a*1000)

--
-- Energiemeter
--

-- Dal import value
local b = domoticz_applyJsonPath(s,'.total_power_import_t1_kwh')
-- Piek import value
local c = domoticz_applyJsonPath(s,'.total_power_import_t2_kwh')
-- Dal return value
local d = domoticz_applyJsonPath(s,'.total_power_export_t1_kwh')
-- Piek return value
local e = domoticz_applyJsonPath(s,'.total_power_export_t2_kwh')
-- Active Watt Usage
local f = domoticz_applyJsonPath(s,'.active_power_w')
local g = math.abs(domoticz_applyJsonPath(s,'.active_power_w'))
local h = domoticz_applyJsonPath(s,'active_power_l1_w')
local i = domoticz_applyJsonPath(s,'active_power_l2_w')
local j = domoticz_applyJsonPath(s,'active_power_l3_w')
--
if f<0 then f = 0 elseif f>0 then g = 0 end



domoticz_updateDevice(idEnergy,'',b*1000 ..";"..c*1000 ..";"..d*1000 ..";"..e*1000 ..";"..f..";"..g)
------ END ------
supplement with your own idx at the top of the script


Then create a hardware device: http-poller
Fill as follows

Image

Re: HomeWizard P1 Wifi into Domoticz

Posted: Saturday 07 January 2023 11:34
by AthomeDomotica
Thanks for the reply to this issue...

Everything is working; Phone APP and Browser.

Why is it suddenly not reading?

Greetings,

Mike

Re: HomeWizard P1 Wifi into Domoticz

Posted: Saturday 07 January 2023 12:19
by waltervl
Make an issue on the GitHub repository of the plugin https://github.com/Eraser3/HomeWizard-Wifi-p1-plugin

Re: HomeWizard P1 Wifi into Domoticz

Posted: Saturday 07 January 2023 21:22
by azonneveld
AthomeDomotica wrote: Saturday 07 January 2023 11:34 Why is it suddenly not reading?
Ah, got it, you are using a plugin, I cannot awnser that.

The method I described is using the built-in http poller.

A hint: blur your unique ids.

Re: HomeWizard P1 Wifi into Domoticz

Posted: Monday 09 January 2023 19:33
by AthomeDomotica
azonneveld wrote: Saturday 07 January 2023 21:22
AthomeDomotica wrote: Saturday 07 January 2023 11:34
A hint: blur your unique ids.
Thanks for the tip :-)

Re: HomeWizard P1 Wifi into Domoticz

Posted: Saturday 14 January 2023 12:25
by AthomeDomotica
waltervl wrote: Saturday 07 January 2023 12:19 Make an issue on the GitHub repository of the plugin https://github.com/Eraser3/HomeWizard-Wifi-p1-plugin

Thanks for the responce.
I've made a Issue on Github for this. I hope for responce, lets see?

"Eraser3/HomeWizard-Wifi-p1-plugin Failed to read response data"

Cheers,

Mike

Re: HomeWizard P1 Wifi into Domoticz

Posted: Saturday 03 June 2023 15:20
by Eraser
AthomeDomotica wrote: Saturday 14 January 2023 12:25
waltervl wrote: Saturday 07 January 2023 12:19 Make an issue on the GitHub repository of the plugin https://github.com/Eraser3/HomeWizard-Wifi-p1-plugin

Thanks for the responce.
I've made a Issue on Github for this. I hope for responce, lets see?

"Eraser3/HomeWizard-Wifi-p1-plugin Failed to read response data"

Cheers,

Mike
Sorry for the extreme late response. There was a problem with the plugin some time ago and I updated the script back then. It had to do with a firmware update of the p1 meter. I never saw your topic post about this so that's why I never responded to it.

The latest plugin on Github should work fine with the latest updates from HomeWizard.

Re: HomeWizard P1 Wifi into Domoticz

Posted: Sunday 04 February 2024 16:58
by Empha88
AthomeDomotica wrote: Friday 06 January 2023 14:48 After 2 weeks I' am getting this error?'

Error: P1 HomeWizard: Failed to read response data

Set DEBUG ON
---------------
2023-01-06 14:42:00.041 P1 HomeWizard: Pushing 'onHeartbeatCallback' on to queue
2023-01-06 14:42:00.091 P1 HomeWizard: Processing 'onHeartbeatCallback' message
2023-01-06 14:42:00.091 P1 HomeWizard: Acquiring GIL for 'onHeartbeatCallback'
2023-01-06 14:42:00.091 P1 HomeWizard: Calling message handler 'onHeartbeat' on 'module' type object.
2023-01-06 14:42:00.204 P1 HomeWizard: Acquiring GIL for 'onHeartbeatCallback'
2023-01-06 14:42:00.204 Error: P1 HomeWizard: Failed to read response data
--------------------
Anyone experienced this ?

Domoticz restarted, same issue

At the end of the Python script is this activated!
-------------
if ( self.dataIntervalCount >= self.dataInterval or self.switchIntervalCount >= self.switchInterval ):
try:
self.smr_version = Data['smr_version']
self.meter_model = Data['meter_model']
self.wifi_ssid = Data['wifi_ssid']
self.wifi_strength = Data['wifi_strength']
self.total_power_import_t1_kwh = int(Data['total_power_import_t1_kwh'] * 1000)
self.total_power_import_t2_kwh = int(Data['total_power_import_t2_kwh'] * 1000)
self.total_power_export_t1_kwh = int(Data['total_power_export_t1_kwh'] * 1000)
self.total_power_export_t2_kwh = int(Data['total_power_export_t2_kwh'] * 1000)
self.active_power_w = Data['active_power_w']
self.active_power_l1_w = Data['active_power_l1_w']
self.active_power_l2_w = Data['active_power_l2_w']
self.active_power_l3_w = Data['active_power_l3_w']
self.total_gas_m3 = int(Data['total_gas_m3'] * 1000)
self.gas_timestamp = Data['gas_timestamp']

if ( self.active_power_w >= 0):
self.import_active_power_w = self.active_power_w
self.export_active_power_w = 0
else:
self.import_active_power_w = 0
self.export_active_power_w = self.active_power_w * -1
except:
Domoticz.Error("Failed to read response data")

=====================
How to debug this issue?

Thanks for youre time to responce
Im also getting this issue, any solution for this?
Im on firmware 5.05

Reading this:

"wifi_ssid":"TELIA4G",
"wifi_strength":24,
"meter_model":"ELL5\253926427_A",
"unique_id":"blurred",
"total_power_import_kwh":10425.198,
"total_power_import_t1_kwh":10425.198,
"total_power_export_kwh":0.159,
"total_power_export_t1_kwh":0.159,
"active_power_w":1756,
"active_power_l1_w":167,
"active_power_l2_w":1434,
"active_power_l3_w":153,
"active_voltage_l1_v":231.9,
"active_voltage_l2_v":230.1,
"active_voltage_l3_v":232.5,
"active_current_l1_a":0.9,
"active_current_l2_a":6.2,
"active_current_l3_a":0.9,
"external":[]

Re: HomeWizard P1 Wifi into Domoticz

Posted: Monday 12 February 2024 13:53
by Empha88
Did my own lua script and renamed the values i wanted.
Seems like i have other values than the script you guys have.

------ BEGIN ------
-- Read API values
s = request['content'];

--
-- Energimeter
--
-- return value
local a = domoticz_applyJsonPath(s,'.total_power_import_t1_kwh')
-- active current return
local b = domoticz_applyJsonPath(s,'.active_power_w')
local c = domoticz_applyJsonPath(s,'active_power_l1_w')
local c = domoticz_applyJsonPath(s,'.active_current_l1_a')
local d = domoticz_applyJsonPath(s,'.active_current_l2_a')
local e = domoticz_applyJsonPath(s,'.active_current_l3_a')
local f = domoticz_applyJsonPath(s,'.active_power_l1_w')
local g = domoticz_applyJsonPath(s,'.active_power_l2_w')
local h = domoticz_applyJsonPath(s,'.active_power_l3_w')
local i = domoticz_applyJsonPath(s,'.wifi_strength')
--

local idkWh = 7
domoticz_updateDevice(idkWh,'',a*1000)

local idW = 92
domoticz_updateDevice(idW,'',b)

local idA = 98
domoticz_updateDevice(idA,'',c ..";"..d ..";"..e)

local idWiFi = 99
domoticz_updateDevice(idWiFi,'',i)

local idA = 100
domoticz_updateDevice(idA,'',b ..";"..a*1000)

local idW1 = 101
domoticz_updateDevice(idW1,'',f)

local idW2 = 102
domoticz_updateDevice(idW2,'',g)

local idW3 = 103
domoticz_updateDevice(idW3,'',h)

------ END ------

Re: HomeWizard P1 Wifi into Domoticz

Posted: Saturday 10 May 2025 20:26
by DomoFlits
Today I've received my HomeWizard P1 Wifi dongle.
I've installed the plugin from https://github.com/Eraser3/HomeWizard-Wifi-p1-plugin
I've added the HW wifi P1 meter in the hardware.
The devices showed up in the device tab.
so far so good.

Now I notice that the "Current power usage" and the "Total power usage" show the watts multiplied by factor 10 in Domoticz.
- meter screen: ~300W
- HomeWizard app: ~300W
- Domoticz: ~3000W

I see it has occurred before when reading: https://github.com/Eraser3/HomeWizard-W ... in/pull/12
does anybody know how to fix this?

I guess I should use the fork of gettevan instead? https://github.com/gettevan/HomeWizard-Wifi-p1-plugin

Re: HomeWizard P1 Wifi into Domoticz

Posted: Saturday 10 May 2025 20:50
by DomoFlits
I've switched to the plugin.py from the fork from gettevan.
now the values are not multiplied by 10.
The fix from gettevan was never implemented in the Eraser3 plugin.

Re: HomeWizard P1 Wifi into Domoticz

Posted: Monday 15 December 2025 11:11
by fdemees
Hello,
I am also using the abovementioned fork that fixes the values multiplied by 10.
Anyway, all the rest of the logic is the same then the original Eraser3 version.

I am experiencing random crashes that occur more or less after one week of activity. I don't know if an external factor causes this.
The P1 dongle is alive and I can query its /api/v1/data at any moment.

The Domoticz log reports every 10 or 15 seconds the following error message:

Code: Select all

2025-12-15 10:55:49.907 Error: <name> hardware (<idx>) thread seems to have ended unexpectedly
The Utility device shows a value of zero kWh, and obviously "last seen" is no more updated.

If I go in the Domoticz Hardware section, disable that hardware, Domoticz stops responding, apparently completely crashed, although the process is still there and consumes some CPU percentage.

I can ssh to the server, stop the domoticz service, it take some abnormal time to complete the service shutdown and there is no crash log.

What are the steps to diagnose and fix this issue ? Do you have some advice ?

Thanks in advance :)