Notifications
Clear all

Instalacja Fotowoltaiczna - Fronius Symo - Fronius Smart Meter -skrypt LUA  

  RSS
gregaicha
(@gregaicha)
Stażysta

Mam problem ze skryptem LUA

Może to być banalne bo to jest pierwszy skrypt który próbuje uruchomić

Dostaje komunikat  Error: EventSystem: Lua script fronius_read_api did not return a commandArray

Wzorowałem się na tym poście http://www.domoticz.com/forum/viewtopic.php?f=61&t=15037&start=20

-- Script to read solardata from FroniusAPI
-- Original Autor : Meulderg http://www.domoticz.com/forum/viewtopic.php?t=15037#p119999
-- Changed to dzVents by glsf91
-- Date : 27-Jan-2019
-- Warning: Don't forget to setup the Local Networks otherwize the device counters won't get updated if site security is used.

return {
active = true,
logging = {
--level = domoticz.LOG_DEBUG, -- Uncomment to override the dzVents global logging setting and use debug
marker = 'Fronius'
},
on = {
timer = {
'every minute'
},
httpResponses = { 'triggerFronius' }
},
execute = function(domoticz,item)

-- Variables to customize ------------------------------------------------
-- If you change the names of the sensor, also change it below
local IPdomiticz = domoticz.variables('172.16.3.3').value -- IP adress of the domoticz service + port
local IPFronius = domoticz.variables('10.1.9.22').value -- IP adress of the Fronius converter
local idx_Fronius_Opbrengst = domoticz.devices('69').idx
local idx_UDC = domoticz.devices('74').idx
local idx_UAC = domoticz.devices('73').idx
local idx_IDC = domoticz.devices('76').idx
local idx_IAC = domoticz.devices('75').idx
local idx_DAY_ENERGY = domoticz.devices('70').idx
local idx_YEAR_ENERGY = domoticz.devices('71').idx
local idx_TOTAL_ENERGY = domoticz.devices('72').idx

--Create Virtual Hardware via JSON script (Copy this URL manualy)
--Change IP, Port and name accordingly
-- http://172.16.3.3:8084/json.htm?type=command&param=addhardware&htype=15&port=1&name=Fronius&enabled=true

--Create Virtual sensors via JSON script (Copy these URL manual)
--Change IP, Port and idx (idx is of the previously created hardware ID) accordingly
-- http://172.16.3.3:8084/json.htm?type=createvirtualsensor&idx=16&sensorname=Fronius_Opbrengst&sensortype=18
--Above sensor needs to be manual adjusted to Type: Return.
-- http://172.16.3.3:8084/json.htm?type=createvirtualsensor&idx=16&sensorname=Fronius_Day_Energy&sensortype=248 Ander type ??
-- http://172.16.3.3:8084/json.htm?type=createvirtualsensor&idx=16&sensorname=Fronius_Year_Energy&sensortype=248 Ander type ??
-- http://172.16.3.3:8084/json.htm?type=createvirtualsensor&idx=16&sensorname=Fronius_Total_Energy&sensortype=248 Ander type ??
-- http://172.16.3.3:8084/json.htm?type=createvirtualsensor&idx=16&sensorname=Fronius_UAC&sensortype=4
-- http://172.16.3.3:8084/json.htm?type=createvirtualsensor&idx=16&sensorname=Fronius_UDC&sensortype=4
-- http://172.16.3.3:8084/json.htm?type=createvirtualsensor&idx=16&sensorname=Fronius_IAC&sensortype=19
-- http://172.16.3.3:8084/json.htm?type=createvirtualsensor&idx=16&sensorname=Fronius_IDC&sensortype=19

-- one-time load of the routines
-- JSON = (loadfile "C:\\Domoticz\\scripts\\lua\\json.lua")() -- For Windows
local json = assert(loadfile "/home/pi/domoticz/scripts/lua/JSON.lua")() -- For Linux

domoticz.log('Fronius script running', domoticz.LOG_DEBUG)

if (item.isTimer) then
-- get current time & calculate sunrise and sunset.
time_now = os.date("*t")
minutes_now = time_now.min + time_now.hour * 60

domoticz.log('Time in minutes: ' ..minutes_now, domoticz.LOG_DEBUG)
domoticz.log('Sunrise in minutes: ' ..timeofday['SunriseInMinutes'] - 60, domoticz.LOG_DEBUG)
domoticz.log('Sunset in minutes: ' ..timeofday['SunsetInMinutes'] + 60, domoticz.LOG_DEBUG)

-- Validation for sunrise and sunset.
if (minutes_now > timeofday['SunriseInMinutes'] - 30) and (minutes_now < timeofday['SunsetInMinutes'] + 30) then
domoticz.log('Call Fronius url with callback', domoticz.LOG_DEBUG)
-- ASYNC openUrl
domoticz.openURL({
url = 'http://'..IPFronius..'/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceID=1&DataCollection=CommonInverterData',
method = 'GET',
callback = 'triggerFronius'
})
else
domoticz.log('Fronius inverter Offline because of SunSet', domoticz.LOG_INFO)
end
end

if (item.isHTTPResponse and item.ok) then
domoticz.log('Callback from url requested', domoticz.LOG_DEBUG)
domoticz.log('Data: '..item.data, domoticz.LOG_DEBUG)

-- we know it is json but dzVents cannot detect this if there is no correct Content-Type
-- convert to Lua
local jsonfroniusdata = domoticz.utils.fromJSON(item.data)
-- json is now a Lua table

if (jsonfroniusdata == nil) then
domoticz.log('Fronius inverter data is empty', domoticz.LOG_ERROR)
return
end

-- request successfull ?
if ( jsonfroniusdata.Head.Status.Code ~= 0 ) then
domoticz.log('Fronius inverter head status code data is not 0', domoticz.LOG_ERROR)
domoticz.log('Status code: ' + jsonfroniusdata.Head.Status.Code + ' Reason: ' + jsonfroniusdata.Head.Status.Reason + ' User message: ' + jsonfroniusdata.Head.Status.UserMessage, domoticz.LOG_ERROR)
return
end


local StatusCode = jsonfroniusdata.Body.Data.DeviceStatus.StatusCode
domoticz.log('json froniusdata Statuscode: '..StatusCode, domoticz.LOG_DEBUG)

if ( StatusCode == 7) then --Fronius converter is Running

local DAY_ENERGY = jsonfroniusdata.Body.Data.DAY_ENERGY.Value
local YEAR_ENERGY = jsonfroniusdata.Body.Data.YEAR_ENERGY.Value
local TOTAL_ENERGY = jsonfroniusdata.Body.Data.TOTAL_ENERGY.Value
local PAC = jsonfroniusdata.Body.Data.PAC.Value
local UDC = jsonfroniusdata.Body.Data.UDC.Value
local UAC = jsonfroniusdata.Body.Data.UAC.Value
local IDC = jsonfroniusdata.Body.Data.IDC.Value
local IAC = jsonfroniusdata.Body.Data.IAC.Value

domoticz.log('PAC: '..PAC, domoticz.LOG_DEBUG)
domoticz.log('Day Energy: '..DAY_ENERGY, domoticz.LOG_DEBUG)
domoticz.log('Year Energy: '..YEAR_ENERGY, domoticz.LOG_DEBUG)
domoticz.log('Total Energy: '..TOTAL_ENERGY, domoticz.LOG_DEBUG)
domoticz.log('UDC: '..UDC, domoticz.LOG_DEBUG)
domoticz.log('UAC: '..UAC, domoticz.LOG_DEBUG)
domoticz.log('IDC: '..IDC, domoticz.LOG_DEBUG)
domoticz.log('IAC: '..IAC, domoticz.LOG_DEBUG)

--domoticz.devices('Fronius_UDC').updateVoltage(UDC)
--domoticz.devices('Fronius_UAC').updateVoltage(UAC)
--domoticz.devices('Fronius_IDC').updateCurrent(IDC)
--domoticz.devices('Fronius_IAC').updateCurrent(IAC)
--domoticz.devices('Fronius_Day_Energy').updateEnergy(DAY_ENERGY)
--domoticz.devices('Fronius_Year_Energy').updateEnergy(YEAR_ENERGY)
--domoticz.devices('Fronius_Total_Energy').updateEnergy(TOTAL_ENERGY)
--domoticz.devices('Fronius_Opbrengst').updateElectricity(PAC,DAY_ENERGY)

-- to trigger also influxdb update. replaced with the url
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_UDC..'&nvalue=0&svalue='..UDC)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_IDC..'&nvalue=0&svalue='..IDC)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_UAC..'&nvalue=0&svalue='..UAC)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_IAC..'&nvalue=0&svalue='..IAC)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_DAY_ENERGY..'&nvalue=0&svalue='..DAY_ENERGY)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_YEAR_ENERGY..'&nvalue=0&svalue='..YEAR_ENERGY)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_TOTAL_ENERGY..'&nvalue=0&svalue='..TOTAL_ENERGY)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_Fronius_Opbrengst..'&nvalue=0&svalue='..PAC..';'..DAY_ENERGY)

