FIBARO Choice

Created At

Sep 01, 2020

Last Update

Jan 13, 2023

Platforms

HC 3 Lite, Z-box Hub, Yubii Home, Venture WISE, HC 3

Views

5316

Download

515

Type Quick App

Setup:

1. change dataLoggerSN variable to your data logger serial number (this can be found in solarman application)

2. In case of connection problems change inverterIp variable to your sofar inverter IP in your local wifi network  (it should work in auto mode but if not send me a message)

3. If  you still have some problems pleas enable debugs - change debug variable value to true and send me logs from HC user interface with description.

 

v1.3

 

26 Comments,  Want to add comment please login
8e8fdf0c369a69c907067cf4923096df

function QuickApp:createDataFrame() return self:createV5RequestFrame(self.loggerSN) end function QuickApp:createV5RequestFrame(loggerSN) --frame = (headCode) + (dataFieldLength) + (contrlCode) + (sn) + (sn) + (command) + (checksum) + (endCode) self:dbg("createV5RequestFrame: loggerSN:", loggerSN, "<") local frame_hdr = self:fromhex('a5170010450000') local dataFieldPrefix = self:fromhex('020000000000000000000000000000') local command = self:fromhex('01030000002705d0') local defchk = self:fromhex('d8') local endCode = self:fromhex('15') local sn = self:decTohex(loggerSN) sn = sn:sub(9, 10) .. sn:sub(7, 8) .. sn:sub(5, 6) .. sn:sub(3, 4) .. sn:sub(1, 2) sn = self:fromhex(sn) local checkData = self:tohex((frame_hdr .. sn .. dataFieldPrefix .. command):sub(2)) local defchk = 0 for i = 1, string.len(checkData), 2 do defchk = defchk + tonumber(checkData:sub(i, i + 1), 16) end self:dbg("createV5RequestFrame: defchk:", defchk % 256, "<") local defchk = self:fromhex(self:decTohex(defchk % 256)) local frame = frame_hdr .. sn .. dataFieldPrefix .. command .. defchk .. endCode return frame end function QuickApp:fromhex(str) return (str:gsub('..', function (cc) return string.char(tonumber(cc, 16)) end)) end function QuickApp:tohex(str) return (str:gsub('.', function (c) return string.format('%02X', string.byte(c)) end)) end function QuickApp:decTohex(str) return string.format('%02X', tonumber(str)) end --------------------------------------------------------------------------------------------------------------------------- QuickApp.offset = { 1, --#1, len(1) --Inverter Data Address table 2, --#2 Operating state 4, --#3 Fault1 6, --#4 Fault2 8, --#5 Fault3 10, --#6 Fault4 12, --#7 Fault5 --#PV Input Message 14, --#8 PV1 voltage Unit:0.1V 16, --#9 PV1 current Unit:0.01A 18, --#10 PV2 voltage Unit:0.1V 20, --#11 PV2 current Unit:0.01A 22, --#12 PV1 power Unit:0.01kw 24, --#13 PV2 power Unit:0.01kw --Output Grid Message 26, --#14 Output active power Unit:0.01kW 28, --#15 Output reactive power Unit:0.01kVar 30, --#16 Grid frequency Unit:0.01Hz 32, --#17 A-phase voltage Unit:0.1V 34, --#18 A-phase current Unit:0.01A 36, --#19 B-phase voltage Unit:0.1V 38, --#20 B-phase current Unit:0.01A 40, --#21 C-phase voltage Unit:0.1V 42, --#22 C-phase current Unit:0.01A --Inverter Generation message 44, --#23 Total production hi Unit:1kWh 46, --#24 Total production low 48, --#25 Total generation hi Unit:1 hour 50, --#26 Total generation low 52, --#27 Today production Unit:0.01kWh 54, --#28 Today generation time --Inverter inner message 56, --#29 Inverter module temperature 58, --#30 Inverter inner temperature 60, --#31 Inverter Bus voltage Unit:0.1V 62, --#32 PV1 voltage sample by slave CPU Unit:0.1V 64, --#33 PV1 current sample by slave CPU Unit:0.01A 66, --#34 Count-down time 68, --#35 Inverter alert message 70, --#36 Input mode 0x00: in parallal 0x01: in dependent 72, --#37 Communication board inner message 74, --#38 Insulation of PV1+ to ground 76, --#39 Insulation of PV - to ground 78, --#40 Country } -- Energy generated by inverter today in kWh function QuickApp:getTodayEnergy() return self:getShort(QuickApp.offset[27], 100) --Divide by 100 end function QuickApp:getTotalEnergy() return self:getLong(QuickApp.offset[23], 1) --Divide by 1 end function QuickApp:getCurrentEnergy() return self:getShort(QuickApp.offset[14], 100) --Divide by 100 end function QuickApp:getOperatingStateInt() return self:getShort(QuickApp.offset[2], 1) --Divide by 1 end function QuickApp:getOperatingState() local state = self:getOperatingStateInt() if state == 0 then return 'Wait' elseif state == 1 then return 'Check' elseif state == 2 then return 'Normal' elseif state == 3 then return 'Fault' elseif state == 4 then return 'Permanent' end end function QuickApp:getShort(begin, divider) local a_string = self.msgBody:sub(begin, begin + 1) local an_integer = string.unpack(">i2", a_string) if an_integer > 32767 then return float(-(65536 - an_integer)) / divider else return an_integer / divider end end function QuickApp:getLong(begin, divider) local a_string = self.msgBody:sub(begin, begin + 3) return string.unpack(">i4", a_string) end

8e8fdf0c369a69c907067cf4923096df

Je pas arriver à connecté

Cee6357ae30e2934de1ceb862bd7df66

Hello, I have a trouble.... [23.10.2023] [11:49:14] [DEBUG] [QUICKAPP630]: starting... [23.10.2023] [11:49:14] [DEBUG] [QUICKAPP630]: SofarProductionPowerMeter init 631 [23.10.2023] [11:49:14] [DEBUG] [QUICKAPP630]: SofarProductionEnergyMeter init 632 [23.10.2023] [11:49:14] [DEBUG] [QUICKAPP630]: Child devices count: 2 room id: 247 [23.10.2023] [11:49:14] [DEBUG] [QUICKAPP630]: Devices Map count: table: 0xaaab11dad6d0 [23.10.2023] [11:49:14] [DEBUG] [QUICKAPP630]: Stored devices count: 2 [23.10.2023] [11:49:14] [DEBUG] [QUICKAPP630]: Sofar Child devices: [23.10.2023] [11:49:14] [DEBUG] [QUICKAPP630]: [ 632 ] Sofar Production Today , type of: com.fibaro.energyMeter [23.10.2023] [11:49:14] [DEBUG] [QUICKAPP630]: [ 631 ] Sofar Production Power , type of: com.fibaro.powerMeter [23.10.2023] [11:49:14] [DEBUG] [QUICKAPP630]: hc3 ip: 192.168.50.133 [23.10.2023] [11:49:16] [WARNING] [QUICKAPP630]: UDP read Error: Operation canceled [23.10.2023] [11:49:16] [DEBUG] [QUICKAPP630]: data received, closing UDP {} [23.10.2023] [11:49:16] [DEBUG] [QUICKAPP630]: no inverters [23.10.2023] [11:49:16] [DEBUG] [QUICKAPP630]: update child: 1 dead true [23.10.2023] [11:49:16] [DEBUG] [QUICKAPP630]: update child hcDeviceId: 631 [23.10.2023] [11:49:16] [DEBUG] [QUICKAPP630]: update child: 2 dead true [23.10.2023] [11:49:16] [DEBUG] [QUICKAPP630]: update child hcDeviceId: 632 [23.10.2023] [11:49:17] [DEBUG] [QUICKAPP630]: calculateTimeout: 30000 [23.10.2023] [11:49:49] [WARNING] [QUICKAPP630]: UDP read Error: Operation canceled [23.10.2023] [11:49:49] [DEBUG] [QUICKAPP630]: data received, closing UDP {} [23.10.2023] [11:49:49] [DEBUG] [QUICKAPP630]: no inverters [23.10.2023] [11:49:49] [DEBUG] [QUICKAPP630]: update child: 1 dead true [23.10.2023] [11:49:49] [DEBUG] [QUICKAPP630]: update child hcDeviceId: 631 [23.10.2023] [11:49:49] [DEBUG] [QUICKAPP630]: update child: 2 dead true [23.10.2023] [11:49:49] [DEBUG] [QUICKAPP630]: update child hcDeviceId: 632 [23.10.2023] [11:49:49] [DEBUG] [QUICKAPP630]: calculateTimeout: 30000 [23.10.2023] [11:50:21] [WARNING] [QUICKAPP630]: UDP read Error: Operation canceled [23.10.2023] [11:50:21] [DEBUG] [QUICKAPP630]: data received, closing UDP {} [23.10.2023] [11:50:21] [DEBUG] [QUICKAPP630]: no inverters [23.10.2023] [11:50:21] [DEBUG] [QUICKAPP630]: update child: 1 dead true [23.10.2023] [11:50:21] [DEBUG] [QUICKAPP630]: update child hcDeviceId: 631 [23.10.2023] [11:50:21] [DEBUG] [QUICKAPP630]: update child: 2 dead true [23.10.2023] [11:50:21] [DEBUG] [QUICKAPP630]: update child hcDeviceId: 632 [23.10.2023] [11:50:21] [DEBUG] [QUICKAPP630]: calculateTimeout: 30000

3275b3cc6cf22113b6518e3c48b5ede0

Hello, I have a trouble. Fibaro starting communication with Sofar, but: [09.06.2023] [17:35:31] [DEBUG] [QUICKAPP96]: operatingState Fault[09.06.2023] [17:35:31] [DEBUG] [QUICKAPP96]: today 0.0[09.06.2023] [17:35:31] [DEBUG] [QUICKAPP96]: update child: 1 value 0.0[09.06.2023] [17:35:31] [DEBUG] [QUICKAPP96]: update child hcDeviceId: 97[09.06.2023] [17:35:31] [DEBUG] [QUICKAPP96]: update child: 2 value 0.0[09.06.2023] [17:35:31] [DEBUG] [QUICKAPP96]: update child hcDeviceId: 98[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: connect to ip: 10.0.20.134 8899[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: calculateTimeout: 30000[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: connected[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: createV5RequestFrame: loggerSN: 2347825120 <[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: createV5RequestFrame: defchk: 192 <[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: data to send: A5170010450000E0F7F08B02000000000000000000000000000001030000002705D0C015[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: data sent[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: onDataReceived A5610010150013E0F7F08B020193419100890100004805F26301034E0003FFC10581FFFF0002000000000000000000000000000000000000000000000000000000000000000000000000000000290000002700000000000000000000003100000000000000000000041ED19A2815[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: update child: 1 dead false[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: update child hcDeviceId: 97[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: update child: 2 dead false[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: update child hcDeviceId: 98[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: msgBody 4E0003FFC10581FFFF0002000000000000000000000000000000000000000000000000000000000000000000000000000000290000002700000000000000000000003100000000000000000000041ED19A2815[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: operatingState Fault[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: today 0.0[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: update child: 1 value 0.0[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: update child hcDeviceId: 97[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: update child: 2 value 0.0[09.06.2023] [17:36:01] [DEBUG] [QUICKAPP96]: update child hcDeviceId: 98 Can anybody help me? Logger Id, IP address and everything is O.K. Thank you in advance. Tomas

1c1cec0580a9e34236321890b7a8bd37

Czy ktoś ma jakiś pomysł jak skonfigurować sofar solar 8.8 ktl-x g3, mam chyba problem z UDP? [08.06.2023] [11:11:00] [DEBUG] [QUICKAPP1437]: starting... [08.06.2023] [11:11:00] [DEBUG] [QUICKAPP1437]: SofarProductionPowerMeter init 1438 [08.06.2023] [11:11:00] [DEBUG] [QUICKAPP1437]: SofarProductionEnergyMeter init 1439 [08.06.2023] [11:11:00] [DEBUG] [QUICKAPP1437]: Child devices count: 2 room id: 225 [08.06.2023] [11:11:00] [DEBUG] [QUICKAPP1437]: Devices Map count: table: 0xaaaab90ef940 [08.06.2023] [11:11:00] [DEBUG] [QUICKAPP1437]: Stored devices count: 2 [08.06.2023] [11:11:00] [DEBUG] [QUICKAPP1437]: Sofar Child devices: [08.06.2023] [11:11:00] [DEBUG] [QUICKAPP1437]: [ 1438 ] Sofar Production Power , type of: com.fibaro.powerMeter [08.06.2023] [11:11:00] [DEBUG] [QUICKAPP1437]: [ 1439 ] Sofar Production Today , type of: com.fibaro.energyMeter [08.06.2023] [11:11:00] [DEBUG] [QUICKAPP1437]: hc3 ip: 192.168.0.10 [08.06.2023] [11:11:00] [DEBUG] [QUICKAPP1437]: receiveData 192.168.0.11,289C6E8821E6,2347071110 [08.06.2023] [11:11:02] [WARNING] [QUICKAPP1437]: UDP read Error: Operation canceled [08.06.2023] [11:11:02] [DEBUG] [QUICKAPP1437]: data received, closing UDP ["192.168.0.11,289C6E8821E6,2347071110"] [08.06.2023] [11:11:02] [DEBUG] [QUICKAPP1437]: inverter found [08.06.2023] [11:11:02] [DEBUG] [QUICKAPP1437]: update child: 1 dead false [08.06.2023] [11:11:02] [DEBUG] [QUICKAPP1437]: update child hcDeviceId: 1438 [08.06.2023] [11:11:02] [DEBUG] [QUICKAPP1437]: update child: 2 dead false [08.06.2023] [11:11:02] [DEBUG] [QUICKAPP1437]: update child hcDeviceId: 1439 [08.06.2023] [11:11:02] [DEBUG] [QUICKAPP1437]: connect to ip: 192.168.0.11 8899 [08.06.2023] [11:11:02] [DEBUG] [QUICKAPP1437]: calculateTimeout: 30000 [08.06.2023] [11:11:02] [DEBUG] [QUICKAPP1437]: connected [08.06.2023] [11:11:02] [DEBUG] [QUICKAPP1437]: createV5RequestFrame: loggerSN: 2347071110 < [08.06.2023] [11:11:02] [DEBUG] [QUICKAPP1437]: createV5RequestFrame: defchk: 218 < [08.06.2023] [11:11:02] [DEBUG] [QUICKAPP1437]: data to send: A51700104500008676E58B02000000000000000000000000000001030000002705D0DA15 [08.06.2023] [11:11:02] [DEBUG] [QUICKAPP1437]: data sent [08.06.2023] [11:11:03] [DEBUG] [QUICKAPP1437]: onDataReceived A56100101500468676E58B02017CDF0100BF090000AABB7F6401034E0003FFC00581FFFF0002000000000000000000000000000000000000000000000000000000000000000000000000003C00250000001E0000000000000000000000190000000000000000000001728EAB8515 [08.06.2023] [11:11:03] [DEBUG] [QUICKAPP1437]: update child: 1 dead false [08.06.2023] [11:11:03] [DEBUG] [QUICKAPP1437]: update child hcDeviceId: 1438 [08.06.2023] [11:11:03] [DEBUG] [QUICKAPP1437]: update child: 2 dead false [08.06.2023] [11:11:03] [DEBUG] [QUICKAPP1437]: update child hcDeviceId: 1439 [08.06.2023] [11:11:03] [DEBUG] [QUICKAPP1437]: msgBody 4E0003FFC00581FFFF0002000000000000000000000000000000000000000000000000000000000000000000000000003C00250000001E0000000000000000000000190000000000000000000001728EAB8515 [08.06.2023] [11:11:03] [DEBUG] [QUICKAPP1437]: operatingState Fault [08.06.2023] [11:11:03] [DEBUG] [QUICKAPP1437]: today 0.0 [08.06.2023] [11:11:03] [DEBUG] [QUICKAPP1437]: update child: 1 value 0.0 [08.06.2023] [11:11:03] [DEBUG] [QUICKAPP1437]: update child hcDeviceId: 1438 [08.06.2023] [11:11:03] [DEBUG] [QUICKAPP1437]: update child: 2 value 0.0 [08.06.2023] [11:11:03] [DEBUG] [QUICKAPP1437]: update child hcDeviceId: 1439 [08.06.2023] [11:11:32] [DEBUG] [QUICKAPP1437]: connect to ip: 192.168.0.11 8899 [08.06.2023] [11:11:32] [DEBUG] [QUICKAPP1437]: calculateTimeout: 30000 [08.06.2023] [11:11:32] [DEBUG] [QUICKAPP1437]: connected [08.06.2023] [11:11:32] [DEBUG] [QUICKAPP1437]: createV5RequestFrame: loggerSN: 2347071110 < [08.06.2023] [11:11:32] [DEBUG] [QUICKAPP1437]: createV5RequestFrame: defchk: 218 < [08.06.2023] [11:11:32] [DEBUG] [QUICKAPP1437]: data to send: A51700104500008676E58B02000000000000000000000000000001030000002705D0DA15 [08.06.2023] [11:11:32] [DEBUG] [QUICKAPP1437]: data sent [08.06.2023] [11:11:33] [DEBUG] [QUICKAPP1437]: onDataReceived A56100101500478676E58B02019ADF0100DD090000AABB7F6401034E0003FFC00581FFFF0002000000000000000000000000000000000000000000000000000000000000000000000000003C00250000001D000000000000000000000019000000000000000000000173B0205915 [08.06.2023] [11:11:33] [DEBUG] [QUICKAPP1437]: update child: 1 dead false [08.06.2023] [11:11:33] [DEBUG] [QUICKAPP1437]: update child hcDeviceId: 1438 [08.06.2023] [11:11:33] [DEBUG] [QUICKAPP1437]: update child: 2 dead false [08.06.2023] [11:11:33] [DEBUG] [QUICKAPP1437]: update child hcDeviceId: 1439 [08.06.2023] [11:11:33] [DEBUG] [QUICKAPP1437]: msgBody 4E0003FFC00581FFFF0002000000000000000000000000000000000000000000000000000000000000000000000000003C00250000001D000000000000000000000019000000000000000000000173B0205915 [08.06.2023] [11:11:33] [DEBUG] [QUICKAPP1437]: operatingState Fault [08.06.2023] [11:11:33] [DEBUG] [QUICKAPP1437]: today 0.0 [08.06.2023] [11:11:33] [DEBUG] [QUICKAPP1437]: update child: 1 value 0.0 [08.06.2023] [11:11:33] [DEBUG] [QUICKAPP1437]: update child hcDeviceId: 1438 [08.06.2023] [11:11:33] [DEBUG] [QUICKAPP1437]: update child: 2 value 0.0 [08.06.2023] [11:11:33] [DEBUG] [QUICKAPP1437]: update child hcDeviceId: 1439 [08.06.2023] [11:12:02] [DEBUG] [QUICKAPP1437]: connect to ip: 192.168.0.11 8899 [08.06.2023] [11:12:02] [DEBUG] [QUICKAPP1437]: calculateTimeout: 30000 [08.06.2023] [11:12:02] [DEBUG] [QUICKAPP1437]: connected [08.06.2023] [11:12:02] [DEBUG] [QUICKAPP1437]: createV5RequestFrame: loggerSN: 2347071110 < [08.06.2023] [11:12:02] [DEBUG] [QUICKAPP1437]: createV5RequestFrame: defchk: 218 < [08.06.2023] [11:12:02] [DEBUG] [QUICKAPP1437]: data to send: A51700104500008676E58B02000000000000000000000000000001030000002705D0DA15 [08.06.2023] [11:12:03] [DEBUG] [QUICKAPP1437]: data sent [08.06.2023] [11:12:09] [DEBUG] [QUICKAPP1437]: onDataReceived A56100101500488676E58B0201BFDF0100020A0000AABB7F6401034E0007F9868800371565281E9E834064C301110000E9C2000000010000000000000000000000000000000000000000425100000000000000000000000000000000000000000000000000000000000043A74A15 [08.06.2023] [11:12:09] [DEBUG] [QUICKAPP1437]: update child: 1 dead false [08.06.2023] [11:12:09] [DEBUG] [QUICKAPP1437]: update child hcDeviceId: 1438 [08.06.2023] [11:12:09] [DEBUG] [QUICKAPP1437]: update child: 2 dead false [08.06.2023] [11:12:10] [DEBUG] [QUICKAPP1437]: update child hcDeviceId: 1439 [08.06.2023] [11:12:10] [DEBUG] [QUICKAPP1437]: msgBody 4E0007F9868800371565281E9E834064C301110000E9C2000000010000000000000000000000000000000000000000425100000000000000000000000000000000000000000000000000000000000043A74A15 [08.06.2023] [11:12:10] [DEBUG] [QUICKAPP1437]: operatingState [08.06.2023] [11:12:10] [ERROR] [QUICKAPP1437]: QuickApp crashed [08.06.2023] [11:12:10] [ERROR] [QUICKAPP1437]: main.lua:143: attempt to concatenate a nil value (field 'operatingState')