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-dht-mqttpub

v0.0.1

Published

Homebridge accessory plugin that reads Temperature/Humidity values from DHT Sensors connected to a Raspberry PI.

Downloads

5

Readme

homebridge-dht-mqttpub

Integrate DHT sensor into homebridge and publish sensor data via mqtt

Installation

tbd

Configuration - with RPI cpu temperature sensor, requires cputemp program ( Optional )

{
  "bridge": {
    "name": "MyHomebridge",
    "username": "CC:22:3D:E3:CD:33",
    "port": 51826,
    "pin": "031-45-154"
  },
  "description": "HomeBridge DHT22",

  "platforms": [
  ],
  "accessories": [
    {
      "accessory": "Dht",
      "name": "CPU Temperature",
      "service": "Temperature",
      "refresh": "15"
    }, {
      "accessory": "Dht",
      "name": "dht22",
      "name_temperature": "Temperature",
      "name_humidity": "Humidity",
      "service": "dht22",
      "gpio": "4",
      "refresh": "15"
    }
  ]
}

Configuration - without cputemp

{
  "bridge": {
    "name": "MyHomebridge",
    "username": "CC:22:3D:E3:CD:33",
    "port": 51826,
    "pin": "031-45-154"
  },
  "description": "HomeBridge DHT22",

  "platforms": [
  ],
  "accessories": [
    {
      "accessory": "Dht",
      "name": "dht22",
      "name_temperature": "Temperature",
      "name_humidity": "Humidity",
      "service": "dht22",
      "gpio": "4",
      "refresh": "15"
    }
  ]
}

or with multiple DHT22's

{
  "accessory":          "Dht",
  "name":               "dht22 - indoor",
  "name_temperature":   "Indoor Temperature",
  "name_humidity":      "Indoor Humdity",
  "gpio":               "4",
  "service":            "dht22",
  "refresh":            "60"
},
{
  "accessory":          "Dht",
  "name":               "dht22 - outdoor",
  "name_temperature":   "Outdoor Temperature",
  "name_humidity":      "Outdoor Humdity",
  "gpio":               "2",
  "service":            "dht22",
  "refresh":            "30"
}

Configuration Options

Optional parameters includes

| Config Item | Description | | --- | --- | | dhtExec | Full command including path to read dht22 sensor. Not needed unless dht22 is installed in a location not on the path. Defaults to dht22 ie "dhtExec": "/usr/local/bin/dht22" | | cputemp | Full command including path to read cpu temp sensor. Not needed unless cputemp is installed in a location not on the path. Defaults to cputemp ie "cputemp": "/usr/local/bin/cputemp" | | gpio | Gpio pin to read for dht22 sensor. Defaults to 4 ie "gpio": "4" | | Refresh | Frequency of data refresh. Defaults to 1 minute | | name | descriptive name | | name_temperature (optional)| descriptive name for the temperature sensor | | name_humidity (optional)| descriptive name for the humidity sensor |

Optional cputemp script - install in /usr/local/bin

#!/bin/bash
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))

echo $cpuTemp1" C"
#echo GPU $(/opt/vc/bin/vcgencmd measure_temp)

ToDo

  • tbd

Credits

  • name here