else
domoticz.log('Fronius converter state (Statuscode:'..StatusCode..') other than running', domoticz.LOG_INFO)
local UDC = 0 local UAC = 0 local IDC = 0 local IAC = 0

--domoticz.devices('Fronius_UDC').updateVoltage(0)
--domoticz.devices('Fronius_UAC').updateVoltage(0)
--domoticz.devices('Fronius_IDC').updateCurrent(0)
--domoticz.devices('Fronius_IAC').updateCurrent(0)

-- to trigger also influxdb update. replaced with the url
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_UDC..'&nvalue=0&svalue='..UDC)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_IDC..'&nvalue=0&svalue='..IDC)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_UAC..'&nvalue=0&svalue='..UAC)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_IAC..'&nvalue=0&svalue='..IAC)
end

end
end

}

po otworzeniu u mnie tej strony

http://10.1.9.22/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceID=1&DataCollection=CommonInverterData

dostaje odpowiedz z api froniusa która wygląda tak



{
"Body" : {
"Data" : {
"DAY_ENERGY" : {
"Unit" : "Wh",
"Value" : 1122.4000000000001
},
"DeviceStatus" : {
"ErrorCode" : 0,
"LEDColor" : 2,
"LEDState" : 0,
"MgmtTimerRemainingTime" : -1,
"StateToReset" : false,
"StatusCode" : 7
},
"FAC" : {
"Unit" : "Hz",
"Value" : 49.969999999999999
},
"IAC" : {
"Unit" : "A",
"Value" : 2.46
},
"IDC" : {
"Unit" : "A",
"Value" : 1.3999999999999999
},
"PAC" : {
"Unit" : "W",
"Value" : 577
},
"TOTAL_ENERGY" : {
"Unit" : "Wh",
"Value" : 383289
},
"UAC" : {
"Unit" : "V",
"Value" : 232.09999999999999
},
"UDC" : {
"Unit" : "V",
"Value" : 465.19999999999999
},
"YEAR_ENERGY" : {
"Unit" : "Wh",
"Value" : 383289.31
}
}
},
"Head" : {
"RequestArguments" : {
"DataCollection" : "CommonInverterData",
"DeviceClass" : "Inverter",
"DeviceId" : "1",
"Scope" : "Device"
},
"Status" : {
"Code" : 0,
"Reason" : "",
"UserMessage" : ""
},
"Timestamp" : "2019-04-30T09:21:49+02:00"
}
}

