Closed pospischil closed 1 day ago
Does your developer token start with "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9"? This is what is checked during startup.
No, it starts with "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
When did you purchase your Awair device? Appears that Awair has changed the initial characters of their Developer token. I had communication with Awair quite some time ago concerning the token and will have to try to dig it up.
The Developer Token is a JWT or JSON Web Token based on your user_id.
It appears that Awair has changed their format and when I check on my web token through the Awair app, I find that I have the same as you.
I will release an update by the end of the week that supports both old and new preamble.
I purchased this many years ago, not sure when it was exactly. Maybe like 5 or more?
It's an awair-r2, pre-element (but basically the same as an element, as far as I know the only difference is the case is walnut instead of whatever the white material is.
Thanks so much!
I also have an Awair-r2 as well as an Awair-Element and Awair-Omni for testing.
Just released v5.12.3 with support for the new token. Please give it a try and let me know if the plug-in now works for you.
Thanks for bringing this issue to my attention!
Awesome, I'll give a try ASAP and report back, thanks so much!
That fixed it, thanks!
Describe Your Problem: I'm getting an error with the plugin, it tells me that the token is not valid, but there are no leading/trailing spaces or curly braces. When I run the test CURL, it works fine: % curl -X GET \ https://developer-apis.awair.is/v1/users/self/devices \ -H 'Authorization: Bearer TOKENHERE' {"devices":[{"name":"Aware 2", "deviceId":4348, "deviceType":"awair-r2", "deviceUUID":"awair-r2_4348", "latitude":REDACTED, "longitude":REDACTED, "preference":"GENERAL", "locationName":"REDACTED", "roomType":"BEDROOM", "spaceType":"HOME", "macAddress":"REDACTED", "timezone":"America/New_York"}]}%
Logs:
[9/11/2024, 4:38:41 PM] [Awair2] Initializing Awair2 platform... [9/11/2024, 4:38:41 PM] [Awair2] Awair Developer token is not valid. Please check that token is entered correctly with no leading spaces.
Plugin Config:
{ "token": "TOKENHERE NO LEADING/TRAILING SPACES OR CURLY BRACES", "userType": "users/self", "airQualityMethod": "awair-score", "endpoint": "15-min-avg", "limit": 1, "enableTvocPm25": false, "occupancyDetection": false, "occupancyRestart": false, "logging": false, "verbose": false, "enableModes": false, "modeTemp": false, "modeTime": false, "development": false, "platform": "Awair2" }
Screenshots: N/A
Environment: