Mac - Homebridge

Quelle: https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-macOS

Weil die Updates von Apple Xcode genervt haben,
bin ich auf Raspberry Pi umgestiegen.

  • Xcode installieren
  • falls Xcode noch nicht installiert war, einmal starten
  • homebrew installieren
# /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • node installieren
# brew install node
  • homebridge installieren
# npm -g install homebridge --unsafe-perm

~/.homebridge/config.json

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "xxx-xx-xxx"
    },

    "description": "config vom 29.01.2017", 

    "platforms": [
       {
           "platform": "HomeMatic",
           "name": "HomeMatic CCU",
           "ccu_ip": "x.x.x.x",
           "variables":["Alarmanlage","Tortaster"],
           "filter_device":[],
           "filter_channel":[],
           "outlets":["BidCos-RF.KE....."],
           "doors":[],
           "programs":["Tormotor","TorMac"],
           "ios10":true,
           "subsection":"Homekit"
       }   
   ]
}

testen, ob alles läuft

# homebridge
┌─────────────────────────────────────────────────────────┐
│                 npm update check failed                 │
│           Try running with sudo or get access           │
│          to the local update config store via           │
│ sudo chown -R $USER:$(id -gn $USER) ~/.config │
└─────────────────────────────────────────────────────────┘
[2018-5-29 21:02:22] Loaded plugin: homebridge-homematic
[2018-5-29 21:02:22] Registering platform 'homebridge-homematic.HomeMatic'
[2018-5-29 21:02:22] ---
[2018-5-29 21:02:22] Loaded config.json with 0 accessories and 1 platforms.
[2018-5-29 21:02:22] ---
[2018-5-29 21:02:22] Loading 1 platforms...
[2018-5-29 21:02:22] [HomeMatic CCU] Initializing HomeMatic platform...
[2018-5-29 21:02:22] [HomeMatic CCU] Homematic Plugin Version 0.0.96
[2018-5-29 21:02:22] [HomeMatic CCU] Plugin by thkl  https://github.com/thkl
[2018-5-29 21:02:22] [HomeMatic CCU] Homematic is a registered trademark of the EQ-3 AG
[2018-5-29 21:02:22] [HomeMatic CCU] Please report any issues to https://github.com/thkl/homebridge-homematic/issues
[2018-5-29 21:02:22] [HomeMatic CCU] will connect to your ccu at x.x.x.x
[2018-5-29 21:02:22] [HomeMatic CCU] using binrpc for communication with BidCos-RF
[2018-5-29 21:02:22] [HomeMatic CCU] init RPC for BidCos-RF.
[2018-5-29 21:02:22] [HomeMatic CCU] local ip used : x.x.x.x. you may change that with local_ip parameter in config
[2018-5-29 21:02:22] [HomeMatic CCU] Fetching Homematic devices...
[2018-5-29 21:02:22] [HomeMatic CCU] RPC server for interface BidCos-RF. is listening on port 9090.
[2018-5-29 21:02:22] [HomeMatic CCU] Creating Local HTTP Client for CCU RPC Events
[2018-5-29 21:02:22] [HomeMatic CCU] if PONG is PONG CCU is alive
[2018-5-29 21:02:23] [HomeMatic CCU] NPM 0.0.109 vs Local 0.0.96
[2018-5-29 21:02:24] [HomeMatic CCU] Fetch Response
[2018-5-29 21:02:24] [HomeMatic CCU] There is no service for HM-ES-PMSw1-Pl:CONDITION_POWER
[2018-5-29 21:02:24] [HomeMatic CCU] There is no service for HM-ES-PMSw1-Pl:CONDITION_CURRENT
[2018-5-29 21:02:24] [HomeMatic CCU] There is no service for HM-ES-PMSw1-Pl:CONDITION_VOLTAGE
[2018-5-29 21:02:24] [HomeMatic CCU] There is no service for HM-ES-PMSw1-Pl:CONDITION_FREQUENCY
[2018-5-29 21:02:24] [HomeMatic CCU] Program Tormotor added as SWITCH cause of IOS 10
[2018-5-29 21:02:24] [HomeMatic CCU] Program TorMac added as SWITCH cause of IOS 10
[2018-5-29 21:02:24] [HomeMatic CCU] Initializing platform accessory 'Aussen Temp'...
[2018-5-29 21:02:24] [HomeMatic CCU] Initializing platform accessory 'Garage Temp'...
.
.
.
[2018-5-29 21:02:24] [HomeMatic CCU] Initializing platform accessory 'Alarmanlage'...
[2018-5-29 21:02:24] [HomeMatic CCU] Initializing platform accessory 'Tortaster'...
Setup Payload:
X-HM://xxxxxxxxxxx
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:

Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ xxx-xx-xxx │     
    └────────────┘     

[2018-5-29 21:02:24] [HomeMatic CCU] Number of mapped devices : 28
[2018-5-29 21:02:24] Homebridge is running on port 51826.
[2018-5-29 21:02:24] [HomeMatic CCU] will cache ccu response ...
^C[2018-5-29 21:02:46] Got SIGINT, shutting down Homebridge...

~/Library/LaunchAgents/com.homebridge.server.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>com.homebridge.server</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/homebridge</string>
        <string>-I</string>
    </array>
    <key>EnvironmentVariables</key>
    <dict>
            <key>PATH</key>
            <string>/usr/local/bin/:$PATH</string>
    </dict>
</dict>
</plist>

homebridge starten

# launchctl load ~/Library/LaunchAgents/com.homebridge.server.plist

updates

# sudo npm -g outdated
Password:
Package               Current  Wanted   Latest  Location
homebridge             0.4.38  0.4.42   0.4.42
homebridge-homematic   0.0.96  0.0.96  0.0.109
npm                     5.8.0  5.10.0    6.1.0

sudo npm -g update npm
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
+ npm@5.10.0
added 64 packages from 35 contributors, removed 24 packages and updated 55 packages in 10.895s

   ╭─────────────────────────────────────╮
   │                                     │
   │   Update available 5.8.0 → 6.1.0    │
   │     Run npm i -g npm to update      │
   │                                     │
   ╰─────────────────────────────────────╯