Cytuj
Dodane : 30/04/2019 12:52 am
isom
 isom
(@isom)
Prezes Moderator Zasłużony dla Forum, Donator 2019, Donator 2K20

@gregaicha tak na szybko to  przede wszystkim nie jest to skrypt LUA  przeczytaj trzecią linię początkowych komentarzy , czyli musisz to zmienić na dzVents ,  dalej to na pewno w zmiennej IPdomoticz oprócz IP domoticza trzeba dodać port , reszta pewnie wyjdzie w praniu

Radze przy próbach odkomentować czyli usunąć to -- przy

--level = domoticz.LOG_DEBUG,
OdpowiedzCytuj
Dodane : 30/04/2019 8:43 am
gregaicha
(@gregaicha)
Stażysta

Dziękuje za dzVents tego nie widziałem 🙂

co do tego IP to analizowałem i wydaje mi się że nie powinno być tam portu ale mogę się mylić.

taki błąd teraz dostaję:



2019-04-30 09:11:00.559 Status: dzVents: Info: Fronius: ------ Start internal script: fronius_dzVents:, trigger: every minute

2019-04-30 09:11:00.559 Status: dzVents: Error (2.4.6): Fronius: There is no uservariable with that name or id: 172.16.3.3:8084

2019-04-30 09:11:00.559 Status: dzVents: Error (2.4.6): Fronius: An error occured when calling event handler fronius_dzVents

