So they sent me the AppId and AppSecret.
Still to apply it to Home-Assist, but managed to play with the API using terminal on my Macbook.
Basically, everything is Post requests, using Auth headers (Access Token).
But first, you need to obtain the access token… to get the access token you have to send a post request as follows,
curl --request POST \
--url 'https://api.solarmanpv.com/account/v1.0/token?appId=<appId>&language=en&=' \
--header 'Content-Type: application/json' \
--data '{
"appSecret": "<appSecret>",
"email": "<email>",
"password": "<passwordConvertedToSHA256>"
}'
If done correctly, you’ll receive a JSON string, containing an access and refresh token.
Something like this,
{
"code": null,
"msg": null,
"success": true,
"requestId": "<req_id>",
"access_token": "<token>",
"token_type": "bearer",
"refresh_token": "<token>",
"expires_in": "5183999",
"scope": null,
"uid": <uid>
}
Once you have that going, you can start requesting different data based on the documentation.
Example to get the real time data (well kinda real time, noticed about a 6 minute delay) , you can do that following.
curl --request POST \
--url 'https://api.solarmanpv.com/device/v1.0/currentData?appId=<appId>&language=en&=' \
--header 'Authorization: bearer <accessToken>' \
--header 'Content-Type: application/json' \
--data '{
"deviceSn": "<deviceSerial>"
}'
In my case, I added my Inverter’s serial number. Something like 2004xxxxxx.
Returned data would be json and looks something like this,
{
"code": null,
"msg": null,
"success": true,
"requestId": "<reqID>",
"deviceSn": "<serial>",
"deviceId": <devid>,
"deviceType": "INVERTER",
"deviceState": 1,
"dataList": [
..... A LOT OF DATA HERE.......
]
}
Let me know if you get stuck!
Cheers