Page 1 of 1

Luftdaten

Posted: Sun 29 Aug 2021 3:00 pm
by Pirate3000
Hi
I dont know if possible but it would be good if we could incorporate luftadten sensors into cumulus.
the reason is I have built some and now use them on my weather site , these are uploaded to luftdaten community and show up on the maps.
Great if we could get them into cumulus at some point.
thanks and keep up the good work all........

Re: Luftdaten

Posted: Thu 02 Sep 2021 9:22 am
by HansR
Luftdaten is now sensor.community.

I have made the same request somewhere here. Although the documentation of sensor.community is not very clear on howto, once you know your way it is not very difficult. My FakeAirlink software now does the trick (see the SensorCommunity.cs file) if you need to know how to do it.

Here is some unofficial documentation created by Bessarabov (you may have to register for the forum first).

Basically it is about:
  1. Determining the SensorId and register the sensor at sensor.community. CMX probably needs this ID as a parameter because determining it for every possible hardware would be beyond the scope of CMX.
  2. Sending the data through the API in an HTML POST of a json structure. You can send a lot of information to sensor.community but to only send T/H and the PM values (which would be the scope of CMX) you only need a very small part of the JSON.

Code: Select all

{ 
    "timestamp" : "ddMMYY HH:MM:SS",
    "sensordatavalues" : [
        { "value_type":"temperature",  "value": "  " },
        { "value_type":"humidity",        "value":"  "}
    ]
}

And similar for the PM values (using P1 (PM10) and P2 (PM2p5) as the value type names.
EDIT: Having written the above there is another thing CMX must do and that is create the headers for the API transfer:

Code: Select all

                    content.Headers.Add( "X-pin", "7" );
                    content.Headers.Add( "X-Sensor", $"{SensorID}" );
It is the X-pin which must also be given to CMX to make the transfer possible. That pin must be given by the user along with the sensorId (X-Sensor).

Re: Luftdaten

Posted: Fri 03 Sep 2021 2:33 pm
by zoomx
You can see code used by PWSdashboard that is able to get data from the sensor community server
https://pwsdashboard.com/

Re: Luftdaten

Posted: Fri 03 Sep 2021 2:51 pm
by HansR
@zoomx:
Am I missing a point here?
  1. Maybe I am missing something but I don't even see a pointer to sensor.community on that page and I am definitely not going to browse all that info just to search for some code; So could you give a true link to a doc where that code is to be seen?
  2. This thread is not about getting data from the sensor.community database through the API, but it is about posting the info of your own AQ sensor to that database.

Re: Luftdaten

Posted: Mon 06 Sep 2021 7:18 am
by Pirate3000
Hi all
that's correct Han R.
The sensor is already uploading data to the luftdaten website, no problem, its just about getting the info in CMX

Re: Luftdaten

Posted: Mon 06 Sep 2021 10:18 am
by zoomx
In PWSdashboard php code there is the link to download data and to elaborate it

You can download it from the main page.

You can find link in PWS_load_files.php (but it more easy to find)
Then data are showed by AQ_luftdaten_c_block.php

Reading here
https://github.com/toto/homebridge-airrohr
there is the download link from the cloud

Code: Select all

http://data.sensor.community/airrohr/v1/sensor/<YOUR_AIRQUALITY_SENSOR_ID>/
but you can download directly from the device

Code: Select all

http://feinstaubsensor-<YOUR_SENSOR_ID>.local/data.json
maybe you have to change feinstaubsensor-<YOUR_SENSOR_ID>.local with the LAN IP if mDNS doesn't work

Take care that the ID is not the ID shown in device main page but the one that you get in maps page
https://maps.sensor.community

Edit: this is a json got from my sensor

{"software_version": "NRZ-2020-133", "age":"65", "sensordatavalues":[{"value_type":"SDS_P1","value":"5.40"},{"value_type":"SDS_P2","value":"3.10"},{"value_type":"samples","value":"5042600"},{"value_type":"min_micro","value":"28"},{"value_type":"max_micro","value":"24481"},{"value_type":"interval","value":"145000"},{"value_type":"signal","value":"-51"}]}

Re: Luftdaten

Posted: Mon 06 Sep 2021 11:03 am
by Pirate3000
Wow..
Thanks for this I will check later tonight and see what i can sort out for this.
Many thanks for all your help..
:D

Re: Luftdaten

Posted: Mon 06 Sep 2021 1:12 pm
by zoomx
P1 is the PM10 and PS is the PM2.5 values