2019-04-30 09:11:00.559 Status: dzVents: Error (2.4.6): Fronius: ...cz/scripts/dzVents/generated_scripts/fronius_dzVents.lua:23: attempt to index a nil value

2019-04-30 09:11:00.559 Status: dzVents: Info: Fronius: ------ Finished fronius_dzVents

2019-04-30 09:11:33.121 (DS18B20) Temp (Garaz temperatura)

2019-04-30 09:11:40.074 Status: EventSystem: reset all events...

2019-04-30 09:11:40.076 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/fronius_dzVents.lua

2019-04-30 09:12:00.572 Status: dzVents: Info: Fronius: ------ Start internal script: fronius_dzVents:, trigger: every minute

2019-04-30 09:12:00.573 Status: dzVents: Error (2.4.6): Fronius: There is no uservariable with that name or id: 172.16.3.3

2019-04-30 09:12:00.573 Status: dzVents: Error (2.4.6): Fronius: An error occured when calling event handler fronius_dzVents

2019-04-30 09:12:00.573 Status: dzVents: Error (2.4.6): Fronius: ...cz/scripts/dzVents/generated_scripts/fronius_dzVents.lua:23: attempt to index a nil value

2019-04-30 09:12:00.573 Status: dzVents: Info: Fronius: ------ Finished fronius_dzVents

W skrypcie jest napisane ze

local IPdomiticz = domoticz.variables('172.16.3.3').value -- IP adress of the domoticz service + port

ale póżniejc we wszystkich uzycieach tej zmiennje dopisany jest port

 domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_UDC..'&nvalue=0&svalue='..UDC)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_IDC..'&nvalue=0&svalue='..IDC)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_UAC..'&nvalue=0&svalue='..UAC)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_IAC..'&nvalue=0&svalue='..IAC)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_DAY_ENERGY..'&nvalue=0&svalue='..DAY_ENERGY)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_YEAR_ENERGY..'&nvalue=0&svalue='..YEAR_ENERGY)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_TOTAL_ENERGY..'&nvalue=0&svalue='..TOTAL_ENERGY)
domoticz.openURL('http://'..IPdomiticz..':8084/json.htm?type=command&param=udevice&idx='..idx_Fronius_Opbrengst..'&nvalue=0&svalue='..PAC..';'..DAY_ENERGY)
OdpowiedzCytuj
Dodane : 30/04/2019 9:20 am
isom
 isom
(@isom)
Prezes Moderator Zasłużony dla Forum, Donator 2019, Donator 2K20

Błąd pierwszy to brak zmiennej użytkownika która ma wyglądać 172.16.3.3:8084

Kolejny to linnia 23 w skrypcie jest niepoprawna , jak liczę to wychodzi mi że to dotyczy zmiennej IPdomoticz.

OdpowiedzCytuj
Dodane : 30/04/2019 10:23 am
gregaicha
(@gregaicha)
Stażysta

to nie jest delkaracja zmiennej ??

local IPdomiticz = domoticz.variables('172.16.3.3').value
probowalem tez tak

local IPdomiticz = domoticz.variables('172.16.3.3:8084').value -

ale to nic nie zmienia

OdpowiedzCytuj
Dodane : 30/04/2019 10:49 am
isom
 isom
