Air Things View Plus

Let me know if there’s anything else you’d like me to try!

I changed the URL on it, can you try one more time?

Added some additional code that has worked with other oAuth2 systems, if someone has the time to do a test and post/send me the logs (redacting password and user id please).

1 Like

Sorry, for some reason, I missed your message yesterday. Sorry about that…

Tried the latest code without oAuth enabled:

And with it enabled:

Doubting it, but we get anything in state.temp_token on the app status page?

1 Like

Don’t seem to even have state.temp_token… unless I’m not looking in the right spot…?

Didn’t think we’d gotten a return based on the log. Need to find some documentation on their authorization flow so that I’m not guessing.

1 Like

I have installed and run the test app and don't see any data values return - this you already know, but I would really like to have the AirThings integration with HE and am also willing to help test.

1 Like

The issue with these is always figuring out the authorization sequence, after that its usually fairly straight forward. Might have to break down and learn enough python to reverse engineer their example.

1 Like

Thanks for looking into this integration @thebearmay, I'm happy to help when I can as well!

May have cracked the authorization nut. New version (0.0.1) out at the link above. You'll need to get an API ID and Secret from Air Things (link is in the app), and then click the Create Initial Authorization. If that works, the app will have run a Get Devices query - at the moment this should query the devices and return some debug messages, long term it will create one or more devices. The "Get Devices" button (should show up after the initial authorization has completed successfully) is for later use if you add more sensors. I'm currently getting the token returned, but get a 401 on the attempt to read devices - hoping that's because I don't have any to report.

If anyone has time and could load the new code, enter the ID and Secret, hit Initial Authorization and then post the logs (please redact the ID and Secret) I'd appreciate it.

2 Likes

Right now, I am getting the following when I run the app:


Try re-importing…didn’t like me taking a substring of something that didn’t exist…DUH🤦‍♂️

1 Like

Lol. Still getting the error - Is there a way to confirm I have the latest?

Irony is I was trying to clean up the display. If you reimport line 82 should now have an if statement and the version should be 0.0.3 and hopefully I have corrected my oversight

1 Like

Looks like it worked! There’s more data in the logs for sure…

Looks like getting the token is working, but I have something wrong with the devices query. Time to do some more digging.

Thanks!

2 Likes

Yup! It’s nice to see this progressing! :smiley:

Thank you! Signing out for tonight.

New version v0.0.4, should bring back the device list and generate a debug line per device (assuming that you have debugging enabled)

Just tried and get this error

Screenshot 2022-10-13 140526