Ginlong, Omnik Solar, Solarman and Trannergy Inverters Topic is solved

Python and python framework

Moderator: leecollings

Erwinvos72
Posts: 61
Joined: Thursday 25 February 2016 16:30
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by Erwinvos72 »

I am new on domoticz and with much help i was able to get my evohome system in domoticz. But i have a solarman account with panels on my roof. And i see that is possible to get the information into domoticz. I have gone through the information but it is a bit confusing.

As far as i understand
- create virtual hardware with dummy
- create virtual sensor in devices (question: what type do i have to choose?)

- which script is complete and can i use? This part is very confusing to understand because there are many people with solutions and add-ons

Thanks already for your answer and help
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by Derik »

This is working fine...
For my Sofarsolar inverter....

Code: Select all

#!/usr/bin/python

import urllib, urllib2, hashlib
from xml.etree import ElementTree as ET


#config
username          = ' YOUR MAIL' #your portal username
password          = ' YOUR PASS ' #your portal password
baseURL          = 'http://www.solarmanpv.com:10000/' #base url
stationid          = ' YOUR STATION ID ' #station id, get this via the station python script

# example: Working base urls:  [ CHANG THE URL FOR YOU INVERTER
#      http://www.ginlongmonitoring.com:10000/
#      http://www.omnikportal.com:10000/
#      http://log.trannergy.com:10000/
#      http://www.solarmanpv.com:10000/

   
#domoticz settings
domoticz_host         = '192.168.5.70'
domoticz_port         = '8080'
domoticz_url          = 'json.htm'
domoticz_ActualPower   = '3905' #optional [ YOUR DUMMY IDX  ]

m = hashlib.md5()
m.update(password)


#building url
requestURL = baseURL+'/serverapi/?method=Login&username='+username+'&password='+m.hexdigest()+'&key=apitest&client=iPhone'

#login call
root = ET.parse(urllib.urlopen(requestURL)).getroot()
token = root.find('token').text

print 'Logged In: '+username

#info url
infoURL = baseURL+'/serverapi/?method=Data&username='+username+'&stationid='+stationid+'&token='+token+'&key=apitest'

print 'Getting Info... '



#login call
infoRoot = ET.parse(urllib.urlopen(infoURL)).getroot()

income = infoRoot.find('income')
TodayIncome = income.find('TodayIncome').text
ActualPower = income.find('ActualPower').text
etoday = income.find('etoday').text
etotal = income.find('etotal').text
multiply='1000.0'
etotal1000 = float(etotal) * float(multiply)
TotalIncome = income.find('TotalIncome').text

etotalstr=str(etotal1000)

#logging values
print 'TodayIncome: '+TodayIncome
print 'ActualPower: '+ActualPower
print 'etoday: '+etoday
print 'etotal: '+etotal
print 'etotal 1000: '+etotalstr


#uploading values to domoticz
url = ("http://" + domoticz_host + ":" + domoticz_port + "/" + domoticz_url+ "?type=command&param=udevice&idx=" + domoticz_ActualPower+ "&nvalue=0&svalue=" + ActualPower+ ";" + etotalstr)

And the place:
ScreenShot124.jpg
ScreenShot124.jpg (48.87 KiB) Viewed 6602 times

And make it executable or something look @ the RWX
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Erwinvos72
Posts: 61
Joined: Thursday 25 February 2016 16:30
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by Erwinvos72 »

So if i understand create the virtual hardware and use the idx for the sofarsolar.py script?
And is it realtime or do you have to create a task schedular or something like that

And get the station id is running the script stationid.py i saw, so i will try it

Thnx
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by Derik »

Yes use the idx and set your domoticz settings and the inverter setting of your brand.
realtime
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Erwinvos72
Posts: 61
Joined: Thursday 25 February 2016 16:30
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by Erwinvos72 »

I have created the stationid.py and tested it. the inverter setting was shown
Then i created the, in my case, solarman.py and put it a debian-chroot directory (i use debian chroot, and within that i have root and subdirs).
Then i started ./solarman.py from within debian-chroot and i received the output which i copied below. Any suggestions?