(@isom)
Prezes Moderator Zasłużony dla Forum, Donator 2019, Donator 2K20

a w zmiennych użytkownika  co kolega ma ? Konfiguracja -- Zmienne użytkownika

OdpowiedzCytuj
Dodane : 30/04/2019 10:51 am
gregaicha
(@gregaicha)
Stażysta

nie za wiele

widzę ze pod 3 mam domoticz url z obrazu a nie swój
moj adres domoticza to 172.16.3.3 dobrze myślę ??
czy powinienem dodać tu zmienna
IPdomiticz
IPFronius

jak je zadeklarować ??
OdpowiedzCytuj
Dodane : 30/04/2019 12:53 pm
isom
 isom
(@isom)
Prezes Moderator Zasłużony dla Forum, Donator 2019, Donator 2K20

Usuń zmienne dotyczące framb0ise2 bo to są pozostałości po panelu , którego już nie ma , czyli zmienne 3 do 6 to śmieci i dodaj sobie dwie zmienne potrzebne do wykonania tego skryptu  deklarujesz je jako ciąg znaków

OdpowiedzCytuj
Dodane : 30/04/2019 1:17 pm
gregaicha
(@gregaicha)
Stażysta

po zadeklarowaniu takich zmiennych

nic się nie zmieniło

raz próbowałem z portem raz bez portu to samo

2019-04-30 15:09:00.445 Status: dzVents: Error (2.4.6): Fronius: There is no uservariable with that name or id: 172.16.3.3

2019-04-30 15:09:00.445 Status: dzVents: Error (2.4.6): Fronius: An error occured when calling event handler fronius_dzVents

2019-04-30 15:09:00.445 Status: dzVents: Error (2.4.6): Fronius: ...cz/scripts/dzVents/generated_scripts/fronius_dzVents.lua:23: attempt to index a nil value

2019-04-30 15:09:00.445 Status: dzVents: Info: Fronius: ------ Finished fronius_dzVents

2019-04-30 15:09:05.413 (DS18B20) Temp (Temperatura na zewnatrz)

2019-04-30 15:09:15.363 Status: EventSystem: reset all events...

2019-04-30 15:09:15.364 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/fronius_dzVents.lua

2019-04-30 15:09:27.729 (Xiaomi) Light/Switch (Czujka ruchu Xiaomi)

2019-04-30 15:10:00.479 Status: dzVents: Info: Fronius: ------ Start internal script: fronius_dzVents:, trigger: every minute

2019-04-30 15:10:00.479 Status: dzVents: Error (2.4.6): Fronius: There is no uservariable with that name or id: 172.16.3.3:8084

2019-04-30 15:10:00.479 Status: dzVents: Error (2.4.6): Fronius: An error occured when calling event handler fronius_dzVents

2019-04-30 15:10:00.479 Status: dzVents: Error (2.4.6): Fronius: ...cz/scripts/dzVents/generated_scripts/fronius_dzVents.lua:23: attempt to index a nil value

2019-04-30 15:10:00.479 Status: dzVents: Info: Fronius: ------ Finished fronius_dzVents
OdpowiedzCytuj
Dodane : 30/04/2019 3:13 pm
gregaicha
(@gregaicha)
Stażysta

Działa :)))

Bardzo ale to bardzo dziękuje za pomoc :)))

Problem wynikał oczywiście z mojej słabej wiedzy programistycznej

powinno być tak 

local IPdomiticz = '172.16.3.3'
local IPFronius = '10.1.9.22'
local idx_Fronius_Opbrengst ='69'
local idx_UDC = '74'
local idx_UAC = '73'
local idx_IDC = '76'
local idx_IAC = '75'
local idx_DAY_ENERGY = '70'
local idx_YEAR_ENERGY = '71'
local idx_TOTAL_ENERGY = '72'

a ja próbowałem tak



