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-hue-power-sensor

v1.0.0

Published

Homebridge Plugin for adding a power sensor for Philips Hue light bulbs

Downloads

3

Readme

Philips Hue Power Sensor for Homebridge

Homebridge Hue Power Sensor is a Homebridge Plugin for Philips Hue light bulbs.

This plugin adds HomeKit support for detecting Hue light bulb power on status. To achive this the plugin creates a new binary state sensor for each bulb and these sensors can then be used to trigger HomeKit automation rules.

Installation

Installation is easy, just execute the following command on your Homebridge host machine.

npm install -g homebridge-hue-power-sensor

Configuration

Modify the config.json file of your Homebridge installation and add the following section:

"platforms": [
    {
        "platform": "HuePlatform",
        "name": "Hue"
    }
]

Automatic Discovery of Bridges

Homebridge Huejay will try to discover Bridges when no Bridges are specified in the configuration. Homebridge Huejay will ask for authentication after every restart of Homebridge if no credentials are listed in your config.json. When you press the link button of your Bridge, Homebridge Huejay will connect to your Bridge and log the credentials of the created user. It's recommended to store the credentials in your config.json file to let Homebridge Huejay use that credentials when Homebridge is restarted.

You don't have to store the IP of your Bridge in the configuration file. Homebridge Huejay will automatically try to find the Bridge based on the given ID.

[4-3-2017 16:05:33] [Hue] Found Hue Bridge with ID: 001011XXXX0XX0X0, IP: 192.168.1.2
[4-3-2017 16:05:33] [Hue] Link button not pressed. Press the link button on your Bridge to authenticate...
[4-3-2017 16:05:38] [Hue] New user created - Username: RlRpseUAXPsMlnLyHXfNPIMt-60MlX06QB5VwpP6
[4-3-2017 16:05:38] [Hue] Loading accessories...
[4-3-2017 16:05:38] [Hue] Loading sensors of Bridge with ID 001011XXXX0XX0X0...
"platforms": [
    {
        "platform": "HuePlatform",
        "name": "Hue",
        "clients": [
            {
                "id": "001011XXXX0XX0X0",
                "username": "RlRpseUAXPsMlnLyHXfNPIMt-60MlX06QB5VwpP6"
            }
        ]
    }
]

Power Sensors

By default the plugin creates a new sensor for each light attached to each of the linked bridges. The sensor will appear as a new Contact Sensor with the name [bulb name] Power Sensor. Contact Sensor is used as it is the simplest of the standard sensor types.

Each new sensor is 'open' when the associated light is both on and reachable (i.e. powered). The sensor is 'closed' if the light is either off or unreachable (i.e. powered down).

The sensor state is updated every second. However, the Hue bridge can take several seconds to update the reachable state for a connected accessory so there can be an annoying delay before changes are detected and correctly reflected.

Advanced Client configuration

You may also pass advanced options to the Huejay clients. Read the Huejay documentation for more information about the settings.

"platforms": [
    {
        "platform": "HuePlatform",
        "name": "Hue",
        "clients": [
            {
                "id": "001011XXXX0XX0X0",
                "ip": "192.168.1.2",
                "port": 80,
                "timeout": 15000,
                "username": "RlRpseUAXPsMlnLyHXfNPIMt-60MlX06QB5VwpP6"
            }
        ]
    }
]

Ignoring lights

If you want to disable HomeKit support for a specific light you can add the unique ID of the light to the ignoreAccessories option in the configuration. If you don't know what the unique ID is of a specific light, you can look for the 'Serial Number' of the light you want to disable. Homebridge Huejay registers the unique ID of an light as the 'Serial Number' to HomeKit. You can find the 'Serial Number' at the detail view of the light you want to disable. Most of the time it looks like a MAC address.

"platforms": [
    {
        "platform": "HuePlatform",
        "name": "Hue",
        "clients": [
            {
                "id": "001011XXXX0XX0X0",
                "username": "RlRpseUAXPsMlnLyHXfNPIMt-60MlX06QB5VwpP6"
            }
        ],
        "ignoreAccessories": [
            "XX:XX:XX:XX:XX:XX:XX:XX-01-0001"
        ]
    }
]

Issues

If you have any issues with the extension, please let me know via the GitHub issues section. Provide as much information as possible, including the system log, so I can try to reproduce the problem. Turn Homebridge debugging on before posting your system log. Make sure you don't post any private information like API keys or secret keys.

Contribution

Your help is more than welcome! If you own accessories that are not supported by Homebridge Huejay at this moment, feel free to create a pull request with the implementation for other accessories. Make sure to use the same code style as used for the existing code base. Thank you!

Acknowledgements

This plugin is based on and forked from Homebridge Huejay.

License & Copyright

This plugin is open-source software licensed under the GPLv3 license.