Page 1 of 1

ZeverCloud_ReadData

Posted: Wednesday 07 February 2018 10:43
by JanAtHome
Hello
i try to get data from my solarcloud to domoticz, i get data but the json format i dont understand.
Can some one help me?

Domoticz log

Standard WebPage Json view

Code

Re: ZeverCloud_ReadData

Posted: Thursday 08 February 2018 7:32
by dannybloe
Can you print/log the response.statusCode and domoticz.log(response.headers). I suspect that the mime-type for the response is not application/json and then dzVents doesn't set the isJSON flag (and doesn't parse the json).

Re: ZeverCloud_ReadData

Posted: Thursday 08 February 2018 15:58
by JanAtHome
Ok i will make the log,

Re: ZeverCloud_ReadData

Posted: Thursday 08 February 2018 16:40
by JanAtHome
Ok i have loged the DATA

2018-02-08 16:39:01.741 dzVents: Info: {["Content-Type"]="text/plain;charset=UTF-8", ["Connection"]="keep-alive", ["EagleId"]="c33b46ca15181043407851967e", ["Via"]="cache14.l2hk1[287,200-0,M], cache29.l2hk1[287,0], cache6.uk1[804,200-0,M], cache2.uk1[805,0]", ["X-Swift-SaveTime"]="Thu, 08 Feb 2018 15:39:01 GMT", ["Timing-Allow-Origin"]="*", ["X-Swift-CacheTime"]="0", ["X-Cache"]="MISS TCP_MISS dirn:-2:-2 mlen:-1", ["Server"]="Tengine", ["Content-Length"]="274", ["Date"]="Thu, 08 Feb 2018 15:39:01 GMT"}

Re: ZeverCloud_ReadData

Posted: Thursday 08 February 2018 17:24
by dannybloe
There you have it. The contrnt-type isn’t application/json. Crappy service! You can do: local json=domoticz.utils.fromJSON(item.response.data)

Re: ZeverCloud_ReadData

Posted: Thursday 08 February 2018 20:35
by JanAtHome
ok tks, i wil try that command, and see what happens.

Re: ZeverCloud_ReadData

Posted: Saturday 10 February 2018 11:13
by JanAtHome
Hello Danny
No result jet, can i PM you?

Re: ZeverCloud_ReadData

Posted: Saturday 10 February 2018 12:56
by dannybloe
Yes, perhaps you can attach the raw response data (get it from your browser).

Re: ZeverCloud_ReadData

Posted: Saturday 10 February 2018 16:02
by JanAtHome
Hello Danny
This is the raw data from the webpage
{"sid":9187,"ludt":"2018-02-10 15:58:03","E-Today":{"unit":"kWh","value":5.3},"E-Month":{"unit":"kWh","value":146.4},"E-Total":{"unit":"MWh","value":7.25},"TotalYield":{"unit":"€","value":1449.48},"CO2Avoided":{"unit":"T","value":5.8},"Power":{"unit":"kW","value":1.63}}
Can you give me a example how to get this raw data into values.
Tks

Re: ZeverCloud_ReadData

Posted: Saturday 10 February 2018 16:15
by JanAtHome
A second way to read the data, is from the inverter, and not from the cloud, (better no internet problems)

When i get the data from the inverter direct , i get a string , maybe this is easyer.
The webpage result is then :

1 0 EAB971670029 YS9LQ8NBWRK6CQAS M11 17A31-727R+17829-719R 16:04 10/02/2018 0 1 SX00066011680017 1305 6.40 OK Error
screenshot.1940.jpg