local IPdomiticz = domoticz.variables('172.16.3.3').value -- IP adress of the domoticz service + port
local IPFronius = domoticz.variables('10.1.9.22').value -- IP adress of the Fronius converter
local idx_Fronius_Opbrengst = domoticz.devices('69').idx
local idx_UDC = domoticz.devices('74').idx
local idx_UAC = domoticz.devices('73').idx
local idx_IDC = domoticz.devices('76').idx
local idx_IAC = domoticz.devices('75').idx
local idx_DAY_ENERGY = domoticz.devices('70').idx
local idx_YEAR_ENERGY = domoticz.devices('71').idx
local idx_TOTAL_ENERGY = domoticz.devices('72').idx


A tak wygląda log z działania :)

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: callback = nil


2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=73&nvalue=0&svalue=234.7

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=75&nvalue=0&svalue=27.6

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=70&nvalue=0&svalue=27653

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=71&nvalue=0&svalue=409822.72

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:27:01.914 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:27:01.915 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:27:01.915 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:27:01.915 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=72&nvalue=0&svalue=409822.03

2019-04-30 15:27:01.915 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:27:01.915 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:27:01.915 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:27:01.915 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:27:01.915 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=69&nvalue=0&svalue=6509;27653

2019-04-30 15:27:01.915 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:27:01.915 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:27:01.915 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:27:01.915 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:27:01.915 Status: dzVents: Info: Fronius: ------ Finished fronius_dzVents

2019-04-30 15:27:01.916 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua

2019-04-30 15:27:04.974 (Xiaomi) General/kWh (Akwarium)

2019-04-30 15:28:00.173 Status: dzVents: Info: Fronius: ------ Start internal script: fronius_dzVents:, trigger: every minute

2019-04-30 15:28:00.178 Status: dzVents: Debug: Fronius: Fronius script running

2019-04-30 15:28:00.178 Status: dzVents: Debug: Fronius: Time in minutes: 928

2019-04-30 15:28:00.178 Status: dzVents: Debug: Fronius: Sunrise in minutes: 269

2019-04-30 15:28:00.178 Status: dzVents: Debug: Fronius: Sunset in minutes: 1284

2019-04-30 15:28:00.178 Status: dzVents: Debug: Fronius: Call Fronius url with callback

2019-04-30 15:28:00.178 Status: dzVents: Debug: Fronius: OpenURL: url = http://10.1.9.22/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceID=1&DataCollection=CommonInverterData

2019-04-30 15:28:00.178 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:28:00.178 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:28:00.178 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:28:00.178 Status: dzVents: Debug: Fronius: OpenURL: callback = triggerFronius

2019-04-30 15:28:00.178 Status: dzVents: Info: Fronius: ------ Finished fronius_dzVents

2019-04-30 15:28:00.287 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua

2019-04-30 15:28:01.909 Status: dzVents: Info: Handling httpResponse-events for: "triggerFronius

2019-04-30 15:28:01.910 Status: dzVents: Info: Fronius: ------ Start internal script: fronius_dzVents: HTTPResponse: "triggerFronius"

2019-04-30 15:28:01.931 Status: dzVents: Debug: Fronius: Fronius script running

2019-04-30 15:28:01.931 Status: dzVents: Debug: Fronius: Callback from url requested

