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 ------