root@Synology:~/Zonnepanelen# ./solarman.py
Traceback (most recent call last):
File "./solarman.py", line 34, in <module>
root = ET.parse(urllib.urlopen(requestURL)).getroot()
File "/usr/lib/python2.7/urllib.py", line 87, in urlopen
return opener.open(url)
File "/usr/lib/python2.7/urllib.py", line 213, in open
return getattr(self, name)(url)
File "/usr/lib/python2.7/urllib.py", line 351, in open_http
errcode, errmsg, headers = h.getreply()
File "/usr/lib/python2.7/httplib.py", line 1145, in getreply
response = self._conn.getresponse()
File "/usr/lib/python2.7/httplib.py", line 1073, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 415, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 371, in _read_status
line = self.fp.readline(_MAXLINE + 1)
File "/usr/lib/python2.7/socket.py", line 476, in readline
data = self._sock.recv(self._rbufsize)
IOError: [Errno socket error] [Errno 104] Connection reset by peer
root@Synology:~/Zonnepanelen#
BasvdLinde
Posts: 5
Joined: Saturday 02 April 2016 11:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by BasvdLinde »

Hy all,

I'm a bit of a beginner with raspberry and Domoticz, but would like to add my solar panels to my setup. I've started with filling out the script, but how and where can I get the station id which I need to fill out?

Thanks in advance
gdg16
Posts: 7
Joined: Monday 21 September 2015 11:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by gdg16 »

BasvdLinde wrote:Hy all,

I'm a bit of a beginner with raspberry and Domoticz, but would like to add my solar panels to my setup. I've started with filling out the script, but how and where can I get the station id which I need to fill out?

Thanks in advance
You need to edit and run the stationid.py file.
You can run the script as follows: sudo python stationid.py
BasvdLinde
Posts: 5
Joined: Saturday 02 April 2016 11:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by BasvdLinde »

Hy all,

got it running now, perfect!

Thanks a lot!
gdg16
Posts: 7
Joined: Monday 21 September 2015 11:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by gdg16 »

Which virtual sensor do i need to choose? I have chosen for the "Elektra (aktueel + teller)" but now i don't see decimal numbers.
Naamloos.png
Naamloos.png (16.18 KiB) Viewed 6477 times
Baskoomen
Posts: 1
Joined: Thursday 16 June 2016 7:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by Baskoomen »

Mediacj wrote:
.....

EDIT:
Found it already it was the authorization on the Domoticz database, now it works :D
Can you tell me how you fixed this? I have the same issue but no idea how I can adjust the rights to the database....
User avatar
Mediacj
Posts: 74
Joined: Wednesday 11 February 2015 16:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by Mediacj »

It's long ago but I think it is the authorization in the http string, so you have to add the username password:

http://<username:password@>domoticz-ip<:port>/json.htm?api-call
Erwinvos72
Posts: 61
Joined: Thursday 25 February 2016 16:30
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by Erwinvos72 »

Is there already a possibility to read the values from a Solax-X inverter in Domoticz? I have tried it with the base settings in the stationid.py but i receive errors when i run the script about http.
robinschip
Posts: 3
Joined: Sunday 02 November 2014 8:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Castricum - Netherlands
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by robinschip »

Hi,

is there a way to get data without the username and password?
i have a few sites i would like monitor, and they are all publicsites: http://www.omnikportal.com/Terminal/Ter ... &pid=17390

or is there an explanation for the api they used?

With regards,
Bou19
Posts: 1
Joined: Sunday 10 January 2016 18:13
Target OS: Raspberry Pi / ODroid
Domoticz version: Latest
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by Bou19 »

Hi,
I am new to this and i'm trying to find the stationid.py file. I can't find it in Domoticz. Or, do i have to create it? If so, what do I put in the file then?

With regards,
underscore4
Posts: 20
Joined: Sunday 19 March 2017 22:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by underscore4 »

Hi,
i have tried to configure this python script and seems to work by terminal. Anyway i dont see any data on domoticz. Would you please help me about?

Here what i see by the script:

