Apple Homekit: die Hoffnung stirbt zuletzt

Begonnen von eldrik, 23 Januar 2015, 13:57:07

Vorheriges Thema - Nächstes Thema

flurin

Zur Erinnerung:

Zitat von: flurin am 09 November 2015, 11:28:13
Hallo,
Die aktuellste Anleitung findet man hier:

https://github.com/nfarina/homebridge

Alles andere ist meisten nach kurzer Zeit unbrauchbar.

Eigentlich hat @nfarina mit dem Plugin-System die Installation wesentlich vereinfacht. Man muss sich nur daran halten.  ;)

sTaN

Der Ordner homebridge wird normal angelegt. Wollte nur ausschließen, dass du nicht wie ich im Git Clone homebridge Verzeichnis bist, wie ich es war. ich würde, wenn du über Git Clone installierst, diesen mal nicht im Verzeichnis /home/pi herunterladen sondern zum Beispiel in /home/pi/Downloads
Dann muss der .homebridge in /home/pi/homebridge existieren also nicht wie bei dir aktuell im /home/pi Verzeichnis. Wenn er nach der Installation nicht angelegt wurde, mal manuell versuchen.
Raspberry Pi 3
2 x CUL CC1101-USB-Lite 868MHz
FS20 Komponenten, Philips HUE, Alexa-Fhem, MAX! Geräte, homebridge, harmony, Unifi, FirtzBox, MQTT, Aurora, Denon, Sonos, TabletUI, CALENDAR, EGPM2LAN, Pushover

CarstenF

Raspberry Pi4
CUL 868, CUL 433, LaCrosse Gateway, Zigbeetomqtt2, HUE, Homematic
Max-Cube umgeflasht
MAX!, FhemtoFhem, Homebridge, FhemConnector, IR_Gateway und sonst auch noch allerlei Spielzeug....

dennis_n

Hi,

ich bekomme beim starten folgenden Fehler:
pi@raspberrypi ~ $ /home/pi/homebridge/bin/homebridge
module.js:339
    throw err;
    ^

Error: Cannot find module 'commander'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/home/pi/homebridge/lib/cli.js:1:77)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)


Gruss
Dennis


sTaN

@flurin
Ja das habe ich gesehen. Bis auf die package.json, welche jetzt minimalistischer ist, habe ich es damit aber zum Fliegen gebracht  :o
Weil mit der offiziellen Anleitung unter https://github.com/nfarina/homebridge habe ich wie CarstenF die Fehler bekommen.

Letztelendes weicht die Anleitung ja nur insofern ab, dass man den git clone nicht mehr erstellen muss, sondern direkt mit npm install -g homebridge installieren kann, oder? Die Vorbereitungen inkl. gcc 4.8 sind ja trotzdem noch notwendig?

Gruß
Raspberry Pi 3
2 x CUL CC1101-USB-Lite 868MHz
FS20 Komponenten, Philips HUE, Alexa-Fhem, MAX! Geräte, homebridge, harmony, Unifi, FirtzBox, MQTT, Aurora, Denon, Sonos, TabletUI, CALENDAR, EGPM2LAN, Pushover

flurin

Ich weiss, man kann noch einiges brauchen, aber für Erstanwender kann es verwirrend sein. Ich komme aber zurzeit nicht dazu, die Anleitung anzupassen und die Installation zu testen.

ChiliApple

hallo,

also 1. funktioniert bei mir ...

[code]npm install -g homebridge

2. nicht

npm install -g https://github.com/justme-1968/homebridge-fhem.git

da bekomme ich diese Meldung

# npm install -g https://github.com/justme-1968/homebridge-fhem.git
npm http GET https://github.com/justme-1968/homebridge-fhem.git
npm http 200 https://github.com/justme-1968/homebridge-fhem.git
npm ERR! not a package /root/tmp/npm-32025-HS8pfC8k/1447268195015-0.7517259900923818/tmp.tgz
npm ERR! Error: ENOENT, open '/root/.npm/tmp_4c3b02604594tmp_e0ce3643f420package/package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 3.4.104-bananian
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "https://github.com/justme-1968/homebridge-fhem.git"
npm ERR! cwd /root
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /root/.npm/tmp_4c3b02604594tmp_e0ce3643f420package/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /root/npm-debug.log
npm ERR! not ok code 0
npm install -g https://github.com/justme-1968/homebridge-fhem.git  4,49s user 0,51s system 67% cpu 7,369 total


