npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-airly-v2-nubzor

v2.0.2

Published

Homebridge plugin presenting pollution data as well as basic weather forecast information.

Downloads

30

Readme

homebridge-airly-v2-nubzor

NPM Version

Workflow status

Homebridge plugin presenting information about air quality, temperature, humidity and pressure from Airly API.


By default measurement values are interpolated by averaging measurements from nearby sensors (up to 1,5km away from the given point). The returned value is a weighted average, with the weight inversely proportional to the distance from the sensor to the given point.

If you live outside of Poland or in case when the default approach to getting measurements won't work it's highly recommended to use nearest option to get measurements for an installation closest to a given location.

You can control the size of the area that will be scanned for the nearest installation by providing maxDistance (number, double, kilometers) in the config file.

However, if for some reason you want to get measurements from particular location you should provide locationId (number, integer) in the config file. You can obtain the locationId by going to the Airly Map. The easiest way to find the location's id is to select particular location, clicking on "Add widget to your site". At the bottom of the panel you can find "Generated code" section. You can find the location's id out there.

You shouldn't have nearest set to true and locationId at the same time as it may cause unexpected side effects.

Second (>= 2.00) version of the plugin works world-wide, please keep in mind that Airly coverage is slightly worse outside of Poland.

Instalation

  1. Install Homebridge using: (sudo) npm install -g --unsafe-perm homebridge.
  2. Install this plugin using: (sudo) npm install -g homebridge-airly-v2-nubzor.
  3. Get API Key from Airly. Login here https://developer.airly.eu/login and generate it.
  4. Decide on the how you want to get the data, following options are available
    • Default - Find out your coordinates (latitude and longitude). Based on that information Airly will show measurements from nearest sensor. You can use this page https://www.latlong.net/,
    • Nearest - First, follow the Default steps, then set nereast true and control maxDistance to get measurements from the closest device to your position,
    • From particular locationId - Find out the locationId, you can use the tips from the first section of README.
  5. Update your configuration file like the example below.

This plugin is returning data such as: AQI (Air Quality Index), PM2.5, PM10, temperature, humidity and pressure.

Please, be advised that pressure is a custom characteristic which means it won't be present neither in Homebridge nor Home app. It's available in the apps which supports custom characteristics like Eve or Controller.

Configuration

Example config.json

"accessories": [
    {
          "accessory": "Air",
          "name": "Airly Air Quality",
          "apikey": "YOUR_API_KEY",
          "latitude": "YOUR_LATITUDE",
          "longitude": "YOUR_LONGITUDE",
          "nearest": false,
          "maxDistance": 5,
          "locationId": 0,
          "characteristics": {
            "PM25": true,
            "PM10": true,
            "temperature": true,
            "humidity": true,
            "pressure": true
          }
    }
]

Config file

Fields:

  • accessory must be "Air" (required).
  • name Is the name of accessory (required).
  • apikey API key from Airly Developers (required).
  • latitude String with your latitude e.g. "52.229676". Required for the default and nearest approach to obtaining measurements.
  • longitude String with your longitude e.g. "21.012229". Required for the default and nearest approach to obtaining measurements.
  • nearest Default false. Boolean (true/false) to change the approach to obtain measurements.
  • maxDistance Default 5. Number (integer, value in kilometers). It controls the size of the area that will be scanned for installations. The closest one to your lat/lng will be choosen.
  • locationId Default 0. Providing any positive number will turn on obtaining measurements through the location's id.
  • characteristics an object that represents available characteristics (PM25, PM10, temperature. humidity and pressure). Use it to control which one you want to have present in the accessory. By default all are turned on.

You find this useful? Get me a coffee

Additional information

This project is based on Homebridge-airly-v2 made by andrzejf1994 it contains several improvements as the original project seems to be abandoned

Project is based on homebridge-airly and homebridge-weather and homebridge-arinow.

The difference between the base version is:

  1. A valid npm package with works with Airly API v2 - as it doesn't work on Andrzej's version (issue)
  2. Removed dependency on request library as it becomes deprecated - using built-in https module instead