2019-04-30 15:28:01.931 Status: dzVents: Debug: Fronius: Data: {

2019-04-30 15:28:01.931 "Body" : {

2019-04-30 15:28:01.931 "Data" : {

2019-04-30 15:28:01.931 "DAY_ENERGY" : {

2019-04-30 15:28:01.931 "Unit" : "Wh",

2019-04-30 15:28:01.931 "Value" : 27763

2019-04-30 15:28:01.931 },

2019-04-30 15:28:01.931 "DeviceStatus" : {

2019-04-30 15:28:01.931 "ErrorCode" : 0,

2019-04-30 15:28:01.931 "LEDColor" : 2,

2019-04-30 15:28:01.931 "LEDState" : 0,

2019-04-30 15:28:01.931 "MgmtTimerRemainingTime" : -1,

2019-04-30 15:28:01.931 "StateToReset" : false,

2019-04-30 15:28:01.931 "StatusCode" : 7

2019-04-30 15:28:01.931 },

2019-04-30 15:28:01.931 "FAC" : {

2019-04-30 15:28:01.931 "Unit" : "Hz",

2019-04-30 15:28:01.931 "Value" : 49.969999999999999

2019-04-30 15:28:01.931 },

2019-04-30 15:28:01.931 "IAC" : {

2019-04-30 15:28:01.931 "Unit" : "A",

2019-04-30 15:28:01.931 "Value" : 27.66

2019-04-30 15:28:01.931 },

2019-04-30 15:28:01.931 "IDC" : {

2019-04-30 15:28:01.931 "Unit" : "A",

2019-04-30 15:28:01.931 "Value" : 17.32

2019-04-30 15:28:01.931 },

2019-04-30 15:28:01.931 "PAC" : {

2019-04-30 15:28:01.931 "Unit" : "W",

2019-04-30 15:28:01.931 "Value" : 6518

2019-04-30 15:28:01.931 },

2019-04-30 15:28:01.931 "TOTAL_ENERGY" : {

2019-04-30 15:28:01.931 "Unit" : "Wh",

2019-04-30 15:28:01.931 "Value" : 409931.03000000003

2019-04-30 15:28:01.931 },

2019-04-30 15:28:01.931 "UAC" : {

2019-04-30 15:28:01.931 "Unit" : "V",

2019-04-30 15:28:01.931 "Value" : 235.09999999999999

2019-04-30 15:28:01.931 },

2019-04-30 15:28:01.931 "UDC" : {

2019-04-30 15:28:01.931 "Unit" : "V",

2019-04-30 15:28:01.931 "Value" : 404.60000000000002

2019-04-30 15:28:01.931 },

2019-04-30 15:28:01.931 "YEAR_ENERGY" : {

2019-04-30 15:28:01.931 "Unit" : "Wh",

2019-04-30 15:28:01.931 "Value" : 409931.90999999997

2019-04-30 15:28:01.931 }

2019-04-30 15:28:01.931 }

2019-04-30 15:28:01.931 },

2019-04-30 15:28:01.931 "Head" : {

2019-04-30 15:28:01.931 "RequestArguments" : {

2019-04-30 15:28:01.931 "DataCollection" : "CommonInverterData",

2019-04-30 15:28:01.931 "DeviceClass" : "Inverter",

2019-04-30 15:28:01.931 "DeviceId" : "1",

2019-04-30 15:28:01.931 "Scope" : "Device"

2019-04-30 15:28:01.931 },

2019-04-30 15:28:01.931 "Status" : {

2019-04-30 15:28:01.931 "Code" : 0,

2019-04-30 15:28:01.931 "Reason" : "",

2019-04-30 15:28:01.931 "UserMessage" : ""

2019-04-30 15:28:01.931 },

2019-04-30 15:28:01.931 "Timestamp" : "2019-04-30T15:28:00+02:00"

2019-04-30 15:28:01.931 }

2019-04-30 15:28:01.931 }

2019-04-30 15:28:01.931

2019-04-30 15:28:01.935 Status: dzVents: Debug: Fronius: json froniusdata Statuscode: 7

2019-04-30 15:28:01.935 Status: dzVents: Debug: Fronius: PAC: 6518

2019-04-30 15:28:01.935 Status: dzVents: Debug: Fronius: Day Energy: 27763

2019-04-30 15:28:01.935 Status: dzVents: Debug: Fronius: Year Energy: 409931.91

2019-04-30 15:28:01.935 Status: dzVents: Debug: Fronius: Total Energy: 409931.03

2019-04-30 15:28:01.935 Status: dzVents: Debug: Fronius: UDC: 404.6

2019-04-30 15:28:01.935 Status: dzVents: Debug: Fronius: UAC: 235.1

2019-04-30 15:28:01.935 Status: dzVents: Debug: Fronius: IDC: 17.32

2019-04-30 15:28:01.935 Status: dzVents: Debug: Fronius: IAC: 27.66

2019-04-30 15:28:01.935 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=74&nvalue=0&svalue=404.6

2019-04-30 15:28:01.935 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:28:01.935 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:28:01.936 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:28:01.936 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:28:01.936 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=76&nvalue=0&svalue=17.32

