Open olibos opened 1 year ago
As I see api send:
the same errorcode (403) in case of expired Token and too many KPI request. too many request. So token should be refreshed by timer. If there is only one api client it is in 1 request/min limit.
StationCode doesnt matter (getDevRealKpi).
wrong DevId, data is empty 200 {'data': [], 'failCode': 0, 'message': None, 'params': {'currentTime': 1666167050027, 'devIds': 'xxx', 'devTypeId': 1}, 'success': True}
wrong DevType, data is none 200 {'data': None, 'failCode': 20006, 'message': None, 'params': {'currentTime': 1666166945489, 'devIds': 'xxx', 'devTypeId': 1345}, 'success': False} "6 20006 Some devices do not match the device type."
I cannot test if there are more devices.
Sorry, it is not working stably, dont use
post getDevRealKpi return this message if the token is not valid. { "failCode": 305, "immediately": true, "message": "USER_MUST_RELOGIN" }
So you can request new token when you get this error message, schedule is not necessary.
I hided my comments in this topic. I think the limits should be enough for operating this integration when no more api client. I think token request in every 5 mins is more simplier than any other solution. Static DevID, DevType shouldnot be complicated development (same than stationCode). A script may be enogh that get the right parameters. user can copy them into the configuration.yaml. Set this feature lower proirity. Thank you Ferenc
Tasks:
Source: @fmarton https://github.com/olibos/Home-Assistant-FusionSolar-OpenApi/issues/1#issuecomment-1283459514