Page 7 of 12
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Thursday 04 April 2019 11:51
by ABRB55
with "jankees" getPVData script I get the same error;
Ah I see. Than I guess you are using a different inverter model or firmware?
I a have the Omnik3000tl with firmware version (main)V4.08Build215 / (slave)V4.12Build246.
Can you read the current power, total today and overall total from the website of your inverter?
Code: Select all
File "OmnikGetPV.py", line 46, in <module>
etotal1000 = float(totalOveral) * float(multiply)
ValueError: could not convert string to float: stylecolor:#666666font-weight:bold></div><divclasscl></div><divclassline></div><divclasslab_l2stylecolor:#666666font-weight:boldidtx9></div><divclasslab_r2
I have a omnik3000tl / NL1-V1.0-0108-4 / V2.0-0028
and I can read the current power, total today and overall total from the inverter website.
When I inspect source this is what on the page - where the now value = 1292:
Code: Select all
<div class="lab_r2" id="webdata_now_p" style="color:#666666;font-weight:bold;">1292 W</div>
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Friday 05 April 2019 13:21
by jankees
ABRB55 wrote: ↑Thursday 04 April 2019 11:51
with "jankees" getPVData script I get the same error;
Ah I see. Than I guess you are using a different inverter model or firmware?
I a have the Omnik3000tl with firmware version (main)V4.08Build215 / (slave)V4.12Build246.
Can you read the current power, total today and overall total from the website of your inverter?
Code: Select all
File "OmnikGetPV.py", line 46, in <module>
etotal1000 = float(totalOveral) * float(multiply)
ValueError: could not convert string to float: stylecolor:#666666font-weight:bold></div><divclasscl></div><divclassline></div><divclasslab_l2stylecolor:#666666font-weight:boldidtx9></div><divclasslab_r2
I have a omnik3000tl / NL1-V1.0-0108-4 / V2.0-0028
and I can read the current power, total today and overall total from the inverter website.
When I inspect source this is what on the page - where the now value = 1292:
Code: Select all
<div class="lab_r2" id="webdata_now_p" style="color:#666666;font-weight:bold;">1292 W</div>
I see that the firmware versions do differ.
But what the script does is scrap the status.hml website. When you view this in the browser you only see lines, but in the source the javascript variables are filled with the correct data. This wil happen each time when you request the site.
This is also what happens when you call up the main page. The data that you see is shown by javascript script
. However, I cannot process this with the standard python because the python scraper does not support javascript. That is why I use the piece of javascript in the header in which the variables are filled.
Possibly due to the firmware difference your html code might be different. You can find out if this is the case by requesting the status.html page and activating the developer mode in Internet Explorer or another browser (usually F12).
https://pasteboard.co/I8IB8qQ.jpg
In the getPVData.sh script I search the downloaded html code for the name of the variable that contains the value that I want to use. It is possible that another variable is being used in your version of the firmware, so that it can't find it.
I am curious what is in your status.html?
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Friday 05 April 2019 20:21
by ABRB55
status.html with my firmware stores different information.
I'm doubting to ask for a firmware upgrade.
https://pasteboard.co/I8Ln4Jc.jpg
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Monday 08 April 2019 8:35
by rednas
Can you check the contents of your status.js? I found out the information of my inverter is logged in there.
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Monday 08 April 2019 13:29
by ABRB55
Can you check the contents of your status.js? I found out the information of my inverter is logged in there.
/js/status.js shows the values; (current power 2172 - Yield Today 474 - Total Yield 119725)
https://pasteboard.co/I9aWZqG.jpg
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Monday 08 April 2019 13:44
by rednas
Is your Domoticz running on the same network as your inverter?
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Monday 08 April 2019 13:56
by ABRB55
yes, it's on the same network.
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Monday 08 April 2019 14:06
by rednas
This is the code I use to scrape the info from the status.js file.
Modify it with your ip, username and password for logging into the webpage of the inverter. Also modify the idx of the sensors mentioned in the script.
Code: Select all
-- https://www.domoticz.com/forum/viewtopic.php?f=65&t=7941
return {
on = {
timer = { "every minute" },
httpResponses = { 'trigger-solar-data' }
},
logging = {
--level = domoticz.LOG_DEBUG, -- for debugging
--level = domoticz.LOG_INFO,
marker = "Zonnepanelen"
},
execute = function(domoticz, item)
ip = '192.168.x.xxx' --ip address of the solar inverter
user = 'xxx' --user name for solar inverter
pw = 'xxx' --password for solar inverter
Electric_meter_idx = 259 --kWhcounter
E_today_idx = 268 --custom
E_total_idx = 269 --custom
E_total_c_idx = 270 --counter
E_power_idx = 264 --energy
function update_kWhcounter_devc(devc, power, energy)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).usage ~= power or domoticz.devices(devc).WhTotal ~= energy) then
domoticz.devices(devc).updateElectricity(power, energy)
--end
end
end
function update_custom_devc(devc, value)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).state ~= value) then
domoticz.devices(devc).updateCustomSensor(value)
--end
end
end
function update_counterkWh_devc(devc, value)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).counter*1000 ~= value) then
domoticz.devices(devc).updateCounter(value)
--end
end
end
function update_energy_devc(devc, value)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).WhActual ~= value) then
domoticz.devices(devc).updateEnergy(value)
--end
end
end
function split(s, delimiter)
result = {};
for match in (s..delimiter):gmatch("(.-)"..delimiter) do
table.insert(result, match);
end
return result;
end
if (item.isTimer) then
requestURL = 'http://'..user..':'..pw..'@'..ip..'/js/status.js'
domoticz.openURL({
url = requestURL,
--method = 'GET',
callback = 'trigger-solar-data'
})
end
if (item.isHTTPResponse and item.ok) then
-- check to which request this response was the result
if (item.trigger == 'trigger-solar-data') then
--domoticz.log(item.data)
idata = string.match(item.data, 'myDeviceArray%[0%]="(.-)";')
--domoticz.log(idata)
s = split(idata, ",")
--for key, value in pairs(s) do
-- print(key..'='..value)
--end
powerW = s[6] -- in W
etoday = s[7]/100 -- in kWh
etotal = s[8]/10 -- in kWh
domoticz.log("Power: "..powerW.." W",domoticz.LOG_FORCE)
domoticz.log("Today: "..etoday.." kWh",domoticz.LOG_FORCE)
domoticz.log("Total: "..etotal.." kWh",domoticz.LOG_FORCE)
update_kWhcounter_devc(Electric_meter_idx, powerW, etotal*1000)
update_custom_devc(E_today_idx, etoday)
update_custom_devc(E_total_idx, etotal)
update_counterkWh_devc(E_total_c_idx, etotal*1000)
update_energy_devc(E_power_idx, powerW)
end
end
end
}
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Monday 08 April 2019 14:16
by jankees
rednas wrote: ↑Monday 08 April 2019 14:06
This is the code I use to scrape the info from the status.js file.
Modify it with your ip, username and password for logging into the webpage of the inverter. Also modify the idx of the sensors mentioned in the script.
Code: Select all
-- https://www.domoticz.com/forum/viewtopic.php?f=65&t=7941
return {
on = {
timer = { "every minute" },
httpResponses = { 'trigger-solar-data' }
},
logging = {
--level = domoticz.LOG_DEBUG, -- for debugging
--level = domoticz.LOG_INFO,
marker = "Zonnepanelen"
},
execute = function(domoticz, item)
ip = '192.168.x.xxx' --ip address of the solar inverter
user = 'xxx' --user name for solar inverter
pw = 'xxx' --password for solar inverter
Electric_meter_idx = 259 --kWhcounter
E_today_idx = 268 --custom
E_total_idx = 269 --custom
E_total_c_idx = 270 --counter
E_power_idx = 264 --energy
function update_kWhcounter_devc(devc, power, energy)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).usage ~= power or domoticz.devices(devc).WhTotal ~= energy) then
domoticz.devices(devc).updateElectricity(power, energy)
--end
end
end
function update_custom_devc(devc, value)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).state ~= value) then
domoticz.devices(devc).updateCustomSensor(value)
--end
end
end
function update_counterkWh_devc(devc, value)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).counter*1000 ~= value) then
domoticz.devices(devc).updateCounter(value)
--end
end
end
function update_energy_devc(devc, value)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).WhActual ~= value) then
domoticz.devices(devc).updateEnergy(value)
--end
end
end
function split(s, delimiter)
result = {};
for match in (s..delimiter):gmatch("(.-)"..delimiter) do
table.insert(result, match);
end
return result;
end
if (item.isTimer) then
requestURL = 'http://'..user..':'..pw..'@'..ip..'/js/status.js'
domoticz.openURL({
url = requestURL,
--method = 'GET',
callback = 'trigger-solar-data'
})
end
if (item.isHTTPResponse and item.ok) then
-- check to which request this response was the result
if (item.trigger == 'trigger-solar-data') then
--domoticz.log(item.data)
idata = string.match(item.data, 'myDeviceArray%[0%]="(.-)";')
--domoticz.log(idata)
s = split(idata, ",")
--for key, value in pairs(s) do
-- print(key..'='..value)
--end
powerW = s[6] -- in W
etoday = s[7]/100 -- in kWh
etotal = s[8]/10 -- in kWh
domoticz.log("Power: "..powerW.." W",domoticz.LOG_FORCE)
domoticz.log("Today: "..etoday.." kWh",domoticz.LOG_FORCE)
domoticz.log("Total: "..etotal.." kWh",domoticz.LOG_FORCE)
update_kWhcounter_devc(Electric_meter_idx, powerW, etotal*1000)
update_custom_devc(E_today_idx, etoday)
update_custom_devc(E_total_idx, etotal)
update_counterkWh_devc(E_total_c_idx, etotal*1000)
update_energy_devc(E_power_idx, powerW)
end
end
end
}
Thats nice! Keep in mind that not all inverters / firmware versions are having a status.js page. My inverter / firmware doesnt have a status.js
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Monday 08 April 2019 14:20
by rednas
jankees wrote: ↑Monday 08 April 2019 14:16
rednas wrote: ↑Monday 08 April 2019 14:06
This is the code I use to scrape the info from the status.js file.
Modify it with your ip, username and password for logging into the webpage of the inverter. Also modify the idx of the sensors mentioned in the script.
Code: Select all
-- https://www.domoticz.com/forum/viewtopic.php?f=65&t=7941
return {
on = {
timer = { "every minute" },
httpResponses = { 'trigger-solar-data' }
},
logging = {
--level = domoticz.LOG_DEBUG, -- for debugging
--level = domoticz.LOG_INFO,
marker = "Zonnepanelen"
},
execute = function(domoticz, item)
ip = '192.168.x.xxx' --ip address of the solar inverter
user = 'xxx' --user name for solar inverter
pw = 'xxx' --password for solar inverter
Electric_meter_idx = 259 --kWhcounter
E_today_idx = 268 --custom
E_total_idx = 269 --custom
E_total_c_idx = 270 --counter
E_power_idx = 264 --energy
function update_kWhcounter_devc(devc, power, energy)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).usage ~= power or domoticz.devices(devc).WhTotal ~= energy) then
domoticz.devices(devc).updateElectricity(power, energy)
--end
end
end
function update_custom_devc(devc, value)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).state ~= value) then
domoticz.devices(devc).updateCustomSensor(value)
--end
end
end
function update_counterkWh_devc(devc, value)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).counter*1000 ~= value) then
domoticz.devices(devc).updateCounter(value)
--end
end
end
function update_energy_devc(devc, value)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).WhActual ~= value) then
domoticz.devices(devc).updateEnergy(value)
--end
end
end
function split(s, delimiter)
result = {};
for match in (s..delimiter):gmatch("(.-)"..delimiter) do
table.insert(result, match);
end
return result;
end
if (item.isTimer) then
requestURL = 'http://'..user..':'..pw..'@'..ip..'/js/status.js'
domoticz.openURL({
url = requestURL,
--method = 'GET',
callback = 'trigger-solar-data'
})
end
if (item.isHTTPResponse and item.ok) then
-- check to which request this response was the result
if (item.trigger == 'trigger-solar-data') then
--domoticz.log(item.data)
idata = string.match(item.data, 'myDeviceArray%[0%]="(.-)";')
--domoticz.log(idata)
s = split(idata, ",")
--for key, value in pairs(s) do
-- print(key..'='..value)
--end
powerW = s[6] -- in W
etoday = s[7]/100 -- in kWh
etotal = s[8]/10 -- in kWh
domoticz.log("Power: "..powerW.." W",domoticz.LOG_FORCE)
domoticz.log("Today: "..etoday.." kWh",domoticz.LOG_FORCE)
domoticz.log("Total: "..etotal.." kWh",domoticz.LOG_FORCE)
update_kWhcounter_devc(Electric_meter_idx, powerW, etotal*1000)
update_custom_devc(E_today_idx, etoday)
update_custom_devc(E_total_idx, etotal)
update_counterkWh_devc(E_total_c_idx, etotal*1000)
update_energy_devc(E_power_idx, powerW)
end
end
end
}
Thats nice! Keep in mind that not all inverters / firmware versions are having a status.js page. My inverter / firmware doesnt have a status.js
I know. This script is only for the ones that do have a status.js. The other script which is scraping the values from the status.html is not working for some inverters and I hope this script is working for these inverters!
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Monday 08 April 2019 15:18
by thijsvb
rednas wrote: ↑Monday 08 April 2019 14:06
This is the code I use to scrape the info from the status.js file.
Modify it with your ip, username and password for logging into the webpage of the inverter. Also modify the idx of the sensors mentioned in the script.
Code: Select all
-- https://www.domoticz.com/forum/viewtopic.php?f=65&t=7941
return {
on = {
timer = { "every minute" },
httpResponses = { 'trigger-solar-data' }
},
logging = {
--level = domoticz.LOG_DEBUG, -- for debugging
--level = domoticz.LOG_INFO,
marker = "Zonnepanelen"
},
execute = function(domoticz, item)
ip = '192.168.x.xxx' --ip address of the solar inverter
user = 'xxx' --user name for solar inverter
pw = 'xxx' --password for solar inverter
Electric_meter_idx = 259 --kWhcounter
E_today_idx = 268 --custom
E_total_idx = 269 --custom
E_total_c_idx = 270 --counter
E_power_idx = 264 --energy
function update_kWhcounter_devc(devc, power, energy)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).usage ~= power or domoticz.devices(devc).WhTotal ~= energy) then
domoticz.devices(devc).updateElectricity(power, energy)
--end
end
end
function update_custom_devc(devc, value)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).state ~= value) then
domoticz.devices(devc).updateCustomSensor(value)
--end
end
end
function update_counterkWh_devc(devc, value)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).counter*1000 ~= value) then
domoticz.devices(devc).updateCounter(value)
--end
end
end
function update_energy_devc(devc, value)
if (devc~='' and devc~=nil) then
--if (domoticz.devices(devc).WhActual ~= value) then
domoticz.devices(devc).updateEnergy(value)
--end
end
end
function split(s, delimiter)
result = {};
for match in (s..delimiter):gmatch("(.-)"..delimiter) do
table.insert(result, match);
end
return result;
end
if (item.isTimer) then
requestURL = 'http://'..user..':'..pw..'@'..ip..'/js/status.js'
domoticz.openURL({
url = requestURL,
--method = 'GET',
callback = 'trigger-solar-data'
})
end
if (item.isHTTPResponse and item.ok) then
-- check to which request this response was the result
if (item.trigger == 'trigger-solar-data') then
--domoticz.log(item.data)
idata = string.match(item.data, 'myDeviceArray%[0%]="(.-)";')
--domoticz.log(idata)
s = split(idata, ",")
--for key, value in pairs(s) do
-- print(key..'='..value)
--end
powerW = s[6] -- in W
etoday = s[7]/100 -- in kWh
etotal = s[8]/10 -- in kWh
domoticz.log("Power: "..powerW.." W",domoticz.LOG_FORCE)
domoticz.log("Today: "..etoday.." kWh",domoticz.LOG_FORCE)
domoticz.log("Total: "..etotal.." kWh",domoticz.LOG_FORCE)
update_kWhcounter_devc(Electric_meter_idx, powerW, etotal*1000)
update_custom_devc(E_today_idx, etoday)
update_custom_devc(E_total_idx, etotal)
update_counterkWh_devc(E_total_c_idx, etotal*1000)
update_energy_devc(E_power_idx, powerW)
end
end
end
}
Thanks a lot, works like a charm!
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Monday 08 April 2019 16:45
by ABRB55
some assistance please, what language is this code and how can I run it? - thx
I tried node and python, but both give errors
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Tuesday 09 April 2019 9:58
by rednas
It's in DzVents:
https://www.domoticz.com/wiki/DzVents:_ ... _scripting
So you should go to Events within Domoticz and create a new DzVents event.
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Tuesday 09 April 2019 14:28
by ABRB55
I'm getting this error - concatenate local 's' (a nil value) ;
2019-04-09 14:25:00.325 Status: dzVents: Info: Zonnepanelen: ------ Start internal script: OmnikT:, trigger: every minute
2019-04-09 14:25:00.325 Status: dzVents: Info: Zonnepanelen: ------ Finished OmnikT
2019-04-09 14:25:00.429 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-04-09 14:25:00.680 Status: dzVents: Info: Handling httpResponse-events for: "trigger-solar-data
2019-04-09 14:25:00.680 Status: dzVents: Info: Zonnepanelen: ------ Start internal script: OmnikT: HTTPResponse: "trigger-solar-data"
2019-04-09 14:25:00.681 Status: dzVents: Error (2.4.6): Zonnepanelen: An error occured when calling event handler OmnikT
2019-04-09 14:25:00.681 Status: dzVents: Error (2.4.6): Zonnepanelen: ...pi/domoticz/scripts/dzVents/generated_scripts/OmnikT.lua:57: attempt to concatenate local 's' (a nil value)
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Tuesday 09 April 2019 15:19
by rednas
Can you do the following to output some more details?
Change this part:
Code: Select all
--domoticz.log(item.data)
idata = string.match(item.data, 'myDeviceArray%[0%]="(.-)";')
--domoticz.log(idata)
s = split(idata, ",")
--for key, value in pairs(s) do
-- print(key..'='..value)
--end
To this:
Code: Select all
domoticz.log(item.data)
idata = string.match(item.data, 'myDeviceArray%[0%]="(.-)";')
domoticz.log(idata)
s = split(idata, ",")
for key, value in pairs(s) do
print(key..'='..value)
end
And send the output again.
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Tuesday 09 April 2019 15:34
by ABRB55
this is the result;
Code: Select all
2019-04-09 15:31:00.918 Status: dzVents: Info: Zonnepanelen2: ------ Start internal script: OmnikT2: HTTPResponse: "trigger-solar-data"
2019-04-09 15:31:00.919 Status: dzVents: Info: Zonnepanelen2: var version="H4.01.38Y1.0.08W1.0.07";var m2mMid="1606941670";var wlanMac="zz:zz:zz:zz:zz:zz";var m2mRssi="100%";var wanIp="192.168.x.xxx";var nmac="zzzzzzzzzzzz";var fephy="off";var webData="zzzzzzzzz,NL1-V1.0-0108-4,V2.0-0028,omnik3000tl ,3000,2688,1036,119945,,1,";function initPageText(){var A=window.parent.reList("status");fileText("st1",A["t1"]);fileText("st2",A["t2"]);fileText("st3",A["t3"]);for(var B=1;B<=27;B++){if(B!=14){fileText("tx"+B,A[B])}}init_main_page();initStatus();changeFont();child_getH()}function upfold(A){if(document.getElementById("up_"+A+"_div").style.display=="none"){show("up_"+A+"_div");document.getElementById("up_"+A).src="image/up.png"}else{hide("up_"+A+"_div");document.getElementById("up_"+A).src="image/down.png"}if(A==3){if(document.getElementById("ser_status").src==""){document.getElementById("ser_status").src="server_status.html"}}}function init_main_page(){var E=document.form_cover_setting;cfg2Form(E);var C;var D;var B;var A;B=window.parent.reTip("1");A=window.parent.reTip("2");document.getElementById("cover_ver").innerHTML=version;document.getElementById("cover_mid").innerHTML=m2mMid;if(E.wifi_on.value=="disable"){document.getElementById("cover_ap_status").innerHTML=A;document.getElementById("cover_ap_mac").innerHTML="";document.getElementById("cover_ap_ssid").innerHTML="";document.getElementById("cover_ap_ip").innerHTML="";document.getElementById("cover_sta_status").innerHTML=A;document.getElementById("cover_sta_rssi").innerHTML="";document.getElementById("cover_sta_ip").innerHTML="";document.getElementById("cover_sta_mac").innerHTML="";document.getElementById("cover_sta_ssid").innerHTML=""}else{if(E.sta_enable.value=="1"){document.getElementById("cover_ap_status").innerHTML=B;document.getElementById("cover_ap_mac").innerHTML=wlanMac;document.getElementById("cover_ap_ssid").innerHTML=E.ap_ssid.value;document.getElementById("cover_ap_ip").innerHTML=E.lan_ip.value;document.getElementById("cover_sta_status").innerHTML=B;document.getElementById("cover_sta_rssi").innerHTML=m2mRssi;document.getElementById("cover_sta_ip").innerHTML=wanIp;C=wlanMac.substring(0,16);D="0x"+wlanMac.charAt(16);D=D*1+1;D=D.toString(16);D=D.toUpperCase();C=C+D;document.getElementById("cover_sta_mac").innerHTML=C;document.getElementById("cover_sta_ssid").innerHTML=E.sta_ssid.value}else{document.getElementById("cover_ap_status").innerHTML=B;document.getElementById("cover_ap_mac").innerHTML=wlanMac;document.getElementById("cover_ap_ssid").innerHTML=E.ap_ssid.value;document.getElementById("cover_ap_ip").innerHTML=E.lan_ip.value;document.getElementById("cover_sta_status").innerHTML=A;document.getElementById("cover_sta_rssi").innerHTML="";document.getElementById("cover_sta_ip").innerHTML="";document.getElementById("cover_sta_mac").innerHTML="";document.getElementById("cover_sta_ssid").innerHTML=""}}}function init_webdata_form(){var E=webData;var B="";var A,C,D;A=E.length;C=0;D=0;while(C<A){if(E.charAt(C)==","){C+=1;D+=1;web_data_show(D,B);B=""}else{B=B+E.charAt(C);C+=1}}}function web_data_show(D,A){var C=new Array("webdata_sn","webdata_msvn","webdata_ssvn","webdata_pv_type","webdata_rate_p","webdata_now_p","webdata_today_e","webdata_total_e","webdata_alarm","webdata_utime");if(D>10||D<=0){return}var B=document.getElementById(C[D-1]);if(A==""&&B!=null){B.innerHTML="---";return}if(B!=null){if(D==5){B.innerHTML=A+" W"}else{if(D==6){B.innerHTML=A+" W"}else{if(D==7){sv=A*1/100;B.innerHTML=sv.toString()+" kWh"}else{if(D==8){sv=A*1/10;B.innerHTML=sv.toString()+" kWh"}else{if(D==10){if(document.getElementById("webdata_sn").innerHTML=="---"){B.innerHTML="---"}else{B.innerHTML=A+window.parent.reTip("5")}}else{B.innerHTML=A}}}}}}else{alert(C[D])}};
2019-04-09 15:31:00.919 Status: dzVents: Info: Zonnepanelen2: nil
2019-04-09 15:31:00.919 Status: dzVents: Error (2.4.6): Zonnepanelen2: An error occured when calling event handler OmnikT2
2019-04-09 15:31:00.920 Status: dzVents: Error (2.4.6): Zonnepanelen2: ...i/domoticz/scripts/dzVents/generated_scripts/OmnikT2.lua:57: attempt to concatenate local 's' (a nil value)
2019-04-09 15:31:00.920 Status: dzVents: Info: Zonnepanelen2: ------ Finished OmnikT2
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Tuesday 09 April 2019 15:42
by rednas
And change this:
Code: Select all
idata = string.match(item.data, 'myDeviceArray%[0%]="(.-)";')
To:
Code: Select all
idata = string.match(item.data, 'webData="(.-)";')
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Tuesday 09 April 2019 15:51
by ABRB55
Great, sensors filled nicely - thx!
But I see it still says error, can it be due to "Method updateElectricity is not available for device "Electric_meter""
I see, I had the sensor type wrong, when setup sensor Type: Electric(instant+Counter) it's loaded with the data.
Code: Select all
2019-04-09 15:46:00.185 Status: dzVents: Info: Zonnepanelen2: ------ Start internal script: OmnikT2:, trigger: every minute
2019-04-09 15:46:00.186 Status: dzVents: Info: Zonnepanelen2: ------ Finished OmnikT2
2019-04-09 15:46:00.285 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-04-09 15:46:00.757 Status: dzVents: Info: Handling httpResponse-events for: "trigger-solar-data
2019-04-09 15:46:00.757 Status: dzVents: Info: Zonnepanelen2: ------ Start internal script: OmnikT2: HTTPResponse: "trigger-solar-data"
2019-04-09 15:46:00.757 Status: dzVents: Info: Zonnepanelen2: var version="H4.01.38Y1.0.08W1.0.07";var m2mMid="1606941670";var wlanMac="zz:zz:zz:zz:zz:zz";var m2mRssi="100%";var wanIp="192.168.x.xxx";var nmac="zzzzzzzzzzzzz";var fephy="off";var webData="NLDN3020152A4080,NL1-V1.0-0108-4,V2.0-0028,omnik3000tl ,3000,2664,1105,119952,,0,";function initPageText(){var A=window.parent.reList("status");fileText("st1",A["t1"]);fileText("st2",A["t2"]);fileText("st3",A["t3"]);for(var B=1;B<=27;B++){if(B!=14){fileText("tx"+B,A[B])}}init_main_page();initStatus();changeFont();child_getH()}function upfold(A){if(document.getElementById("up_"+A+"_div").style.display=="none"){show("up_"+A+"_div");document.getElementById("up_"+A).src="image/up.png"}else{hide("up_"+A+"_div");document.getElementById("up_"+A).src="image/down.png"}if(A==3){if(document.getElementById("ser_status").src==""){document.getElementById("ser_status").src="server_status.html"}}}function init_main_page(){var E=document.form_cover_setting;cfg2Form(E);var C;var D;var B;var A;B=window.parent.reTip("1");A=window.parent.reTip("2");document.getElementById("cover_ver").innerHTML=version;document.getElementById("cover_mid").innerHTML=m2mMid;if(E.wifi_on.value=="disable"){document.getElementById("cover_ap_status").innerHTML=A;document.getElementById("cover_ap_mac").innerHTML="";document.getElementById("cover_ap_ssid").innerHTML="";document.getElementById("cover_ap_ip").innerHTML="";document.getElementById("cover_sta_status").innerHTML=A;document.getElementById("cover_sta_rssi").innerHTML="";document.getElementById("cover_sta_ip").innerHTML="";document.getElementById("cover_sta_mac").innerHTML="";document.getElementById("cover_sta_ssid").innerHTML=""}else{if(E.sta_enable.value=="1"){document.getElementById("cover_ap_status").innerHTML=B;document.getElementById("cover_ap_mac").innerHTML=wlanMac;document.getElementById("cover_ap_ssid").innerHTML=E.ap_ssid.value;document.getElementById("cover_ap_ip").innerHTML=E.lan_ip.value;document.getElementById("cover_sta_status").innerHTML=B;document.getElementById("cover_sta_rssi").innerHTML=m2mRssi;document.getElementById("cover_sta_ip").innerHTML=wanIp;C=wlanMac.substring(0,16);D="0x"+wlanMac.charAt(16);D=D*1+1;D=D.toString(16);D=D.toUpperCase();C=C+D;document.getElementById("cover_sta_mac").innerHTML=C;document.getElementById("cover_sta_ssid").innerHTML=E.sta_ssid.value}else{document.getElementById("cover_ap_status").innerHTML=B;document.getElementById("cover_ap_mac").innerHTML=wlanMac;document.getElementById("cover_ap_ssid").innerHTML=E.ap_ssid.value;document.getElementById("cover_ap_ip").innerHTML=E.lan_ip.value;document.getElementById("cover_sta_status").innerHTML=A;document.getElementById("cover_sta_rssi").innerHTML="";document.getElementById("cover_sta_ip").innerHTML="";document.getElementById("cover_sta_mac").innerHTML="";document.getElementById("cover_sta_ssid").innerHTML=""}}}function init_webdata_form(){var E=webData;var B="";var A,C,D;A=E.length;C=0;D=0;while(C<A){if(E.charAt(C)==","){C+=1;D+=1;web_data_show(D,B);B=""}else{B=B+E.charAt(C);C+=1}}}function web_data_show(D,A){var C=new Array("webdata_sn","webdata_msvn","webdata_ssvn","webdata_pv_type","webdata_rate_p","webdata_now_p","webdata_today_e","webdata_total_e","webdata_alarm","webdata_utime");if(D>10||D<=0){return}var B=document.getElementById(C[D-1]);if(A==""&&B!=null){B.innerHTML="---";return}if(B!=null){if(D==5){B.innerHTML=A+" W"}else{if(D==6){B.innerHTML=A+" W"}else{if(D==7){sv=A*1/100;B.innerHTML=sv.toString()+" kWh"}else{if(D==8){sv=A*1/10;B.innerHTML=sv.toString()+" kWh"}else{if(D==10){if(document.getElementById("webdata_sn").innerHTML=="---"){B.innerHTML="---"}else{B.innerHTML=A+window.parent.reTip("5")}}else{B.innerHTML=A}}}}}}else{alert(C[D])}};
2019-04-09 15:46:00.757 Status: dzVents: Info: Zonnepanelen2: NLDN3020152A4080,NL1-V1.0-0108-4,V2.0-0028,omnik3000tl ,3000,2664,1105,119952,,0,
2019-04-09 15:46:00.757 Status: dzVents: 1=NLDN3020152A4080
2019-04-09 15:46:00.757 Status: dzVents: 2=NL1-V1.0-0108-4
2019-04-09 15:46:00.757 Status: dzVents: 3=V2.0-0028
2019-04-09 15:46:00.757 Status: dzVents: 4=omnik3000tl
2019-04-09 15:46:00.757 Status: dzVents: 5=3000
2019-04-09 15:46:00.757 Status: dzVents: 6=2664
2019-04-09 15:46:00.757 Status: dzVents: 7=1105
2019-04-09 15:46:00.757 Status: dzVents: 8=119952
2019-04-09 15:46:00.757 Status: dzVents: 9=
2019-04-09 15:46:00.757 Status: dzVents: 10=0
2019-04-09 15:46:00.758 Status: dzVents: 11=
2019-04-09 15:46:00.758 Status: dzVents: !Info: Zonnepanelen2: Power: 2664 W
2019-04-09 15:46:00.758 Status: dzVents: !Info: Zonnepanelen2: Today: 11.05 kWh
2019-04-09 15:46:00.758 Status: dzVents: !Info: Zonnepanelen2: Total: 11995.2 kWh
2019-04-09 15:46:00.776 Status: dzVents: Error (2.4.6): Zonnepanelen2: Method updateElectricity is not available for device "Electric_meter" (deviceType=RFXMeter, deviceSubType=RFXMeter counter). If you believe this is not correct, please report.
2019-04-09 15:46:00.779 Status: dzVents: Error (2.4.6): Zonnepanelen2: An error occured when calling event handler OmnikT2
2019-04-09 15:46:00.779 Status: dzVents: Error (2.4.6): Zonnepanelen2: ...i/domoticz/scripts/dzVents/generated_scripts/OmnikT2.lua:50: attempt to call field 'updateEnergy' (a nil value)
2019-04-09 15:46:00.779 Status: dzVents: Info: Zonnepanelen2: ------ Finished OmnikT2
2019-04-09 15:46:00.779 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Tuesday 09 April 2019 16:11
by rednas
So you now have no errors left?
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Posted: Tuesday 09 April 2019 16:33
by ABRB55
Script runs without errors