Giter VIP home page Giter VIP logo

air-sensor's Introduction

air-sensor

version downloads MIT License

Looks up a single particulate-matter sensors of the luftdaten network. You may zoom in the map 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 ) 
);


air-sensor's People

Contributors

aschuma avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.