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-http-sensors

v1.0.6

Published

A short description about what your plugin does.

Downloads

16

Readme

Homebridge Platform Plugin For Sensors over HTTP

This repository contains a Homebridge plugin that enables you to integrate various sensors, such as temperature, humidity, CO2, CO, ambient light or air quality, that have an HTTP API into HomeKit. With this plugin, you can easily monitor and control your sensor data using your Apple Home app on your iOS devices.

The Homebridge platform is an open-source software package that runs on a variety of platforms, including macOS, Linux, and Windows. It emulates the HomeKit API and allows you to connect non-HomeKit devices to the Home app. This plugin extends the functionality of Homebridge by allowing you to integrate sensors with an HTTP API into your smart home ecosystem.

Install Development Dependencies

Before proceeding with the installation, make sure that you have Homebridge installed on your system. If you haven't installed it yet, you can follow the instructions provided in the Homebridge documentation.

Once you have Homebridge installed, you can install this plugin using the following command:

sudo npm install -g homebridge-http-sensors

The sudo command is required to install the plugin globally on your system. If you are running Homebridge using a non-root user, you may need to run the command without sudo.

After the installation is complete, you can add the plugin to your Homebridge configuration file. The configuration file is typically located at ~/.homebridge/config.json. If the file doesn't exist yet, create it with the following content:

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },
    "platforms": [
        {
            "platform": "HomebridgeHttpSensonrs",
            "sensors": {}
        }
    ]
}

In the platforms section of the configuration file, add the following object to register the plugin:

{
    "platform": "HomebridgeHttpSensonrs",
    "sensors": {}
}

You can now configure your sensors by adding them to the sensors object. See the Configuration section for more information on how to configure your sensors.

Restart Homebridge for the changes to take effect:

sudo systemctl restart homebridge

You can now add your sensors to the Home app on your iOS device. Open the Home app, tap the "+" icon to add a new accessory, and scan the HomeKit code displayed by Homebridge. Your sensors should now be available in the Home app.

Configuration

To configure the plugin, you need to add your sensors to the sensors object in the Homebridge configuration file. The sensors object should contain one or more sensor objects, each representing a single sensor. The following sensor types are supported:

  • TemperatureSensor
  • HumiditySensor
  • CO2Sensor
  • COSensor
  • AmbientLightSensor
  • AirQualitySensor

Each sensor object should have the following properties:

  • getUrl (required): the URL of the sensor's HTTP API.
  • name (required): the name of the sensor that will be displayed in the Home app.
  • pollingInterval (required): the polling interval in milliseconds. The default value is 10000 (10 seconds).
  • threshold (optional) (Only Valid for CO2 or CO): the threshold value for the sensor. If the sensor value is above this threshold, the sensor will be displayed as "CO2/CO Detected" in the Home app.

Here is an example configuration with sensors::

{
    "name": "Bedroom",
    "platform": "HomebridgeHttpSensonrs",
    "sensors": {
        "TemperatureSensor": {
            "getUrl": "http://192.168.1.179/temperature",
            "name": "Temperature",
            "pollingInterval": 10000
        },
        "HumiditySensor": {
            "getUrl": "http://192.168.1.179/humidity",
            "name": "Humidity",
            "pollingInterval": 10000
        },
        "CO2Sensor": {
            "getUrl": "http://192.168.1.179/eco2",
            "name": "CO2",
            "pollingInterval": 50000,
            "threshold": 1000
        },
        "COSensor": {
            "getUrl": "http://192.168.1.179/eco2",
            "name": "CO",
            "pollingInterval": 100000,
            "threshold": 1000
        },
        "AmbientLightSensor": {
            "getUrl": "http://192.168.1.179/ambientlight",
            "name": "AMbient Light",
            "pollingInterval": 70000
        },
        "AirQualitySensor": {
            "getUrl": "http://192.168.1.179/airquality",
            "name": "Air Quality",
            "pollingInterval": 100000
        }
    }
}

You can add or remove sensors as needed. Make sure to follow the structure of the example configuration file. Once you have updated the configuration file, restart Homebridge for the changes to take effect:

sudo systemctl restart homebridge

Note: The structure should be exactly same. You can update the getUrl, name, pollingInterval and threshold of the config.