mpepping / solarman-mqtt

Send Solarman Smart PV inverter metrics to MQTT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Access Token not available

mhoogenbosch opened this issue · comments

The day before yesterday I noticed my sun screen's weren't closing with lot's of sun. Today I noticed it again and the following logging is presented:

INFO:root:Starting daemonized with a 60 seconds run interval
ERROR:root:Unable to fetch token: 'access_token'

Nothing has changed, and I can still logon to the home.solarmanpv.com url. What can this be? Everything seems to be in order. Or could it be something has changed with the in API / key provided by Solarman?

Every now and then I see the same message in my logs, but seldom. Is it still occurring on your setup? I see you're using a 60 sec. interval, maybe adjust that to 300, just to make sure not to hit any API quotas of the web service.

The Solarman API allow to fetch an access token, which than can be 'refreshed' via a renewal token. That process should also be more friendly for the API. I still need to find some time to add that :)

It has been working like this for months, never hit the API limit, but maybe they have changed something? I'll adjust and set to 300 just to see if that is better.

I will let you know.

And btw, yes it is still occurring.

I now have changed the run.py to respect the 300 sec again, but after starting the container it immediately start spitting out these errors. At a much higher interval than 300 secs.

2022-05-14T11:18:30.244934037Z INFO:root:Starting daemonized with a 300 seconds run interval
2022-05-14T11:18:30.519761313Z ERROR:root:Unable to fetch token: 'access_token'
2022-05-14T11:18:33.831313661Z INFO:root:Starting daemonized with a 300 seconds run interval
2022-05-14T11:18:34.107235408Z ERROR:root:Unable to fetch token: 'access_token'
2022-05-14T11:18:38.787616941Z INFO:root:Starting daemonized with a 300 seconds run interval
2022-05-14T11:18:39.094358060Z ERROR:root:Unable to fetch token: 'access_token'
2022-05-14T11:18:46.945435614Z INFO:root:Starting daemonized with a 300 seconds run interval

I tried to retrieve the token again with a curl command:

curl --location --request POST 'https://api.solarmanpv.com//account/v1.0/token?appId=APPID&language=en'
--header 'Content-Type: application/json'
--data-raw '{
"appSecret": "APPSECRET",
"email": "USERNAME",
"password": "PASSHASH"
}'

My respons was:

{"code":"2101010","msg":"appId insufficient allowance","success":false,"requestId":"8ef63c49fae48de1"}

I don't know what that is. but insufficient allowance sounds like something is changed.

Solved by Solarman themself. -> issue closed.