Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aschuma/air-sensor

air-sensor node module - looks up particulate-matter sensors of the luftdaten network (https://sensor.community/)
https://github.com/aschuma/air-sensor

air-quality airrohr feinstaub feinstaubalarm feinstaubsensor luftdaten particulate-matter pm10 sensor-data

Last synced: 5 days ago
JSON representation

air-sensor node module - looks up particulate-matter sensors of the luftdaten network (https://sensor.community/)

Awesome Lists containing this project

README

        

# air-sensor

[![version](https://img.shields.io/npm/v/air-sensor.svg?style=flat-square)](http://npm.im/air-sensor)
[![downloads](https://img.shields.io/npm/dm/air-sensor.svg?style=flat-square)](http://npm-stat.com/charts.html?package=air-sensor&from=2018-01-04)
[![MIT License](https://img.shields.io/npm/l/air-sensor.svg?style=flat-square)](http://opensource.org/licenses/MIT)

Looks up a single particulate-matter sensors of the [luftdaten network](http://luftdaten.info/en/home-en).
You may zoom in the [map](http://maps.luftdaten.info/#2/0.0/0.0) to obtain the id of a sensor next to you.

```
var sensor = require("air-sensor");

var sensorId = 9322;
sensor.lookup( sensorId ).then(
data => console.log( data )
);
```

In case the sensor is a PM sensor the subsequent structure is returned:
```
{
id: 9322,
type: 'PM'
location: {
longitude: 9.228,
latitude: 48.804
},
PM10: 6.4,
PM2_5: 5.9,
timestamp: '2018-02-04 14:38:08'
}
```

In case the sensor is a temperature (celsius) sensor the subsequent structure is returned:
```
{
id: 9322,
type: 'temperature',
location: {
longitude: 9.228,
latitude: 48.804
},
temperature: 1.9,
humidity: 85.7,
timestamp: '2018-02-04 14:38:08'
}
```

There is also a method returning a 24h average value. The output format remains the same as above.

```
var sensor = require("air-sensor");

var sensorId = 9322;
sensor.lookup24hAvg( sensorId ).then(
data => console.log( data )
);
```

In addition its also possible to fetch all current sensor data of an area. This will return an array of objects having the same structure as above.

```
var sensor = require("air-sensor");

var latitude = 49.1355;
var longitude = 9.228;
var distance = 1.1;

sensor.lookupArea(latitude,longitude,distance).then(
data => console.log( data )
);

```