interessant ist auch, das ich es lt. der geposteten Anleitung aus diesem Blog hinbekommen habe, jedoch sobald ich das Terminal schließe, ist auch die Verbindung mit EVE weg ...
:: FHEM last Version
:: Raspberry 3 mit Stretch
:: HWLAN
:: MAX
:: 3xSCC  Fw by björnh :: PiFace Digital 1

justme1968

#1493
nimm malnpm install -g git+https://github.com/justme-1968/homebridge-fhem.gitdas ist glaube ich die offizielle syntax.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

sTaN

#1494
Mir lässt das bei CarstenF jetzt auch keine Ruhe und ich habe jetzt auch noch mal homebridge komplett deinstalliert und anschließend neu installiert. Aktuell kann ich ja eh nur meine Stehlampe schalten. Bei TV Lampe sucht Siri immer nach Hotels.  ;D

Voraussetzungen!
GCC 4.8
gcc --version
gcc (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Node.js 5.0.0
node -v
v5.0.0


1. homebridge deinstalliert, Git Clone Verzeichnis und .homebridge Verzeichnis gelöscht:
sudo npm uninstall -g homebridge
sudo npm uninstall -g homebridge-fhem
cd /home/pi/
sudo rm -r homebridge/
sudo rm -r .homebridge/


2. System auf den aktuellste Stand gebracht
sudo apt-get update && sup apt-get upgrade

3. homebridge wieder installiert
sudo npm install -g homebridge
An der Stelle bringt er mir zwar die root access Warnung auf das Verzeichnis /root/.node-gyp/5.0.0 aber die Installation lief durch:
/usr/local/bin/homebridge -> /usr/local/lib/node_modules/homebridge/bin/homebridge

> bignum@0.11.0 install /usr/local/lib/node_modules/homebridge/node_modules/bignum
> node-gyp configure build

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/5.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/homebridge/node_modules/bignum/.node-gyp"
make: Entering directory '/usr/local/lib/node_modules/homebridge/node_modules/bignum/build'
  CXX(target) Release/obj.target/bignum/bignum.o
  SOLINK_MODULE(target) Release/obj.target/bignum.node
  COPY Release/bignum.node
make: Leaving directory '/usr/local/lib/node_modules/homebridge/node_modules/bignum/build'

> curve25519@1.1.0 install /usr/local/lib/node_modules/homebridge/node_modules/curve25519
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/5.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/homebridge/node_modules/curve25519/.node-gyp"
...
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/5.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/homebridge/node_modules/bignum/.node-gyp"
make: Entering directory '/usr/local/lib/node_modules/homebridge/node_modules/bignum/build'
make: Nothing to be done for 'all'.
make: Leaving directory '/usr/local/lib/node_modules/homebridge/node_modules/bignum/build'
/usr/local/lib
└─┬ homebridge@0.2.11
  ├─┬ chalk@1.1.1
  │ ├── ansi-styles@2.1.0
  │ ├── escape-string-regexp@1.0.3
  │ ├─┬ has-ansi@2.0.0
  │ │ └── ansi-regex@2.0.0
  │ ├── strip-ansi@3.0.0
  │ └── supports-color@2.0.0
  ├─┬ commander@2.8.1
  │ └── graceful-readlink@1.0.1
  ├─┬ hap-nodejs@0.0.3
  │ ├─┬ curve25519@1.1.0  (git://github.com/KhaosT/node-curve25519.git#922eae612bb379fa84e8deb29f80c53d57c8be7b)
  │ │ ├── bindings@1.2.1
  │ │ └── nan@2.1.0
  │ ├─┬ debug@2.2.0
  │ │ └── ms@0.7.1
  │ ├── ed25519@0.0.3  (git://github.com/KhaosT/ed25519.git#6356bc9e6e4643d56020293c14920ac12bcaa1ac)
  │ ├─┬ mdns@2.2.10
  │ │ └── nan@2.0.9
  │ ├─┬ node-persist@0.0.3
  │ │ ├── mkdirp@0.3.5
  │ │ └── q@1.1.2
  │ └─┬ srp@0.2.0  (git://github.com/KhaosT/node-srp.git#7feff53254897a0b1b9f0667ad17a8beb78acbb9)
  │   └── bignum@0.11.0
  └── semver@5.0.3


4. Nach Installation habe ich meine Verzeichnisstruktur in /home/pi geprüft und festgestellt, das noch KEIN .homebridge Verzeichnis existiert
ls -al
total 10124
drwxr-xr-x  9 pi   pi       4096 Nov 11 19:27 .
drwxr-xr-x  3 root root     4096 May  7  2015 ..
drwxr-xr-x  2 root root     4096 Nov 11 19:25 backups
-rw-------  1 pi   pi      11549 Nov 11 19:21 .bash_history
-rw-r--r--  1 pi   pi        220 May  7  2015 .bash_logout
-rw-r--r--  1 pi   pi       3243 May  7  2015 .bashrc
drwxr-xr-x  2 root root     4096 Nov 11 19:27 downloads
-rw-r--r--  1 root root 10305196 Nov  9  2014 fhem-5.6.deb
drwxr-xr-x  3 pi   pi       4096 Nov  9 21:52 .node-gyp
drwxr-xr-x  2 root root     4096 Nov  9 21:15 node_modules
drwxr-xr-x  6 pi   pi       4096 Oct 29 18:23 node-v5.0.0-linux-armv6l
drwxr-xr-x 74 pi   pi       4096 Nov  9 22:21 .npm
-rw-r--r--  1 pi   pi        675 May  7  2015 .profile
drwxrwxr-x  2 pi   pi       4096 Jan 27  2015 python_games


5. Homebridge gestartet (dieses mal nur mit dem Befehl homebridge)
homebridge
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
Loaded plugin: homebridge-fhem
Registering platform 'homebridge-fhem.FHEM'
---
Couldn't find a config.json file at '/home/pi/.homebridge/config.json'. Look at config-sample.json for examples of how to format your config.js and add your home accessories.


5. Dann habe ich mir das Verzeichnis /home/pi anzeigen lassen und siehe da, der .homebridge Ordner wurde angelegt!
pi@raspberrypi ~ $ cd /home/pi/.
./           ../          .homebridge/ .node-gyp/   .npm/ 


6. Nun meine zuvor gesicherte config.json aus Beitrag #1432 in das Verzeichnis /home/pi/.homebridge kopiert und Homebridge gestartet
pi@raspberrypi ~/.homebridge $ homebridge
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
Loaded plugin: homebridge-fhem
Registering platform 'homebridge-fhem.FHEM'
---
Loaded config.json with 0 accessories and 1 platforms.
---
Loading 1 platforms...
[FHEM] Initializing FHEM platform...
starting longpoll: http://127.0.0.1:8083/fhem.pl?XHR=1&inform=type=status;filter=.*;since=null;fmt=JSON&timestamp=1447268815133
[FHEM] Fetching FHEM switchable devices...
[FHEM] fetching: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20room=Homekit&XHR=1
Loading 0 accessories...
Server listening on: http://<ip>:8082
[FHEM] got: 3 results
[FHEM] ignoring structure LED_Leisten
[FHEM] Stehlampe is switchable
[FHEM] Stehlampe has onOff [state;on,off]
[FHEM]   caching: Stehlampe-state: 1 as number (from on)
[FHEM] TVBacklight is switchable
[FHEM] TVBacklight has onOff [state;on,off]
[FHEM]   caching: TVBacklight-state: 1 as number (from on)
[FHEM] Initializing platform accessory 'Stehlampe'...
[FHEM] creating services for Stehlampe
[FHEM]   information service for Stehlampe
[FHEM]   switch service for Stehlampe
[FHEM]     on characteristic for Stehlampe
[FHEM] Initializing platform accessory 'TVBacklight'...
[FHEM] creating services for TVBacklight
[FHEM]   information service for TVBacklight
[FHEM]   switch service for TVBacklight
[FHEM]     on characteristic for TVBacklight
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ 031-45-154 │     
    └────────────┘     
                       
Homebridge is running on port 51826.


Nun läuft es scheinbar sauberer als installierte globale Variante. Siri versteht allerdings immer noch nicht "Schalte die TV Lampe im Wohnzimmer an"  ;)

Vielleicht hilft das doch noch Jemandem.

Gruß
sTaN
Raspberry Pi 3
2 x CUL CC1101-USB-Lite 868MHz
FS20 Komponenten, Philips HUE, Alexa-Fhem, MAX! Geräte, homebridge, harmony, Unifi, FirtzBox, MQTT, Aurora, Denon, Sonos, TabletUI, CALENDAR, EGPM2LAN, Pushover

infeliz

#1495
Ich habe es installiert wie ab Seite 96 beschrieben. Nach ein paar anfänglichen Schwierigkeiten läuft es jetzt tadellos. Selbst das Autostartscript haben ich zum laufen bekommen. da ist ein kleiner Fehler drin. Die Variable cmd muss um ./ erweitert werden.

#!/bin/sh
### BEGIN INIT INFO
# Provides: homebridge
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

dir="/home/pi/homebridge/bin"
cmd="./homebridge"
user="pi"

name=`basename $0`
pid_file="/var/run/$name.pid"
stdout_log="/var/log/$name.log"
stderr_log="/var/log/$name.err"

get_pid() {
    cat "$pid_file"
}

is_running() {
    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
}

case "$1" in
    start)
    if is_running; then
        echo "Already started"
    else
        echo "Starting $name"
        cd "$dir"
        if [ -z "$user" ]; then
            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
        else
            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
        fi
        echo $! > "$pid_file"
        if ! is_running; then
            echo "Unable to start, see $stdout_log and $stderr_log"
            exit 1
        fi
    fi
    ;;
    stop)
    if is_running; then
        echo -n "Stopping $name.."
        kill `get_pid`
        for i in {1..10}
        do
            if ! is_running; then
                break
            fi

            echo -n "."
            sleep 1
        done
        echo

        if is_running; then
            echo "Not stopped; may still be shutting down or shutdown may have"
            exit 1
        else
            echo "Stopped"
            if [ -f "$pid_file" ]; then
                rm "$pid_file"
            fi
        fi
    else
        echo "Not running"
    fi
    ;;
    restart)
    $0 stop
    if is_running; then
        echo "Unable to stop, will not attempt to start"
        exit 1
    fi
    $0 start
    ;;
    status)
    if is_running; then
        echo "Running"
    else
        echo "Stopped"
        exit 1
    fi
    ;;
    *)
    echo "Usage: $0 {start|stop|restart|status}"
    exit 1
    ;;
esac

exit 0



FHEM, Homebridge auf RaspberryPi2(autom. Backup der fhem.cfg auf NAS), CC1101-USB-Lite 868MHz (CUL), 6x FS20 SU-3, 1x FS20 ST, 1x FS20 AS4-3, 3x FS20 RSU, 1x HM-CFG-LAN 1x HM-WDS-IT, 1x HMS-100-TF, 3x HM-ES-PMSw1-pl, 1x HMS-100-TF, SamsungTV

sTaN

#1496
Nach meiner letzte Installation funktioniert bei mir das Startskript exakt wie von l2r im Beitrag #1417 beschrieben, ohne Anpassung der Pfade.
Raspberry Pi 3
2 x CUL CC1101-USB-Lite 868MHz
FS20 Komponenten, Philips HUE, Alexa-Fhem, MAX! Geräte, homebridge, harmony, Unifi, FirtzBox, MQTT, Aurora, Denon, Sonos, TabletUI, CALENDAR, EGPM2LAN, Pushover

flurin

#1497
@sTaN: vermutlich wird .homebridge vom Programm erstellt, sollte aber eigentlich bei der Installation angelegt werden. Könntest Du bitte hier:

https://github.com/nfarina/homebridge/issues

ein "Issue" eröffnen.

dennis_n

Hey sTaN,

vielen Dank.
Dank einer Anleitung habe ich auf dem Pi jetzt endlich alles zum laufen bekommen.
Lediglich in der Eve App kann ich Homebridge nicht hinzufügen.
Nach Eingabe des Codes bekomme ich die Fehlermeldung, dass das Zubehör nicht hinzugefügt werden kann.

Was kann das sein?

Danke

Gruss
Dennis

sTaN

Geh mal beim iOS Gerät in Einstellungen --> Datenschutz --> HomeKit und sage HomeKit-Konfiguration zurücksetzen. Danach schließe die Eve App mal komplett (Doppelklick auf Home Button und Eve App nach oben wischen)
Dann starte Eve erneut. Dann musst du wieder einen Namen für dein Zuhause eingeben und anschließend sagen gerät zu XY Zuhause hinzufügen. Dann Geräte code manuell eingeben und das aus der Konsole eingeben.

Wenn das nicht hilft ändere in deiner config.json mal den Namen "Homebridge" in "Homebridge2" und gehe wie oben beschrieben erneut vor.

grüß
sTaN
Raspberry Pi 3
2 x CUL CC1101-USB-Lite 868MHz
FS20 Komponenten, Philips HUE, Alexa-Fhem, MAX! Geräte, homebridge, harmony, Unifi, FirtzBox, MQTT, Aurora, Denon, Sonos, TabletUI, CALENDAR, EGPM2LAN, Pushover