HomeWizard P1 Wifi into Domoticz

Moderator: leecollings

azonneveld
Posts: 153
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: HomeWizard P1 Wifi into Domoticz

Post 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
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
AthomeDomotica
Posts: 25
Joined: Monday 26 December 2016 14:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Utrecht
Contact:

Re: HomeWizard P1 Wifi into Domoticz

Post by AthomeDomotica »

Thanks for the reply to this issue...

Everything is working; Phone APP and Browser.

Why is it suddenly not reading?

Greetings,

Mike
Attachments
P1 JSON_401.jpg
P1 JSON_401.jpg (46.58 KiB) Viewed 1856 times
Last edited by AthomeDomotica on Monday 09 January 2023 19:31, edited 1 time in total.
Domoticz, Controlicz, Philips HUE Gateway and bulbs, Z-Wave (Aecotec Stick) and Fibaro Dimmers, RFLink Gateway.
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: HomeWizard P1 Wifi into Domoticz

Post by waltervl »

Make an issue on the GitHub repository of the plugin https://github.com/Eraser3/HomeWizard-Wifi-p1-plugin
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
azonneveld
Posts: 153
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: HomeWizard P1 Wifi into Domoticz

Post 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.
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
AthomeDomotica
Posts: 25
Joined: Monday 26 December 2016 14:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Utrecht
Contact:

Re: HomeWizard P1 Wifi into Domoticz

Post 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 :-)
Domoticz, Controlicz, Philips HUE Gateway and bulbs, Z-Wave (Aecotec Stick) and Fibaro Dimmers, RFLink Gateway.
AthomeDomotica
Posts: 25
Joined: Monday 26 December 2016 14:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Utrecht
Contact:

Re: HomeWizard P1 Wifi into Domoticz

Post 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
Domoticz, Controlicz, Philips HUE Gateway and bulbs, Z-Wave (Aecotec Stick) and Fibaro Dimmers, RFLink Gateway.
Eraser
Posts: 24
Joined: Friday 13 January 2017 9:24
Target OS: Windows
Domoticz version: 3.8153
Contact:

Re: HomeWizard P1 Wifi into Domoticz

Post 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.
Empha88
Posts: 10
Joined: Sunday 28 April 2019 21:24
Target OS: -
Domoticz version:
Contact:

Re: HomeWizard P1 Wifi into Domoticz

Post 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":[]
Empha88
Posts: 10
Joined: Sunday 28 April 2019 21:24
Target OS: -
Domoticz version:
Contact:

Re: HomeWizard P1 Wifi into Domoticz

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

Who is online

Users browsing this forum: No registered users and 1 guest