This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

Easee EV Charger
#1
Hello, any ideas on how to integrate this? 

https://api.easee.cloud/index.html



I've found a Python script on github, is it possible to convert this in any way?

https://github.com/fondberg/pyeasee



Regards..
Reply
#2
This is a similar API: https://forum.logicmachine.net/showthread.php?tid=1786
There's a difference in login procedure (GetToken function). You need to set the 'content-type' header to 'application/json' and send username/password as json string:
Code:
request_body= json.encode({
  userName = 'aaa',
  password = 'bbb',
})
Reply
#3
Thanks, it works.

What would be the best way if i wanted the connection to the API to stay active, and then run seperate scripts for various commands?
It's not best practise to request new tokens for every command.
Reply
#4
Create a scheduled script that will call GetToken() periodically and save the token into storage. All other scripts will use this token to make requests.
Check the expiresIn field that /api/accounts/token returns. It will tell for how many seconds the token is valid. Adjust scheduled script execution period accordingly.
Reply


Forum Jump: