Thanks to sincze for his great help. I can confirm that script works great.sincze wrote: ↑Wednesday 16 August 2017 21:53 So forum member devros and myself have been playing around to see if we could modify the initial shinemonitor script in such a way that it should work for all kinds of inverters that report their data to shinemonitor.
Kudo's to the devros and his wireshark skills.![]()
Pay special attention to the following values:
pn= on your wifi stick or can be found on the shinemonitor portal after signing in the regular way
sn= the serial number of your inverter. Can also be found on the official portal
devcode= this tricky number you have to extract using for example chrome f12 (under network) to see an initial string between your browser and shinemonitor. It seems every brand has its own devcode.
Just run with Python3 as cronjob every 5 minutes or so.
Have fun!!.
devros & sincze.
[/code][/spoiler]
Ginlong, Omnik Solar, Solarman and Trannergy Inverters Topic is solved
Moderator: leecollings
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
-
- Posts: 6
- Joined: Tuesday 17 October 2017 10:07
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Hello,
I have used this script for over 2 months now for to locations i want to monitor.
But it suddenly stopped working with the following error.
This is my file (without the login).
Many thanks.
I have used this script for over 2 months now for to locations i want to monitor.
But it suddenly stopped working with the following error.
Did something changed in de omnik api?Traceback (most recent call last):
File "/volume1/public/OmnikAmerongen.py", line 28, 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 364, in open_http
return self.http_error(url, fp, errcode, errmsg, headers)
File "/usr/lib/python2.7/urllib.py", line 377, in http_error
result = method(url, fp, errcode, errmsg, headers)
File "/usr/lib/python2.7/urllib.py", line 642, in http_error_302
headers, data)
File "/usr/lib/python2.7/urllib.py", line 669, in redirect_internal
return self.open(newurl)
File "/usr/lib/python2.7/urllib.py", line 213, in open
return getattr(self, name)(url)
File "/usr/lib/python2.7/urllib.py", line 350, in open_http
h.endheaders(data)
File "/usr/lib/python2.7/httplib.py", line 1100, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 931, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 893, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 870, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 575, in create_connection
raise err
IOError: [Errno socket error] [Errno 110] Connection timed out
This is my file (without the login).
I hope if somebody can help me out repairing this and let it be awesome again.#!/usr/bin/python
import urllib, urllib2, hashlib
from xml.etree import ElementTree as ET
#config
username = 'username' #your portal username
password = 'Password' #your portal password
baseURL = 'http://www.omnikportal.com:10000' #base url
stationid = '78079' #station Amerongen id, get this via the station python script
#domoticz settings
domoticz_host = '192.168.170.5'
domoticz_port = '8084'
domoticz_url = 'json.htm'
domoticz_ActualPower = '148' #idx of new device
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¶m=udevice&idx=" + domoticz_ActualPower+ "&nvalue=0&svalue=" + ActualPower + ";" + etotalstr)
urllib.urlopen(url)
url = ("http://" + domoticz_host + ":" + domoticz_port + "/" + domoticz_url+ "?type=command¶m=udevice&idx=153&nvalue=0&svalue=" + etoday)
urllib.urlopen(url)
Many thanks.
-
- Posts: 6
- Joined: Tuesday 17 October 2017 10:07
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Oh maybe it's handy to know that i'm running domoticz v3.8153 from Jadalh on a synology DS1515+.
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Same issue here with 3 Omnik inverters.Brammetje wrote:Oh maybe it's handy to know that i'm running domoticz v3.8153 from Jadalh on a synology DS1515+.
Same domoticz version on my raspberry. (don't think that is the problem) I will have to look into it as well. Not home at the moment. Iogged in to omnik portal today and my data is available over there. Fingers crossed we fix the problem.
Sent from my SM-G925F using Tapatalk
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 10
- Joined: Sunday 16 April 2017 11:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8153
- Location: NL
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Same problem here.sincze wrote: ↑Tuesday 17 October 2017 20:07Same issue here with 3 Omnik inverters.Brammetje wrote:Oh maybe it's handy to know that i'm running domoticz v3.8153 from Jadalh on a synology DS1515+.
Same domoticz version on my raspberry. (don't think that is the problem) I will have to look into it as well. Not home at the moment. Iogged in to omnik portal today and my data is available over there. Fingers crossed we fix the problem.
Sent from my SM-G925F using Tapatalk
Stopped working 14-10
-
- Posts: 6
- Joined: Tuesday 17 October 2017 10:07
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Did it stop with the both off you at around 13:00?
-
- Posts: 10
- Joined: Sunday 16 April 2017 11:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8153
- Location: NL
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Around 13:00
But at this moment it's working again
But at this moment it's working again

- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Indeed



Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
- hansonexperience
- Posts: 12
- Joined: Thursday 19 October 2017 14:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.1
- Location: the Netherlands
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Installed the scripts, but got errors on both files.
I use solarmanportal
stationid.py gives this error:
Solarman.py gives:
Please can someone help me out?
I use solarmanportal
stationid.py gives this error:
Code: Select all
File "/home/pi/domoticz/scripts/stationid.py", line 4, in <module>
from urllib.request import urlopen
ImportError: No module named request
Code: Select all
File "/home/pi/domoticz/scripts/solarman.py", line 34, in <module>
root = ET.parse(urllib.urlopen(requestURL)).getroot()
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1182, in parse
tree.parse(source, parser)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 657, in parse
self._root = parser.close()
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1654, in close
self._raiseerror(v)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror
raise err
xml.etree.ElementTree.ParseError: no element found: line 1, column 0
Solar: pvoutput, solarman, JFY inverter, enelogic, slimmemeterportal, Greenchoice
Weather: Davis VUE ISS, meteobridge wunderground, Asus WL -330N3G, leuven template
Website: http://www.hansonexperience.com / http://www.mooiweerboxtel.nl
Weather: Davis VUE ISS, meteobridge wunderground, Asus WL -330N3G, leuven template
Website: http://www.hansonexperience.com / http://www.mooiweerboxtel.nl
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Mmm "Installed the scripts", the scripts for python2 or python3.hansonexperience wrote: ↑Thursday 19 October 2017 14:29 Installed the scripts, but got errors on both files.
I use solarmanportal
stationid.py gives this error:Solarman.py gives:Code: Select all
File "/home/pi/domoticz/scripts/stationid.py", line 4, in <module> from urllib.request import urlopen ImportError: No module named request
Please can someone help me out?Code: Select all
File "/home/pi/domoticz/scripts/solarman.py", line 34, in <module> root = ET.parse(urllib.urlopen(requestURL)).getroot() File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1182, in parse tree.parse(source, parser) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 657, in parse self._root = parser.close() File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1654, in close self._raiseerror(v) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror raise err xml.etree.ElementTree.ParseError: no element found: line 1, column 0
I guess python3 and you are using python2 to execute them.
Why .. well as the python2 script for stationid. says:
Code: Select all
import urllib, urllib2, hashlib
from xml.etree import ElementTree as ET
Code: Select all
import urllib, hashlib
from urllib.request import urlopen
from xml.etree import ElementTree as ET
Code: Select all
Traceback (most recent call last):
File "test_stationid3.py", line 4, in <module>
from urllib.request import urlopen
ImportError: No module named request

Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
- hansonexperience
- Posts: 12
- Joined: Thursday 19 October 2017 14:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.1
- Location: the Netherlands
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Thx. I am a newbie to python. I am using domoticz for my energycounters.sincze wrote: ↑Thursday 19 October 2017 19:17Mmm "Installed the scripts", the scripts for python2 or python3.hansonexperience wrote: ↑Thursday 19 October 2017 14:29 Installed the scripts, but got errors on both files.
I use solarmanportal
stationid.py gives this error:Solarman.py gives:Code: Select all
File "/home/pi/domoticz/scripts/stationid.py", line 4, in <module> from urllib.request import urlopen ImportError: No module named request
Please can someone help me out?Code: Select all
File "/home/pi/domoticz/scripts/solarman.py", line 34, in <module> root = ET.parse(urllib.urlopen(requestURL)).getroot() File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1182, in parse tree.parse(source, parser) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 657, in parse self._root = parser.close() File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1654, in close self._raiseerror(v) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror raise err xml.etree.ElementTree.ParseError: no element found: line 1, column 0
I guess python3 and you are using python2 to execute them.
Why .. well as the python2 script for stationid. says:
and not (this is python3 code):Code: Select all
import urllib, urllib2, hashlib from xml.etree import ElementTree as ET
Where your error seems to come from and which will result into an error when executed with python2.7Code: Select all
import urllib, hashlib from urllib.request import urlopen from xml.etree import ElementTree as ET
So I would say install python3Code: Select all
Traceback (most recent call last): File "test_stationid3.py", line 4, in <module> from urllib.request import urlopen ImportError: No module named request
to solve your issue..
I do not know if python 3 would do any harm so I am a bit worried in installing version 3.
But how will these 2 scripts look like when written for python 2?
Solar: pvoutput, solarman, JFY inverter, enelogic, slimmemeterportal, Greenchoice
Weather: Davis VUE ISS, meteobridge wunderground, Asus WL -330N3G, leuven template
Website: http://www.hansonexperience.com / http://www.mooiweerboxtel.nl
Weather: Davis VUE ISS, meteobridge wunderground, Asus WL -330N3G, leuven template
Website: http://www.hansonexperience.com / http://www.mooiweerboxtel.nl
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
No worries python3 and 2.7 can run side by side (because they each have their own directory).
I know because I wrote python3 scripts and have 2.7 installed as well.
I know because I wrote python3 scripts and have 2.7 installed as well.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
- hansonexperience
- Posts: 12
- Joined: Thursday 19 October 2017 14:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.1
- Location: the Netherlands
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Oké. Thx! How do the scripts know which version to use?
Solar: pvoutput, solarman, JFY inverter, enelogic, slimmemeterportal, Greenchoice
Weather: Davis VUE ISS, meteobridge wunderground, Asus WL -330N3G, leuven template
Website: http://www.hansonexperience.com / http://www.mooiweerboxtel.nl
Weather: Davis VUE ISS, meteobridge wunderground, Asus WL -330N3G, leuven template
Website: http://www.hansonexperience.com / http://www.mooiweerboxtel.nl
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
well actually the scripts don't know.
you have to know.
call a v2.7 python script with: python27 <script.name>
and a v3 python script with: python3 <script.name>
you have to know.
call a v2.7 python script with: python27 <script.name>
and a v3 python script with: python3 <script.name>
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Mmm I still have data and yesterday as well until 18.30 (when it was dark)
Sent from my SM-G925F using Tapatalk
Sent from my SM-G925F using Tapatalk
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
- hansonexperience
- Posts: 12
- Joined: Thursday 19 October 2017 14:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.1
- Location: the Netherlands
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
I installed python 3 but the scripts do not work for solarman.
Solar: pvoutput, solarman, JFY inverter, enelogic, slimmemeterportal, Greenchoice
Weather: Davis VUE ISS, meteobridge wunderground, Asus WL -330N3G, leuven template
Website: http://www.hansonexperience.com / http://www.mooiweerboxtel.nl
Weather: Davis VUE ISS, meteobridge wunderground, Asus WL -330N3G, leuven template
Website: http://www.hansonexperience.com / http://www.mooiweerboxtel.nl
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
no output? I don't have solarman myself . so can not confirm.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 4
- Joined: Monday 13 November 2017 13:00
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
Hey - did you have any luck with solax?Erwinvos72 wrote: ↑Friday 30 September 2016 10:46 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.
-
- Posts: 1
- Joined: Saturday 06 January 2018 13:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8153
- Contact:
Re: Ginlong, Omnik Solar, Solarman and Trannergy Inverters
What type of virtual sensor do I need to create? Because the energy sensor type in the example in the first post is not present when I add a virtual sensor. I have now added a virtual sensor of type "General KWH" (Electric instant + counter) and I do get data in this sensor
Who is online
Users browsing this forum: No registered users and 1 guest