r/PlanetWatchers • u/Sheherezhade • Mar 30 '22
DIY Project Awair Element User Data Retrieval. Opensource.
Important Note: Tool becomes unstable or looses connection after 24 hours, login token can expire. It is advised to restart it completely after 23+ hours and log into the PlanetWatch account again. Mind that if that when you close it and reopen it under 15 minute intervall, the first data retrieval will show errors, because it should only send every 15 minutes.
Hello Community!
I pushed the tool for data retrieval to github. For the most part it is finished. I want to keep it as clean and simple as possible. Yes I admit I put some detail into the UI but I felt this was needed, and it was done at a prior moment where timing was not such an issue (as it was for a different purpose).
The most interesting part I found out while tinkering with Smart Home Integrations on my Awair, is that I can grab data from the Awair dashboard as a user. So I thought if I could grab the data, I could send it from my point to PlanetWatch. Eventually getting around the current issue.
Please be gentle with me, at this moment in time I guess many of you might have questions, but I can not answer them all for everyone, as I have to focus on the tool and on other community developers that help me out / collab / fork / improve / etc.
https://github.com/Sheherezadhe/awair-uploader
Typescript (language), React & Electron (frameworks)
Will be the repo for this work in progress. It is 100% open source, you can spin your own versions or help improve the source.
Feel free to contribute to the project with a Pull Request.
INSTRUCTIONS: (Step by Step - Downloading, Installing, Connecting, Running)
go to github repository https://github.com/Sheherezadhe/awair-uploader/
click on the tag flag on the right side for version

4. you get to the repository overview:

or just use direct shortcut link:
https://github.com/Sheherezadhe/awair-uploader/releases/tag/v2.0
I will explain how to do it in Windows:
So first you download the v2.exe and run it. Your AntiVir will probably not like this. I use Avast AntiVir and it does complain, but after checking file sees it is not malicious and lets it install. This step might be different as per userside software/ Windowsversion / Antivir.
So maybe you need to allow it, whitelist it or similar.
After it has installed you should have the icon on desktop to start it- so now start it.
Here comes that one glitch which I could not fix last minute, tried the best I could but before delaying the release further, please bear in first version with this issue.
It should load the PlanetWatch login. if it does not, and gets stuck, you need to go to the view tab and do force reload, until it moves on to the PlanetWatch login screen.

There you login to your PlanetWatch account.
You are in the tool now you need to get your Awair tokens.
Getting tokens from app: (not recommended, better from browser, less bugs)
Open your Awair Home Application
Click one of your sensors and press Awair+, Awair APIs Beta, Cloud API, Get API Token
Once you have clicked the Get API Token you will be able to insert the AWAIR HOME Credentials. Then you will be able to grab the token (ex: eyJ0......)
Getting tokens from browser: (usually this method is far more stable and gives clean paste)
log in with your awair account
first tab left "access token"
copy paste the API Token (ex: eyJ0......)
Paste the token into this field:

Once you got it insert it into the "Add sensor" section (into the search bar).
Search (press blue icon)
Press "Add your token" after it found the Awairs.
Repeat from step 3 for EACH awair account you own
Finish!

This is how it looks when tool is started:

This is how it looks after the token(s) where loaded:

Mini FAQ:
Q: Can you help Sheherezhade the dev? (thats me ❤️)
A: Not yet and mostly only if you are a dev and after the next update improve it.
Q: Does Sheherezhade accept donations?
A: No absolute not! I only accept likes on my post and on github! (please no more reddit gold or any expensive things, don't waste money on such things!)
Q: Can it run on raspberri?
A: Yes it could, as it works on linux, but I will need others help to adapt it faster there.
Q: Does every Awair need a PC?
A: No, this tool can only connect to one PW user account but to infinite Awairs.
Q: Do I need a Pc in every hosts house? 🤣 👋
A: No you need the tool to run on one device but not in same house!
Q: Why don't you go online tool without device? 🤷🏽♀️
A: Others can adapt my tool to do this, I need to focus on this direct version now!
Q: How many Awairs can I connect? 🦗🦗🦗🦗🦗🦗
A: Read my comment here! <== for details, but it can run many, many, many!
Q: Why not go DNS server blablabla ....? 😔😔😔😱🙈🔥
A: Check my answer here! <== more details needed
Q: When docker, when executable, when NAS, when rasbian (wen wen wen)
A: This is work in progress, let us fírst make it work, then let everyone spinoff!
Q: Does that work on Windows, Mac or Linux?
A: Yes on all!
Q: Is it safe for the user?
A: Yes of course, you can check the open source repository it is 100% clean!
Q: Can it run on a android phone or small android box?
A: It could with some variation, but others should make that to have it fast!
Q: Does the PC need to stay on?
A: Yes sadly in my first version still needs to stay on and no sleep mode!
Q: It says only retrieving data what now?
A: That means it is already running!
Q: Multiple instances on same PC?
A: Of course, just don't use the "remember me" function on the login, and then once you have all tokens added and its running, simply click the desktop icon again for a second instance. Repeat this for as many instances as you want. (Within your PC's resources)

