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

@iainfarq/homebridge-mcp9808

v1.1.5

Published

A homebridge plugin for the Microchip MCP9808 temperature sensor on RaspberryPi

Downloads

5

Readme

@iainfarq/homebridge-mcp9808

Homebridge plugin for the Microchip MCP9808 sensor on RasPi, based on mcp9808-temperature-sensor

NPM Downloads

Note that this plugin only provides the temperature reading facility of the MCP9808. Alarms based on temperature are not currently possible in HomeKit, so are not provided.

Installation

npm install homebridge-mcp9808

Connecting the sensor

This is better covered by mcp9808-temperature-sensor and the i2c-bus package, but ultimately involves adding the sensor to the i2c bus on the board that you are using. The standard i2C address for the MCP9808 is 0x18, and this can be checked on the Raspberry Pi by running the command

> i2cdetect -y 1

which will display something similar to

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- 76 --                         

This indicates that there is a device present at 0x18 - our MCP9808 - and another device at 0x76, which we are not interested in.

Configuration

Enabled by adding an entry ino the 'accessories' section of the config.json file. The named sections have the following behaviors:

  • accessory - must be "MCP9808" to identify the plugin
  • name - initial name in Homekit of the sensor. May be changed here, or in the Home app.
  • refresh - specifies the refresh time in seconds. The sensor is polled using this interval, and Homekit is provided with the last value read. If omitted, the default value of 60 seconds is used.
  • options - supplied directly to mcp9808-temperature-sensor, and is specified in that package. Common values are: i2cBusNumber, which is '1' for Raspberry Pi, and i2cAddress, which is '0x18' for the base address of the MCP9808.

Example Configuration

config.json

    {
         "bridge": {
         "name": "Homebridge",
         "username": "CC:46:3D:E3:CE:30",
         "port": 51826,
         "pin": "031-45-154"
     },
     "description": "Config file for raspberry pi running MCP9808 temperature sensor",
 
     "accessories": [
         {
             "accessory": "MCP9808",
             "name": "Temperature",
             "refresh": 60,
             "options": {
               "i2cBusNumber": 1,
               "i2cAddress": "0x18"
             }
         }
     ],
 
     "platforms": [
     ]
    }

MCP9808 datasheet