2019-04-30 15:28:01.936 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:28:01.936 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:28:01.936 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:28:01.936 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:28:01.936 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=73&nvalue=0&svalue=235.1

2019-04-30 15:28:01.936 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:28:01.936 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:28:01.937 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:28:01.937 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:28:01.937 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=75&nvalue=0&svalue=27.66

2019-04-30 15:28:01.937 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:28:01.937 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:28:01.937 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:28:01.937 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:28:01.937 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=70&nvalue=0&svalue=27763

2019-04-30 15:28:01.937 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:28:01.938 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:28:01.938 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:28:01.938 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:28:01.938 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=71&nvalue=0&svalue=409931.91

2019-04-30 15:28:01.938 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:28:01.938 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:28:01.938 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:28:01.938 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:28:01.938 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=72&nvalue=0&svalue=409931.03

2019-04-30 15:28:01.938 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:28:01.939 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:28:01.939 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:28:01.939 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:28:01.939 Status: dzVents: Debug: Fronius: OpenURL: url = http://172.16.3.3:8084/json.htm?type=command&param=udevice&idx=69&nvalue=0&svalue=6518;27763

2019-04-30 15:28:01.939 Status: dzVents: Debug: Fronius: OpenURL: method = GET

2019-04-30 15:28:01.939 Status: dzVents: Debug: Fronius: OpenURL: post data = nil

2019-04-30 15:28:01.939 Status: dzVents: Debug: Fronius: OpenURL: headers = nil

2019-04-30 15:28:01.939 Status: dzVents: Debug: Fronius: OpenURL: callback = nil

2019-04-30 15:28:01.939 Status: dzVents: Info: Fronius: ------ Finished fronius_dzVents

2019-04-30 15:28:01.940 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
OdpowiedzCytuj
Dodane : 30/04/2019 3:32 pm
Kamil Rusztyn
(@fb_-kamilrusztyn)
Nowy

Dzień dobry,

staram się uporać z tym skryptem w moim domoticzu, ale natrafiłem na przeszkodę. Dzięki Waszym powyższym sugestiom udało się już wdrożyć działający skrypt, ale jest problem z aktualizacją urządzeń - wywala błędy jak poniżej:

Kiedy ręcznie skopiuje link i go odpalę w przeglądarce to ładnie się urządzenia aktualizują.

Jeżeli ktoś może mnie pokierować co dalej sprawdzić to będę bardzo wdzięczny.

Edit: zapomniałem dodać adresu ip do sieci lokalnych w ustawieniach > teraz działa.

2019-09-09 18:35:02.953 Error: Error opening url:  http://192.168.178.22:8080/json.htm?type=command&param=udevice&idx=35&nvalue=0&svalue=418 
2019-09-09 18:35:02.968 Error: Error opening url: http://192.168.178.22:8080/json.htm?type=command&param=udevice&idx=37&nvalue=0&svalue=0.18
2019-09-09 18:35:02.972 Error: Error opening url: http://192.168.178.22:8080/json.htm?type=command&param=udevice&idx=34&nvalue=0&svalue=238.5
2019-09-09 18:35:02.976 Error: Error opening url: http://192.168.178.22:8080/json.htm?type=command&param=udevice&idx=36&nvalue=0&svalue=0.2
2019-09-09 18:35:02.980 Error: Error opening url: http://192.168.178.22:8080/json.htm?type=command&param=udevice&idx=30&nvalue=0&svalue=9878
2019-09-09 18:35:02.987 Error: Error opening url: http://192.168.178.22:8080/json.htm?type=command&param=udevice&idx=32&nvalue=0&svalue=2378731.25
2019-09-09 18:35:02.995 Error: Error opening url: http://192.168.178.22:8080/json.htm?type=command&param=udevice&idx=33&nvalue=0&svalue=2378729.75
2019-09-09 18:35:03.000 Error: Error opening url: http://192.168.178.22:8080/json.htm?type=command&param=udevice&idx=31&nvalue=0&svalue=31;9878





OdpowiedzCytuj
Dodane : 09/09/2019 6:50 pm
Udostępnij: