Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Overview

Homebridge is a lightweight NodeJS server you can run on your home network that emulates the iOS HomeKit API (Docker Image). It supports Plugins, which are community-contributed modules that provide a basic bridge from HomeKit to various 3rd-party APIs provided by manufacturers of "smart home" devices.


Build Custom Homebridge Image

...

  • Homebridge running on port 51826
  • Homebridge UI listening on port 8089
  • homebridge-http-webhooks listening on port 51828


Plugins

We can see what plugins are available for homebridge from the following url:

https://www.npmjs.com/search?q=homebridge-plugin

SonoffTasmotaHTTP Plugin


Code Block
titleconfig.json
{
                "accessory": "SonoffTasmotaHTTP",
                "name": "sonoff97-1",
                "hostname": "192.168.1.97",
                "relay": "1",
                "user": "xxx",
                "password": "xxx"
},
{
 
                "accessory": "SonoffTasmotaHTTP",
                "name": "sonoff98",
                "hostname": "192.168.1.98",
                "user": "xxx",
                "password": "xxx"
},
...


Sonoff-Tasmota Mqtt Plugin


Code Block
titleconfig.json
...
{
                "accessory": "mqtt-switch-tasmota",
                "name": "sonoff97-2-relay",
                "url": "mqtt://192.168.1.60",
                "username": "john",
                "password": "pass",
                "topics": {
                        "statusGet": "stat/sonoff97-2/POWER",
                        "statusSet": "cmnd/sonoff97-2/POWER"
                }
},
...


Cmd4 Plugin


Code Block
languagebash
titlesonoff158.sh
#TEMP on SONOFF 158
SOURCE_URL="http://192.168.1.158/cm?user=admin&password=lifeisgreat&cmnd=status%2010"
 
if [ "$1" = "Get" ]; then
   # $2 would be the name 'sonoff158'
   # $3 would be the charactersistic
 
   if [ "$3" = "CurrentTemperature" ]; then
        temp=`curl -L $SOURCE_URL |sed -rn 's/.*"Temperature":([0-9]*.[0-9]*).*/\1/p'`
        echo $temp
      exit 0
   fi
 
   if [ "$3" = "StatusActive" ]; then
      echo "1"
      exit 0
   fi
fi
 
if [ "$1" = "Set" ]; then
  exit 1
fi
exit 0


References