python /home/amministratore/domoticz/scripts/ginlong.py
Logged In: my username
Getting Info...
TodayIncome: 2.52
ActualPower: 550
etoday: 14
etotal: 590
etotal 1000: 590000.

Here what i see in the ginlong.py

#!/usr/bin/python

import urllib, urllib2, hashlib
from xml.etree import ElementTree as ET


#config
username = 'myuser' #your portal username
password = 'mypassword' #your portal password
baseURL = ' http://www.ginlongmonitoring.com:10000/' #base url
stationid = 'xxxx' #station id, get this via the station python script

# example: Working base urls:
# http://www.ginlongmonitoring.com:10000/
# http://www.omnikportal.com:10000/
# http://log.trannergy.com:10000/
# http://www.solarmanpv.com:10000/


#domoticz settings
domoticz_host = '192.168.2.177'
domoticz_port = '8088'
domoticz_url = 'json.htm'
domoticz_ActualPower = '82001' #optional

m = hashlib.md5()
m.update(password)


#building url
requestURL = baseURL+'/serverapi/?method=Login&username='+username+'&password='+m.hexdigest()+'&key=apitest&client=iPhone'

#login call
root = ET.parse(urllib.urlopen(requestURL)).getroot()
token = root.find('token').text

print 'Logged In: '+username

#info url
infoURL = baseURL+'/serverapi/?method=Data&username='+username+'&stationid='+stationid+'&token='+token+'&key=apitest'

print 'Getting Info... '



#login call
infoRoot = ET.parse(urllib.urlopen(infoURL)).getroot()

income = infoRoot.find('income')
TodayIncome = income.find('TodayIncome').text
ActualPower = income.find('ActualPower').text
etoday = income.find('etoday').text
etotal = income.find('etotal').text
multiply='1000.0'
etotal1000 = float(etotal) * float(multiply)
TotalIncome = income.find('TotalIncome').text

etotalstr=str(etotal1000)

#logging values
print 'TodayIncome: '+TodayIncome
print 'ActualPower: '+ActualPower
print 'etoday: '+etoday
print 'etotal: '+etotal
print 'etotal 1000: '+etotalstr

#uploading values to domoticz
url = ("http://" + domoticz_host + ":" + domoticz_port + "/" + domoticz_url+ "?type=command&param=udevice&idx=" + domoticz_ActualPower+ "&nvalue=0&svalue=" + ActualPower+ ";" + etotalstr)


Anyone would you please try to help me? Thanks in advance
nwessels
Posts: 2
Joined: Wednesday 07 June 2017 21:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by nwessels »

Hi,

@underscore4 or someone else: did you solved your problem? I have the same problem. like to hear your solution.

Grtz Niels
JacquesMulders
Posts: 33
Joined: Saturday 03 January 2015 22:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by JacquesMulders »

nwessels wrote:Hi,

@underscore4 or someone else: did you solved your problem? I have the same problem. like to hear your solution.

Grtz Niels
underscore4 wrote:Hi,
i have tried to configure this python script and seems to work by terminal. Anyway i dont see any data on domoticz. Would you please help me about?
if youv'e had read the topic you would have known the script rounds up the value's, because omnik doesnt provide the value's in kWh... if you dont want roundup numbers youve have to write a script yourself, or get som hardware witch can measure in watts
User avatar
galadril
Posts: 824
Joined: Monday 07 September 2015 10:32
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by galadril »

Hmm lijkt erop dat de api url niet meer werkt voor Omnik Solar..
Solar panels of Ginlong, Omnik-Solar, Transenergy or Solarman?? Try my Android app:
https://play.google.com/store/apps/deta ... ongmonitor
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by Derik »

mm did they set anything different?
is the Solarman then also not working?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
devros
Posts: 183
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters

Post by devros »

hello, any chance to support this portal
im using invertor with limiter and USB-PLUG (witch is registred to this page)
http://www.shinemonitor.com/main.html
looks similar to omnik
tried restfull page http://www.shinemonitor.com:10000/
but number is propablly diferent.... any idea how to find right number?
thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest