homebridge/homekit

Begonnen von justme1968, 01 Februar 2016, 16:16:37

Vorheriges Thema - Nächstes Thema

TiEr

Hallo alle zusammen, ich habe meinen PI heute frisch aufgesetzt und Fhem installiert. Dabei wollte ich auch Homekit nutzen und habe Homebridge installiert. Aber leider will Homebridge nicht starten :(

Wenn ich homebridge starte kommt immer:
*** 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>

/usr/local/lib/node_modules/homebridge-fhem/index.js:47
    for( var subscription of FHEM_subscriptions[inform_id] ) {
                          ^^
====================
ERROR LOADING PLUGIN homebridge-fhem:
SyntaxError: Unexpected identifier
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Plugin.load (/usr/local/lib/node_modules/homebridge/lib/plugin.js:65:22)
    at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:70:14)
    at Array.forEach (native)
    at Server._loadPlugins (/usr/local/lib/node_modules/homebridge/lib/server.js:66:22)
====================
No plugins found. See the README for information on installing plugins.
Loaded config.json with 0 accessories and 1 platforms.
---
Loading 1 platforms...
Error: The requested platform 'homebridge-fhem.FHEM' was not registered by any plugin.
    at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:94:13)
    at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:194:45)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:35:36)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:23:16)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)


homebridge und homebridge-fhem sind beide installiert.

Meine config sieht so aus:
{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },

    "platforms": [
        {
            "platform": "homebridge-fhem.FHEM",
            "name": "FHEM",
            "server": "127.0.0.1",
            "port": "8083",
            "auth": {"user": "FhemUser", "pass": "XXX"},
            "filter": "room=Homekit"
        }
     ],
    "accessories": []
}




Grüße Timo

l2r

hi probier mal in der config.json

anstatt "platform": "homebridge-fhem.FHEM"
nur "platform": "FHEM"
Wissen ist Macht.
Ich weiß nix.
Macht nix.

Pady11

Duofern Invertierung klappt wieder automatisch.

;)

Lling

Hab genau den gleichen Fehler wie TiEr

/usr/local/lib/node_modules/homebridge-fhem/index.js:47
    for( var subscription of FHEM_subscriptions[inform_id] ) {
                          ^^
====================
ERROR LOADING PLUGIN homebridge-fhem:
SyntaxError: Unexpected identifier
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Plugin.load (/usr/local/lib/node_modules/homebridge/lib/plugin.js:65:22)
    at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:70:14)
    at Array.forEach (native)
    at Server._loadPlugins (/usr/local/lib/node_modules/homebridge/lib/server.js:66:22)
====================
Loaded plugin: homebridge-lockitron
Registering accessory 'homebridge-lockitron.Lockitron'
---
Loaded config.json with 0 accessories and 1 platforms.
---
Loading 1 platforms...
Error: The requested platform 'homebridge-fhem.FHEM' was not registered by any plugin.
    at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:94:13)
    at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:194:45)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:35:36)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:23:16)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10

TiEr

Zitat von: l2r am 12 Februar 2016, 09:31:34
hi probier mal in der config.json

anstatt "platform": "homebridge-fhem.FHEM"
nur "platform": "FHEM"

Habe ich probiert, hat leider auch nicht funktioniert. Da kriege ich den gleichen Fehler.

Hat das vielleicht mit dem update zu tun, was vor ein paar tagen released wurde?

Grüße

Timo

justme1968

welche node und nvm version verwendet ihr?

nvm --version
node --version

wo kommt eigentlich die "platform": "homebridge-fhem.FHEM" zeile her ?

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

Lling

Bin am Wochenende nicht Zuhause . Kann ich erst Sonntag sagen.
Node ist auf jeden fall node-v0.10.28

TiEr

Zitat von: justme1968 am 12 Februar 2016, 17:18:25
welche node und nvm version verwendet ihr?

nvm --version
node --version

wo kommt eigentlich die "platform": "homebridge-fhem.FHEM" zeile her ?

gruss
  andre

Hallo Andre,

Meine node version ist: v.0.10.28

Bei nvm --version spuckt er folgendes aus: nvm: command not found
ist nvm eventuell noch nicht installliert? :O

Die "Platform"-Zeile kommt aus dem fhemwiki: http://www.fhemwiki.de/wiki/Homebridge_einrichten

Grüße
Timo

justme1968

ich tippe mal auf eine zu alte node version. ich habe es hier mit 0.12.7 und 4.3.0 getestet. mit beiden geht es.

das nvm von oben sollte npm heißen.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

Lling

alte Node Version glaub ich eher nicht. Ich hatte homebridge schon mit 10.26 am laufen.

TiEr

#220
Zitat von: justme1968 am 12 Februar 2016, 18:33:10
ich tippe mal auf eine zu alte node version. ich habe es hier mit 0.12.7 und 4.3.0 getestet. mit beiden geht es.

das nvm von oben sollte npm heißen.

gruss
  andre

ich habe mal node auf version 4.3.0 gebracht und hombridge neu installiert.

Jetzt bekomme ich folgenden Fehler: Loaded plugin: homebridge-fhem
Registering platform 'homebridge-fhem.FHEM'
---
Loaded config.json with 0 accessories and 1 platforms.
---
Loading 1 platforms...
/usr/local/lib/node_modules/homebridge/lib/api.js:74
  if (name.indexOf('.') == -1) {
          ^

TypeError: Cannot read property 'indexOf' of undefined
    at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:74:11)
    at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:194:45)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:35:36)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:23:16)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)


Achso die npm version ist 2.14.12


Edit:

So habe jetzt Node und homebridge komplett neu installiert. Leider funktioniert es immer noch nicht.

Version:
npm: 3.6.0
node 4.3.0

und die Fehlermeldung:

Loading 1 platforms...
/usr/lib/node_modules/homebridge/lib/api.js:74
  if (name.indexOf('.') == -1) {
          ^

TypeError: Cannot read property 'indexOf' of undefined
    at API.platform (/usr/lib/node_modules/homebridge/lib/api.js:74:11)
    at Server._loadPlatforms (/usr/lib/node_modules/homebridge/lib/server.js:194:45)
    at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:35:36)
    at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:23:16)
    at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)


Edit 2:

Wenn ich homebridge mit sudo ausführe, startet es wie gewollt. Wie kriege ich es hin, dass homebridge auch unter meinem normalen Benutzer läuft? Oder braucht homebridge sudo Rechte?

Grüße
Timo

Marc1993

#221
Hallo,

ich versuche nun einen GPIO des Raspberrys als "Contact" an Homebridge zu übergeben. An den GPIO´s habe ich Öffnungskontakte meiner Fenster angeschlossen.
Das einlesen in FHEM funktioniert mittels RPI_GPIO einwandfrei.
Ich bekomme es nur leider nicht hin den GPIO als "Contact" in Homebridge einzubinden.
Soweit ich das der index.js entnehmen kann, erwartet Homebridge ein reading namens "contact". Darin sollte dann "open" "closed" sein.

Das sind meine Readings:
Longpress
off
2016-02-13 09:52:55
Pinlevel
low
2016-02-13 09:59:23
state
off
2016-02-13 09:59:23


Wie bekomme ich Homebridge dazu diese zu nutzen?
Soll ich den wert in ein Dummy schreiben und da die passenden Readings erzeugen oder kann man das eventuell mappen?

Gruß

justme1968

@TiEr: homebridge braucht keine root rechte. das liegt an deiner installation. wenn du homebridge und/oder homebridge-fhem als root installierst steht es bei anderen usern nicht im pfad. d.h. immer als derjenige user installieren unter dem es auch laufen soll. zur installation ist sudo auch nicht nötig.

@Marc1993: du kannst jedes beliebige reading mappen:
attr <device> homebridgeMapping ContactSensorState=<reading>,values=<closed>:CONTACT_DETECTED;<open>:CONTACT_NOT_DETECTED
attr <device> homebridgeMapping CurrentDoorState=<reading>,values=<closed>:CLOSED;<open>:OPEN


<reading>, <closed> und <open> musst du durch dein reading und die beiden werte ersetzen.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

Lling

Kann man es nachträglich auch anderen Usern zur Verfügung stellen?

Marc1993

Hat funktioniert. Vielen dank! Jetzt habe ich das mit den Mapping auch verstanden  ::)