-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push to online account #12
Comments
It's maybe not the goal you want to reach but you can send the data to any smart-home-system of your choice. My wave arrived yesterday. This is what I made so far: The Raspberry Pi which controls my 3D-printer runs the script with cron every half hour and gets the bluetooth-data from the device.
Update: I send the data now direct out of the python-script without pipe it to cURL. --> https://github.com/Einstein2150/wave-reader In Node Red I can log the data or visualize it in a dashboard. |
I am also interested to this feature. Apparently their API does not support POST new data, but you can only read them. https://developer.airthings.com/consumer-api-docs/ Did anyone found a way around this? I really would like to keep my device sync all the time! Maybe someone from Airthings could comment on it? |
I did the following:
All this wouldn't be necessary if there was a desktop app but it seems that they want you to purchase an Airthings Hub to accomplish this simple task of regularly syncing with the cloud account. |
intercepting the traffic between the app and the server would be good 😁 |
So here is the traffic step by step: First it refreshes the token from The server responses with a confirmation: This happens 2 times... Now the app requests from
Look at the Now it checks the data before starting an upload of the new values since the latest sample in the cloud.
The app gets the latest cloud data:
Now it posts the new samples to
|
@Einstein2150 Thanks.. That is very useful. What setup did u use for intercepting the traffic? |
mitmproxy running in docker |
@LordEvron I wrote the first part for refreshing the token and getting the freshest cloud data. Seems like every old known token can call for a new one: edit: removed and moved into https://github.com/Einstein2150/airthings-api-uploader |
"Seems like every old known token can call for a new one" --> lol ..ok ... |
@LordEvron here is the latest result. It is nearly working but something is preventing it from an update. I get no error but there gets nothing updated. Maybe the reason is that the I have the Wave v2 - no hub and no plus 👍 here ist the latest working code: edit: removed and moved into https://github.com/Einstein2150/airthings-api-uploader |
Damn. Bricked my cloud connection. Seems that playing with the post parameters got the data async. App synced but no more data gets saved in the cloud. Unpairing and repairing fixed it but all cloud data is gone 🙃 Beware of that when playing with my code 🤓 |
@LordEvron a hint for your first try: close the app for a night and start the mitm-proxy before opening the app. After a long period the app first calls for a fresh token. The token which requests in the |
I build a new repository for the API-stuff. Feel free to contribute: |
i have extracted the x-api-key .. but I noticed the app first get all the old datapoints from the cloud, then it push the new one, with subsequent unique ids, which are offsets from a specific date. So, I guess if you do not push data properly, you end up fu*king up your dataseries/cloud as you probably already did :D . I will need some more days/time to make sure i understand the logic behind the ids. |
So, for Wave version 1 the Post payload is different .. It post this data every hour and the IDs are subsequential ... { I hope this helps... |
Would it be possible to use this script to push to the online account instead of needing to use the phone app?
The text was updated successfully, but these errors were encountered: