matthewwall / weewx-sds011

weeWX driver for the SDS011 particulate sensor
GNU General Public License v3.0
3 stars 4 forks source link

Adding API calls for sds011 #4

Open GeyerA opened 3 years ago

GeyerA commented 3 years ago

Hi, I do run WEEWX but the SDS011 is connected by WIFI. Is it also possible to implement calls via API (IP address directly) or via Opensensemap (https://api.opensensemap.org/boxes/5f53f10837e925001b615978/sensors) or Luftdaten (http://data.sensor.community/airrohr/v1/sensor/50825/) Thanks

misko903 commented 3 years ago

Yes, this is what i am looking for ages too!!!

GeyerA commented 3 years ago

BTW, we could also use the IP/data.json (of the sensor in our local network) which returns something like below. No need to go through the APIs; I tried to use the purpleair code but not experienced enough.... {"software_version": "NRZ-2020-131", "age":"26", "sensordatavalues":[{"value_type":"SDS_P1","value":"5.75"},{"value_type":"SDS_P2","value":"1.58"},{"value_type":"temperature","value":"10.20"},{"value_type":"humidity","value":"90.60"},{"value_type":"samples","value":"3531902"},{"value_type":"min_micro","value":"33"},{"value_type":"max_micro","value":"20116"},{"value_type":"interval","value":"145000"},{"value_type":"signal","value":"-78"}]}

misko903 commented 3 years ago

Yes, but how to use it... I made this thread: https://groups.google.com/g/weewx-user/c/UJhz34G5r8s but I dont know really how to make all the steps.

misko903 commented 3 years ago

GeyerA - how did you get the values? I am not able to send the data from the sensor through Custom API to my RPi with WeeWX. How did you made it?

GeyerA commented 3 years ago

Hi, i got it using the IPoftheSDS011/data.json (in my case http://192.168.178.49/data.json). If you click the links in my first posts then it will be the data from opensensemap and luftdaten.info... I tried based on the code of purpleair and your link above but no success. I will return to work on this when I got time but not too experienced with python.

misko903 commented 3 years ago

Hi, I am mailing with a bit more smarter guy than me, he can postprocess the data saved from sensor to RPi. Are you able to save the data to WeeWX RPi? I was trying, but no luck...

Michal

GeyerA commented 3 years ago

Hi, sorry, took me some time. I am also discussing with somebody and now managed to get the data into a feinstaub.log file using "send to own API" triggered by a .php script. I think we should stop discussing here and take it the thread you posted above.