GoodWe Solar: get data from the new semsportal (lua script)

Moderator: leecollings

CrazyFrog
Posts: 21
Joined: Sunday 21 April 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by CrazyFrog »

sandeman684 wrote: Saturday 27 April 2019 14:41 In my last post I mentioned I needed other key numbers, but that was partially incorrect because the domoticz log only showed me the last roughly 100 keys. I had to output them to a file to see them all.
In this way I found that for my case, each of the keys is one higher than in CrazyFrogs script. So now I have:

Code: Select all

    output_power      = getValue(splitString[183])
    last_refresh_time = getValue(splitString[189])
    eDay              = getValue(splitString[200])
This works well but indicates that the keys are not fully fixed.
Maybe we should not look for key number but for key value?

Thanks for the info,
i shall update het script and post it here.
CrazyFrog
Posts: 21
Joined: Sunday 21 April 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by CrazyFrog »

CrazyFrog wrote: Saturday 27 April 2019 17:47
sandeman684 wrote: Saturday 27 April 2019 14:41 In my last post I mentioned I needed other key numbers, but that was partially incorrect because the domoticz log only showed me the last roughly 100 keys. I had to output them to a file to see them all.
In this way I found that for my case, each of the keys is one higher than in CrazyFrogs script. So now I have:

Code: Select all

    output_power      = getValue(splitString[183])
    last_refresh_time = getValue(splitString[189])
    eDay              = getValue(splitString[200])
This works well but indicates that the keys are not fully fixed.
Maybe we should not look for key number but for key value?

Thanks for the info,
i shall update het script and post it here.

I wrote the following solution:

replace the function getValue with the following code:

Code: Select all


function printAllValues(s)
   for key, value in pairs(splitString) do
      print(string.format("Key = [%s] Value = [%s]",split(value, ":")[1],split(value, ":")[2]))
   end
end

function getValue(s, name)
   for key, value in pairs(splitString) do
      key = split(value, ":")[1]
      value = split(value, ":")[2]
      if (name == key) then
         return value
      end
   end
   return ""
end
Then you can use this with the following code:

Code: Select all

-- Show al variable
--printAllValues(s)

output_power = getValue(splitString, "output_power")
last_refresh_time = getValue(splitString, "last_refresh_time")
eDay = getValue(splitString, "eDay")
daily_generation = getValue(splitString, "daily_generation")
work_mode = getValue(splitString, "work_mode")
warning = getValue(splitString, "warning")

print("last_refresh_time :" .. last_refresh_time)
print("output_power :" .. output_power)
print("eDay :" .. eDay)
print("daily_generation :" .. daily_generation )
print("work_mode :" .. work_mode)
print("warning :" .. warning)

If needed i can place here the full code, let me know
sandeman684
Posts: 14
Joined: Sunday 08 January 2017 10:37
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by sandeman684 »

CrazyFrog wrote: Saturday 27 April 2019 20:24 I wrote the following solution:
Works like a charm! Thanks.
klaaspiet
Posts: 34
Joined: Tuesday 09 January 2018 8:29
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Harlingen
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by klaaspiet »

Hy

it is working super.

but i would like to have some more info from my goodwe portal.

like the temperature, status,

how do i get the output of the key in to a file so i could see all of the key's en not only the fist 100

already thanks for the great support of this code is great.

greetz klaas
sandeman684
Posts: 14
Joined: Sunday 08 January 2017 10:37
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by sandeman684 »

klaaspiet wrote: Monday 29 April 2019 19:21
how do i get the output of the key in to a file so i could see all of the key's en not only the fist 100
See here for a lua description of how to write to a file:
https://www.tutorialspoint.com/lua/lua_file_io.htm

You can then add this code to for example the printAllValues function and replace the print command by io.write. You should then also add a line end "\n" otherwise everything will be printed on one line.
dospider
Posts: 15
Joined: Monday 04 August 2014 18:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by dospider »

I still have a problem retrieving the data.
Does anybody have an idea how to solved this error?

2019-04-30 09:08:43.249 Error: EventSystem: in Goodwe portal: [string "
..."]:88: attempt to perform arithmetic on global 'endPos' (a nil value)
Tiger362
Posts: 8
Joined: Monday 22 April 2019 10:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by Tiger362 »

dospider wrote: Tuesday 30 April 2019 9:14 I still have a problem retrieving the data.
Does anybody have an idea how to solved this error?

2019-04-30 09:08:43.249 Error: EventSystem: in Goodwe portal: [string "
..."]:88: attempt to perform arithmetic on global 'endPos' (a nil value)
I get the same error message... also tried all the sollutions offered, but no luck... :(
sandeman684
Posts: 14
Joined: Sunday 08 January 2017 10:37
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by sandeman684 »

Tiger362 wrote: Tuesday 30 April 2019 11:19
dospider wrote: Tuesday 30 April 2019 9:14 I still have a problem retrieving the data.
Does anybody have an idea how to solved this error?

2019-04-30 09:08:43.249 Error: EventSystem: in Goodwe portal: [string "
..."]:88: attempt to perform arithmetic on global 'endPos' (a nil value)
I get the same error message... also tried all the sollutions offered, but no luck... :(
If you want to see your data you can add this function:

Code: Select all

function printToFile(s)
    file = io.open("myoutput.txt", "w")
    io.output(file)
    io.write(s)
    io.close(file)
end
And then call printToFile(s) before the lines giving the issues. In this way at least know the contents of s.
The location of the file myoutput.txt may have to be adapted to suit your system. In my case (a Synology NAS) it writes the file in the root of the file system (not the best place I would say).
dospider
Posts: 15
Joined: Monday 04 August 2014 18:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by dospider »

When i print variable s=assert i get.

2019-05-01 10:58:47.457 Status: LUA: waarde s=assert<html><head><title>Object moved</title></head><body>
2019-05-01 10:58:47.457 <h2>Object moved to <a href="/home/login">here</a>.</h2>



I think s=assert is going to-- extract the JSON-data from the response

Is the response ok from s=assert
mennohaeck
Posts: 3
Joined: Thursday 11 April 2019 16:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by mennohaeck »

With testscript.lua I get a lot of data. I replaced the scipt once again, after that I got error line 51 a few times. Then I received Domoticz update ( more then one, don't know why). After that nothing anymore, no errors as well.
mennohaeck
Posts: 3
Joined: Thursday 11 April 2019 16:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by mennohaeck »

Hielkep wrote: Friday 26 April 2019 16:07
mennohaeck wrote: Friday 26 April 2019 14:36 No matter what I do or how I name the script, there is no output. I checked all the rights and syntax. Funny thing is: no errors as wel. Is there anyone with a bright idea? :?
is the name of dummy switch and the declaration in line 65 of the name of the switch completely the same?

YEP
CrazyFrog
Posts: 21
Joined: Sunday 21 April 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by CrazyFrog »

mennohaeck wrote: Wednesday 01 May 2019 15:38
Hielkep wrote: Friday 26 April 2019 16:07
mennohaeck wrote: Friday 26 April 2019 14:36 No matter what I do or how I name the script, there is no output. I checked all the rights and syntax. Funny thing is: no errors as wel. Is there anyone with a bright idea? :?
is the name of dummy switch and the declaration in line 65 of the name of the switch completely the same?

YEP

Can you execute the follow script from the command line (execute with lua <filename>)
and send me the results, hopefully we can see your problem

Code: Select all


local UserName = "YOUR USERNAME"
local Password = "YOUR PASSWORD"
local token = "YOUR TOKEN"

-- To get you token use the curl command below, replace [LOGINNAME] and [PASSWORD] for your own id's
-- "curl -d 'account=[LOGINNAME]&pwd=[PASSWORD]&code=' https://www.semsportal.com/Home/Login";
curl_getToken = string.format("curl -d 'account=%s&pwd=%s&code=' https://www.semsportal.com/Home/Login",UserName,Password)

--- print(curl_getToken)

command = string.format("curl --silent --output /dev/null --cookie-jar - -d 'account=%s&pwd=%s&code=' https://www.semsportal.com/Home/Login",UserName,Password)

-- print(command)

function stripchars(str, chrs)
    local s = str:gsub("["..chrs:gsub("%W","%%%1").."]", '')
    return s
end


function split(s, delimiter)
    result = {};
    for match in (s..delimiter):gmatch("(.-)"..delimiter) do
        table.insert(result, match);
    end
    return result;
end

function printAllValues(s)
   for key, value in pairs(splitString) do
      print(string.format("Key = [%s] Value = [%s]",split(value, ":")[1],split(value, ":")[2]))
   end
end

function getValue(s, name)
   for key, value in pairs(splitString) do
      key = split(value, ":")[1]
      value = split(value, ":")[2]
      if (name == key) then
         return value
      end
   end
   return ""
end

print("==============  get Token ======================")
local f = assert(io.popen(curl_getToken, 'r'))
s = assert(f:read('*a'))
f:close()

print(string.format("====> Response get token : %s", s))


print("==============  get sessionID ======================")
local f = assert(io.popen(command, 'r'))
s = assert(f:read('*a'))
f:close()

print(string.format("====> Response get sessionID : %s", s))

sessionId = string.sub(s, -26)
sessionId = string.gsub(sessionId,"[\r\n]", "" )
sessionId = string.gsub(sessionId, "%s+", "")

print("==============  get Data ======================")

getData = string.format("%s%s%s%s" , "curl -v --cookie 'ASP.NET_SessionId=", sessionId, "' https://www.semsportal.com/PowerStation/PowerStatusSnMin/",token )

local f = assert(io.popen(getData, 'r'))
s = assert(f:read('*a'))
f:close()

print(string.format("====>  Response data : %s", s))

print("================================================")

dennispracht
Posts: 2
Joined: Wednesday 01 May 2019 11:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by dennispracht »

after a long time only one error message after the other. I finally have the right script that works and displays all values correctly.

use this script with lua and time and your own email / password and token and everything works perfectly.

And set your name from your dummy right on line 76.

Code: Select all

--- Created by Raymond Wiertz
--- DateTime: 2019-04-21

-- Note: The GoodWe data is refreshed every 60 seconds.

-- Note: Enter your own data at [LOGINNAME] and [PASSWORD]

-- Tracking your token
-- To find out your token, you must execute the CURL command below from the command line.
--- curl -d 'account=[LOGINNAME]&pwd=[PASSWORD]&code=' https://www.semsportal.com/Home/Login;

-- Place here your token
token = "[token]"

-- The curl command below retrieves the get session ID named "ASP.NET_SessionId", the session ID is used to request the final data
command = "curl --silent --output /dev/null --cookie-jar - -d 'account=[e-mail]&pwd=[password]&code=' https://www.semsportal.com/Home/Login"

commandArray = {}
i=1

function UpdateDevice(device, data)
    idx = otherdevices_idx[device]
    if (idx == nil) then
        print('** Unknown device'..device)
    else
        commandArray[i] = {['UpdateDevice'] = idx..'|0|'..data}
        i = i+1
    end
end

function stripchars(str, chrs)
    local s = str:gsub("["..chrs:gsub("%W","%%%1").."]", '')
    return s
end

function split(s, delimiter)
    result = {};
    for match in (s..delimiter):gmatch("(.-)"..delimiter) do
        table.insert(result, match);
    end
    return result;
end

function printAllValues(s)
   for key, value in pairs(splitString) do
      print(string.format("Key = [%s] Value = [%s]",split(value, ":")[1],split(value, ":")[2]))
   end
end

function getValue(s, name)
   for key, value in pairs(splitString) do
      key = split(value, ":")[1]
      value = split(value, ":")[2]
      if (name == key) then
         return value
      end
   end
   return ""
end

function timedifference(s)
    year    = string.sub(s, 1, 3)
    month   = string.sub(s, 6, 7)
    day     = string.sub(s, 9, 10)
    hour    = string.sub(s, 12, 13)
    minutes = string.sub(s, 15, 16)
    seconds = string.sub(s, 18, 19)

    t1 = os.time()
    t2 = os.time{year=year, month=month, day=day, hour=hour, min=minutes,sec=seconds}
    difference = os.difftime (t1, t2)
    return difference
end

-- Sensor declaration
sensorSolarPanels = "solar panels"

difference = timedifference(otherdevices_lastupdate[sensorSolarPanels])

if (difference > 60) then
    local f = assert(io.popen(command, 'r'))
    s = assert(f:read('*a'))
    f:close()

    -- extract the ASP.NET_SessionId from the curl response
    sessionId = string.sub(s, -26)
    sessionId = string.gsub(sessionId,"[\r\n]", "" )
    sessionId = string.gsub(sessionId, "%s+", "")

    -- update curl command with the session id.
    getData = string.format("%s%s%s%s" , "curl -v --cookie 'ASP.NET_SessionId=", sessionId, "' https://www.semsportal.com/PowerStation/PowerStatusSnMin/",token )

    local f = assert(io.popen(getData, 'r'))
    s = assert(f:read('*a'))
    f:close()

    -- extract the JSON-data from the response
    dummy, startPos = string.find(s, "var pw_info = ")
    dummy, endPos = string.find(s, "}};")
    s = string.sub(s, startPos, endPos-1)

    -- remove excess brackets
    valueString = stripchars(s, "[]{}\"")
    -- and split the records
    splitString = split(valueString, ",")

    -- for debugging only
    -- Show al variable
    -- printAllValues(s)

output_power = getValue(splitString, "output_power")
last_refresh_time = getValue(splitString, "last_refresh_time")
eDay = getValue(splitString, "eDay")
daily_generation = getValue(splitString, "daily_generation")
work_mode = getValue(splitString, "work_mode")
warning = getValue(splitString, "warning")

print("last_refresh_time :" .. last_refresh_time)
print("output_power :" .. output_power)
print("eDay :" .. eDay)
print("daily_generation :" .. daily_generation )
print("work_mode :" .. work_mode)
print("warning :" .. warning)

    current = tonumber(stripchars(output_power, "kwhKWH"))
    dayTotal = tonumber(eDay)*1000

    UpdateDevice(sensorSolarPanels, current..";"..dayTotal)
end

return commandArray
Tiger362
Posts: 8
Joined: Monday 22 April 2019 10:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by Tiger362 »

Also used this script and still no result..
Log entry: Error: EventSystem: in Goodwe: [string "--- Created by Raymond Wiertz
..."]:100: attempt to perform arithmetic on global 'endPos' (a nil value)
:(
CrazyFrog
Posts: 21
Joined: Sunday 21 April 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by CrazyFrog »

i found out that sometimes the --- for comments cause some problem, replace the 3 minus signs "---" for 2 minus signs "--"
or remove all the comment lines
CrazyFrog
Posts: 21
Joined: Sunday 21 April 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by CrazyFrog »

I have updated my script.
- Installation instructions added
- error handling when no data is being retrieved
- comment --- replaced by --
- repetition of code placed in functions
- all comments and improvement posted here picked up and applied

Hopefully this is clearer and there are fewer problems than my first post :lol:

Tips, improvements and comments let me know, if necessary I will update my code and on request I will place the new code.

Code: Select all

-- Created by Raymond Wiertz
-- DateTime: 2019-05-03
--
-- How to install this script:
--
-- Before you can use this script you must first create a virtual sensor.
--
-- Create dummy hardware and device
-- Go to Setup -> Hardware
-- Name: anything, e.g. "Ele_Consumption" (this name is only used internally)
-- Type: "Dummy (does nothing, use for virtual switches only)"
-- Click on 'Add'
-- Click on 'Create Virtual Sensors' from the table of hardware above
-- Name: solar panels (this name must be the same as in the variable sensorSolarPanels)
-- Sensor type: "Electric (Instant+Counter)"
-- Click 'Ok'
--
-- Now you are ready to install this script.
--
-- Go to Setup -> More Options -> events
-- Event name: anything (this name is only used internally)
-- Select LUA
-- Select Time
-- Select "Event active"
--
-- Copy this script to the left side
-- hit the "save" button
--
-- Your script is now active, to disable this script deselect "Event active" and
-- hit the "save" button again.
--
--
--
-- Tracking your token
-- To find out your token, you must execute the CURL command below from the command line.
-- curl -d 'account=[YOUR USERNAME]&pwd=[YOUR PASSWORD]&code=' https://www.semsportal.com/Home/Login;
-- EXAMPLE
--    curl -d '[email protected]&pwd=!QAZ1qaz&code=' https://www.semsportal.com/Home/Login;
--
-- EXAMPLE RESPONE:
--       { "code" : 0, "msg" : "","data":{"redirect":"/PowerStation/PowerStatusSnMin/295a07ac-745d-2f84-ad8c-81537fca2d94"} }%
-- YOUR TOKEN IS:
--       295a07ac-745d-2f84-ad8c-81537fca2d94
--

local UserName = "YOUR USERNAME"
local Password = "YOUR PASSWORD"
local token = "YOUR TOKEN"
local sensorSolarPanels = "solar panels"

commandArray = {}
i=1


function stripchars(str, chrs)
    local s = str:gsub("["..chrs:gsub("%W","%%%1").."]", '')
    return s
end

function split(s, delimiter)
    result = {};
    for match in (s..delimiter):gmatch("(.-)"..delimiter) do
        table.insert(result, match);
    end
    return result;
end

function printToFile(s)
    file = io.open("myoutput.txt", "w")
    io.output(file)
    io.write(s)
    io.close(file)
end

function printAllValues(s)
   for key, value in pairs(splitString) do
      print(string.format("Key = [%s] Value = [%s]",split(value, ":")[1],split(value, ":")[2]))
   end
end

function isempty(s)
  return s == nil or s == ''
end

function getValue(s, name)
   for key, value in pairs(splitString) do
      key = split(value, ":")[1]
      value = split(value, ":")[2]
      if (name == key) then
         return value
      end
   end
   return ""
end

function extractJSonFromResponse(responseData)
   response = ""
   searchResult = string.find(responseData,"var pw_info = ")
   if (isempty(searchResult)== false) then
      -- extract the JSON-data from the response
      dummy, startPos = string.find(s, "var pw_info = ")
      dummy, endPos = string.find(s, "}};")
      response = string.sub(s, startPos, endPos-1)
   end

   return response
end

function getExecuteCommand(command)
  local f = assert(io.popen(command, 'r'))
  s = assert(f:read('*a'))
  f:close()
  return s
end

function getSessionID()
  -- The curl command below retrieves the get session ID named "ASP.NET_SessionId", the session ID is used to request the final data
  command = string.format("curl --silent --output /dev/null --cookie-jar - -d 'account=%s&pwd=%s&code=' https://www.semsportal.com/Home/Login",UserName,Password)
  result = getExecuteCommand(command)

  -- extract the ASP.NET_SessionId from the curl response
  sessionId = string.sub(result, -26)
  sessionId = string.gsub(sessionId,"[\r\n]", "" )
  sessionId = string.gsub(sessionId, "%s+", "")

  return sessionId
end

function timedifference(s)
    year    = string.sub(s, 1, 4)
    month   = string.sub(s, 6, 7)
    day     = string.sub(s, 9, 10)
    hour    = string.sub(s, 12, 13)
    minutes = string.sub(s, 15, 16)
    seconds = string.sub(s, 18, 19)

    t1 = os.time()
    t2 = os.time{year=year, month=month, day=day, hour=hour, min=minutes,sec=seconds}
    difference = os.difftime (t1, t2)
    return difference
end

function UpdateDevice(device, data)
    idx = otherdevices_idx[device]
    if (idx == nil) then
        print('** Unknown device'..device)
    else
        commandArray[i] = {['UpdateDevice'] = idx..'|0|'..data}
        i = i+1
    end
end

difference = timedifference(otherdevices_lastupdate[sensorSolarPanels])


-- The sensor will update every 180 seconds
if (difference > 180) then
    sessionId = getSessionID()

    -- update curl command with the session id.
    getData = string.format("%s%s%s%s" , "curl -v --cookie 'ASP.NET_SessionId=", sessionId, "' https://www.semsportal.com/PowerStation/PowerStatusSnMin/",token )
    response = getExecuteCommand(getData)

    -- extract the JSON-data from the response
    jsonResult = extractJSonFromResponse(response)

    if (isempty(jsonResult) == false) then
       -- remove excess brackets and split the records
       valueString = stripchars(jsonResult, "[]{}\"")
       splitString = split(valueString, ",")
          
       -- Show al variable
       -- printAllValues(splitString)
       -- printToFile(splitString)

       output_power = getValue(splitString, "output_power")
       last_refresh_time = getValue(splitString, "last_refresh_time")
       eDay = getValue(splitString, "eDay")

       print("last_refresh_time :" .. last_refresh_time)
       print("output_power :" .. output_power)
       print("eDay :" .. eDay)

       current = tonumber(stripchars(output_power, "kwhKWH"))
       dayTotal = tonumber(eDay)*1000

       UpdateDevice(sensorSolarPanels, current..";"..dayTotal)
  end
end

return commandArray

Last edited by CrazyFrog on Friday 03 May 2019 23:52, edited 1 time in total.
CrazyFrog
Posts: 21
Joined: Sunday 21 April 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by CrazyFrog »

klaaspiet wrote: Monday 29 April 2019 19:21 Hy

it is working super.

but i would like to have some more info from my goodwe portal.

like the temperature, status,

how do i get the output of the key in to a file so i could see all of the key's en not only the fist 100

already thanks for the great support of this code is great.

greetz klaas
you can get the following data from the goodwe portal.
in my post above i have also add the option to write the data to file.
you can use the function printToFile(s) by removing the comment signs (thanks to @sandeman684 )

Code: Select all

Key = [ info]
Key = [time]
Key = [stationname]
Key = [address]
Key = [owner_name]
Key = [owner_phone]
Key = [owner_email]
Key = [battery_capacity]
Key = [turnon_time]
Key = [create_time]
Key = [capacity]
Key = [longitude]
Key = [latitude]
Key = [powerstation_type]
Key = [status]
Key = [is_stored]
Key = [charts_type]
Key = [has_pv]
Key = [has_statistics_charts]
Key = [only_bps]
Key = [only_bpu]
Key = [time_span]
Key = [kpi]
Key = [power]
Key = [total_power]
Key = [day_income]
Key = [total_income]
Key = [yield_rate]
Key = [currency]
Key = [images]
Key = [weather]
Key = [cond_code_n]
Key = [cond_txt_d]
Key = [cond_txt_n]
Key = [date]
Key = [time]
Key = [hum]
Key = [pcpn]
Key = [pop]
Key = [pres]
Key = [tmp_max]
Key = [tmp_min]
Key = [uv_index]
Key = [vis]
Key = [wind_deg]
Key = [wind_dir]
Key = [wind_sc]
Key = [wind_spd]
Key = [cond_code_d]
Key = [cond_code_n]
Key = [cond_txt_d]
Key = [cond_txt_n]
Key = [date]
Key = [time]
Key = [hum]
Key = [pcpn]
Key = [pop]
Key = [pres]
Key = [tmp_max]
Key = [tmp_min]
Key = [uv_index]
Key = [vis]
Key = [wind_deg]
Key = [wind_dir]
Key = [wind_sc]
Key = [wind_spd]
Key = [cond_code_d]
Key = [cond_code_n]
Key = [cond_txt_d]
Key = [cond_txt_n]
Key = [date]
Key = [time]
Key = [hum]
Key = [pcpn]
Key = [pop]
Key = [pres]
Key = [tmp_max]
Key = [tmp_min]
Key = [uv_index]
Key = [vis]
Key = [wind_deg]
Key = [wind_dir]
Key = [wind_sc]
Key = [wind_spd]
Key = [cond_code_d]
Key = [cond_code_n]
Key = [cond_txt_d]
Key = [cond_txt_n]
Key = [date]
Key = [time]
Key = [hum]
Key = [pcpn]
Key = [pop]
Key = [pres]
Key = [tmp_max]
Key = [tmp_min]
Key = [uv_index]
Key = [vis]
Key = [wind_deg]
Key = [wind_dir]
Key = [wind_sc]
Key = [wind_spd]
Key = [cond_code_d]
Key = [cond_code_n]
Key = [cond_txt_d]
Key = [cond_txt_n]
Key = [date]
Key = [time]
Key = [hum]
Key = [pcpn]
Key = [pop]
Key = [pres]
Key = [tmp_max]
Key = [tmp_min]
Key = [uv_index]
Key = [vis]
Key = [wind_deg]
Key = [wind_dir]
Key = [wind_sc]
Key = [wind_spd]
Key = [cond_code_d]
Key = [cond_code_n]
Key = [cond_txt_d]
Key = [cond_txt_n]
Key = [date]
Key = [time]
Key = [hum]
Key = [pcpn]
Key = [pop]
Key = [pres]
Key = [tmp_max]
Key = [tmp_min]
Key = [uv_index]
Key = [vis]
Key = [wind_deg]
Key = [wind_dir]
Key = [wind_sc]
Key = [wind_spd]
Key = [cond_code_d]
Key = [cond_code_n]
Key = [cond_txt_d]
Key = [cond_txt_n]
Key = [date]
Key = [time]
Key = [hum]
Key = [pcpn]
Key = [pop]
Key = [pres]
Key = [tmp_max]
Key = [tmp_min]
Key = [uv_index]
Key = [vis]
Key = [wind_deg]
Key = [wind_dir]
Key = [wind_sc]
Key = [wind_spd]
Key = [basic]
Key = [location]
Key = [cnty]
Key = [lat]
Key = [lon]
Key = [tz]
Key = [update]
Key = [utc]
Key = [status]
Key = [inverter]
Key = [is_stored]
Key = [name]
Key = [in_pac]
Key = [out_pac]
Key = [eday]
Key = [emonth]
Key = [etotal]
Key = [status]
Key = [turnon_time]
Key = [releation_id]
Key = [type]
Key = [capacity]
Key = [d]
Key = [capacity]
Key = [model]
Key = [output_power]
Key = [output_current]
Key = [grid_voltage]
Key = [backup_output]
Key = [soc]
Key = [soh]
Key = [last_refresh_time]
Key = [work_mode]
Key = [dc_input1]
Key = [dc_input2]
Key = [battery]
Key = [bms_status]
Key = [warning]
Key = [charge_current_limit]
Key = [discharge_current_limit]
Key = [firmware_version]
Key = [creationDate]
Key = [eDay]
Key = [eTotal]
Key = [pac]
Key = [hTotal]
Key = [vpv1]
Key = [vpv2]
Key = [vpv3]
Key = [vpv4]
Key = [ipv1]
Key = [ipv2]
Key = [ipv3]
Key = [ipv4]
Key = [vac1]
Key = [vac2]
Key = [vac3]
Key = [iac1]
Key = [iac2]
Key = [iac3]
Key = [fac1]
Key = [fac2]
Key = [fac3]
Key = [istr1]
Key = [istr2]
Key = [istr3]
Key = [istr4]
Key = [istr5]
Key = [istr6]
Key = [istr7]
Key = [istr8]
Key = [istr9]
Key = [istr10]
Key = [istr11]
Key = [istr12]
Key = [istr13]
Key = [istr14]
Key = [istr15]
Key = [istr16]
Key = [it_change_flag]
Key = [tempperature]
Key = [check_code]
Key = [next]
Key = [prev]
Key = [next_device]
Key = [isStored]
Key = [prev_device]
Key = [isStored]
Key = [invert_full]
Key = [powerstation_id]
Key = [name]
Key = [model_type]
Key = [change_type]
Key = [capacity]
Key = [eday]
Key = [iday]
Key = [etotal]
Key = [itotal]
Key = [hour_total]
Key = [status]
Key = [turnon_time]
Key = [pac]
Key = [tempperature]
Key = [vpv1]
Key = [vpv2]
Key = [vpv3]
Key = [vpv4]
Key = [ipv1]
Key = [ipv2]
Key = [ipv3]
Key = [ipv4]
Key = [vac1]
Key = [vac2]
Key = [vac3]
Key = [iac1]
Key = [iac2]
Key = [iac3]
Key = [fac1]
Key = [fac2]
Key = [fac3]
Key = [istr1]
Key = [istr2]
Key = [istr3]
Key = [istr4]
Key = [istr5]
Key = [istr6]
Key = [istr7]
Key = [istr8]
Key = [istr9]
Key = [istr10]
Key = [istr11]
Key = [istr12]
Key = [istr13]
Key = [istr14]
Key = [istr15]
Key = [istr16]
Key = [last_time]
Key = [vbattery1]
Key = [ibattery1]
Key = [pmeter]
Key = [soc]
Key = [soh]
Key = [bms_discharge_i_max]
Key = [bms_charge_i_max]
Key = [bms_warning]
Key = [bms_alarm]
Key = [battary_work_mode]
Key = [workmode]
Key = [vload]
Key = [iload]
Key = [firmwareversion]
Key = [pbackup]
Key = [seller]
Key = [buy]
Key = [yesterdaybuytotal]
Key = [yesterdaysellertotal]
Key = [yesterdayetotal]
Key = [yesterdayetotalload]
Key = [thismonthetotle]
Key = [lastmonthetotle]
Key = [ram]
Key = [outputpower]
Key = [fault_messge]
Key = [isbuettey]
Key = [isbuetteybps]
Key = [isbuetteybpu]
Key = [isESUOREMU]
Key = [backUpPload_S]
Key = [backUpVload_S]
Key = [backUpIload_S]
Key = [backUpPload_T]
Key = [backUpVload_T]
Key = [backUpIload_T]
Key = [eTotalBuy]
Key = [eDayBuy]
Key = [eBatteryCharge]
Key = [eChargeDay]
Key = [eBatteryDischarge]
Key = [eDischargeDay]
Key = [battStrings]
Key = [meterConnectStatus]
Key = [mtActivepowerR]
Key = [mtActivepowerS]
Key = [mtActivepowerT]
Key = [time]
Key = [battery]
Key = [firmware_version]
Key = [warning_bms]
Key = [soh]
Key = [discharge_current_limit_bms]
Key = [charge_current_limit_bms]
Key = [soc]
Key = [pv_input_2]
Key = [pv_input_1]
Key = [back_up_output]
Key = [output_voltage]
Key = [backup_voltage]
Key = [output_current]
Key = [output_power]
Key = [total_generation]
Key = [daily_generation]
Key = [battery_charging]
Key = [last_refresh_time]
Key = [bms_status]
Key = [pw_id]
Key = [fault_message]
Key = [battery_power]
Key = [point_index]
Key = [points]
Key = [target_name]
Key = [display]
Key = [unit]
Key = [target_key]
Key = [text_cn]
Key = [target_sn_six]
Key = [target_sn_seven]
Key = [target_type]
Key = [storage_name]
Key = [target_index]
Key = [target_name]
Key = [display]
Key = [unit]
Key = [target_key]
Key = [text_cn]
Key = [target_sn_six]
Key = [target_sn_seven]
Key = [target_type]
Key = [storage_name]
Key = [target_index]
Key = [target_name]
Key = [display]
Key = [unit]
Key = [target_key]
Key = [text_cn]
Key = [target_sn_six]
Key = [target_sn_seven]
Key = [target_type]
Key = [storage_name]
Key = [target_index]
Key = [target_name]
Key = [display]
Key = [unit]
Key = [target_key]
Key = [text_cn]
Key = [target_sn_six]
Key = [target_sn_seven]
Key = [target_type]
Key = [storage_name]
Key = [target_index]
Key = [target_name]
Key = [display]
Key = [unit]
Key = [target_key]
Key = [text_cn]
Key = [target_sn_six]
Key = [target_sn_seven]
Key = [target_type]
Key = [storage_name]
Key = [target_index]
Key = [target_name]
Key = [display]
Key = [unit]
Key = [target_key]
Key = [text_cn]
Key = [target_sn_six]
Key = [target_sn_seven]
Key = [target_type]
Key = [storage_name]
Key = [target_index]
Key = [target_name]
Key = [display]
Key = [unit]
Key = [target_key]
Key = [text_cn]
Key = [target_sn_six]
Key = [target_sn_seven]
Key = [target_type]
Key = [storage_name]
Key = [target_index]
Key = [target_name]
Key = [display]
Key = [unit]
Key = [target_key]
Key = [text_cn]
Key = [target_sn_six]
Key = [target_sn_seven]
Key = [target_type]
Key = [storage_name]
Key = [target_index]
Key = [target_name]
Key = [display]
Key = [unit]
Key = [target_key]
Key = [text_cn]
Key = [target_sn_six]
Key = [target_sn_seven]
Key = [target_type]
Key = [storage_name]
Key = [target_index]
Key = [target_name]
Key = [display]
Key = [unit]
Key = [target_key]
Key = [text_cn]
Key = [target_sn_six]
Key = [target_sn_seven]
Key = [target_type]
Key = [storage_name]
Key = [target_index]
Key = [target_name]
Key = [display]
Key = [unit]
Key = [target_key]
Key = [text_cn]
Key = [target_sn_six]
Key = [target_sn_seven]
Key = [target_type]
Key = [storage_name]
Key = [target_index]
Key = [target_name]
Key = [display]
Key = [unit]
Key = [target_key]
Key = [text_cn]
Key = [target_sn_six]
Key = [target_sn_seven]
Key = [target_type]
Key = [storage_name]
Key = [backup_pload_s]
Key = [backup_vload_s]
Key = [backup_iload_s]
Key = [backup_pload_t]
Key = [backup_vload_t]
Key = [backup_iload_t]
Key = [etotal_buy]
Key = [eday_buy]
Key = [ebattery_charge]
Key = [echarge_day]
Key = [ebattery_discharge]
Key = [edischarge_day]
Key = [batt_strings]
Key = [meter_connect_status]
Key = [mtactivepower_r]
Key = [mtactivepower_s]
Key = [mtactivepower_t]
Key = [has_tigo]
Key = [hjgx]
Key = [tree]
Key = [coal]
Key = [pre_powerstation_id]
Key = [nex_powerstation_id]
Key = [powerflow]
Key = [pvStatus]
Key = [bettery]
Key = [betteryStatus]
Key = [load]
Key = [loadStatus]
Key = [grid]
Key = [soc]
Key = [socText]
Key = [hasEquipment]
Key = [gridStatus]
Key = [energeStatisticsCharts]
Key = [buy]
Key = [buyPercent]
Key = [sell]
Key = [sellPercent]
Key = [selfUseOfPv]
Key = [consumptionOfLoad]
Key = [chartsType]
Key = [hasPv]
Key = [hasCharge]
Key = [charge]
Key = [disCharge]
Key = [soc]
Key = [status]
franzel
Posts: 34
Joined: Saturday 24 October 2015 18:40
Target OS: Raspberry Pi / ODroid
Domoticz version: 20.2
Location: Wijchen, The Netherlands
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by franzel »

I am definitely not an expert concerning Domoticz and certainly not where it comes to scripting, but with this script even I appeared to be able to show data from my Goodwe device. Thanks for the clear explanation.
CrazyFrog
Posts: 21
Joined: Sunday 21 April 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by CrazyFrog »

franzel wrote: Sunday 05 May 2019 18:38 I am definitely not an expert concerning Domoticz and certainly not where it comes to scripting, but with this script even I appeared to be able to show data from my Goodwe device. Thanks for the clear explanation.
you're welcome
Flitske
Posts: 5
Joined: Monday 12 November 2018 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by Flitske »

Hello all,

I'm trying to get this working however i cannot get the curl command to work. I run windows 10 on my desktop and domoticz on a raspberry pi. Where do i put in the curl command? In de CMD on win 10 or in on the Raspberry Pi??
Thanks for your help.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest