SolisCloud-ReadOut
Had the impression that new SolisCloud would now be same as for all other invertertypes related to solarmanpv.com, but that seems mistake.
When trying
grover01's script (with line-numbers inserted as reference for fault-finding), filling in with received info for appID and appSecret, the resulting error-message is
Code: Select all
sudo python3 /home/pi/domoticz/scripts/python/Grover01_SolisRead_0185.py
{'code': '2101021', 'msg': 'auth invalid appId', 'success': False, 'requestId': '9c48881b4ef97670'}
Traceback (most recent call last):
File "/home/pi/domoticz/scripts/python/Grover01_SolisRead_0185.py", line 40, in <module>
accesstoken = data['access_token']
KeyError: 'access_token'
Looking at contents of the error-message, that traces back to the following lines of the script
Code: Select all
conn.request("POST", "/account/v1.0/token?appId="+appID+"&language=en", payload, headers) # Trannergy call for info
res = conn.getresponse()
data = json.loads(res.read())
print(data) # Test = look at decoded JSON-file
accesstoken = data['access_token']
print("Accesstoken :" +accesstoken)
Needing another setup for the call-string?
In original script under Trannergie-account details see
In Solis-key-info received this url-header
Code: Select all
API_Url = "https://www.soliscloud.com:13333/"
Testingly changed the scriptline below the section for account-settings, which defines the function conn
Code: Select all
# conn = http.client.HTTPSConnection(apiSite) # Original connection-setup for Trannergy etc.
conn = http.client.HTTPSConnection(API_Url) # Setup adapted for SolisCloud
The error report now becomes that the port is not recognised.
Code: Select all
http.client.InvalidURL: nonnumeric port: '13333/'
Deleting the portnumber 13333 doesn't help
Code: Select all
Traceback (most recent call last):
File "/usr/lib/python3.7/http/client.py", line 891, in _get_hostport
port = int(host[i+1:])
ValueError: invalid literal for int() with base 10: '//www.soliscloud.com'
It more or less confirms that the problem is in the scriptline defining the function conn.
Somebody already solved this puzzle for initial entry to soliscloud?