Apple Homekit: die Hoffnung stirbt zuletzt

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

Vorheriges Thema - Nächstes Thema

justme1968

das update habe ich. bin aber im urlaub und kann nicht testen ...

kann man sehen was es mit den graphen auf sich hat? oder geht das nur mit den original sensoren ?

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

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

TheDestroyer

Hallo,

also folgendes steht beim Start im Log:
[FHEM] sc_Leuchtkugel has RGB [0-RGB]
[FHEM] sc_deckenlampe is light
[FHEM] sc_nachttisch is light
[FHEM] Initializing device with name sc_Leuchtkugel...
[FHEM] Loaded services for sc_Leuchtkugel
checking Adjust the Hue of the Light function
Characteristics.js: registering Adjust the Hue of the Light function
checking Adjust the Saturation of the Light function
Characteristics.js: registering Adjust the Saturation of the Light function
checking Adjust Brightness of the Light function
Characteristics.js: registering Adjust Brightness of the Light function
Cannot find secret key, creating One...
TCP server accepting connection on port: 51828
HAP Server is listening


Bei persist wird die Lampe auch angezeigt.
Das steht bei subscriptions:
'sc_Leuchtkugel-hue':
{ characteristic:
{ instanceID: 9,
accessoryID: 1,
type: '00000013-0000-1000-8000-0026BB765291',
value: 0,
perms: [ 'pw', 'pr', 'ev' ],
format: 'int',
supportEvents: true,
supportBonjour: false,
manfDescription: 'Adjust the Hue of the Light',
designedMaxLength: undefined,
designedMinValue: 0,
designedMaxValue: 360,
designedMinStep: 1,
unit: 'arcdegrees',
eventEnabled: true,
bonjourEnabled: false,
subscribedPeers: {},
onUpdate: [Function],
onRegister: [Function],
locals: undefined,
onRead: [Function],
accessoryController:
{ accessoryID: 1,
instanceID: 12,
objects:
{ '1': [Object],
'2': [Object],
'3': [Object],
'4': [Object],
'5': [Object],
'6': [Object],
'7': [Object],
'8': [Object],
'9': [Circular],
'10': [Object],
'11': [Object] },
services: [ [Object], [Object] ],
tcpServer:
{ servicePort: 51828,
persistStore: [Object],
accessoryInfo: [Object],
hapPort: 51829,
server: [Object],
sessions: {},
portMap: {} } } },
accessory:
{ mappings: {},
name: 'sc_Leuchtkugel',
alias: 'Leuchtkugel',
device: 'sc_Leuchtkugel',
type: 'WifiLight',
model: undefined,
PossibleSets: 'on off dim dimup dimdown HSV RGB sync pair unpair',
hasDim: undefined,
pctMax: undefined,
hasRGB: 'RGB',
isLight: true,
isBlind: undefined,
isWindow: undefined,
isThermostat: undefined,
isContactSensor: undefined,
isOccupancySensor: undefined,
log: [Function],
connection:
{ base_url: 'http://localhost:8083',
request:
{ [Function: request]
get: [Function],
head: [Function],
post: [Function],
put: [Function],
patch: [Function],
del: [Function],
jar: [Function],
cookie: [Function],
defaults: [Function],
forever: [Function],
Request: [Object],
debug: undefined,
initParams: [Function: initParams] } } } },

'sc_Leuchtkugel-RGB':
{ characteristic:
{ instanceID: 9,
accessoryID: 1,
type: '00000013-0000-1000-8000-0026BB765291',
value: 0,
perms: [ 'pw', 'pr', 'ev' ],
format: 'int',
supportEvents: true,
supportBonjour: false,
manfDescription: 'Adjust the Hue of the Light',
designedMaxLength: undefined,
designedMinValue: 0,
designedMaxValue: 360,
designedMinStep: 1,
unit: 'arcdegrees',
eventEnabled: true,
bonjourEnabled: false,
subscribedPeers: {},
onUpdate: [Function],
onRegister: [Function],
locals: undefined,
onRead: [Function],
accessoryController:
{ accessoryID: 1,
instanceID: 12,
objects:
{ '1': [Object],
'2': [Object],
'3': [Object],
'4': [Object],
'5': [Object],
'6': [Object],
'7': [Object],
'8': [Object],
'9': [Circular],
'10': [Object],
'11': [Object] },
services: [ [Object], [Object] ],
tcpServer:
{ servicePort: 51828,
persistStore: [Object],
accessoryInfo: [Object],
hapPort: 51829,
server: [Object],
sessions: {},
portMap: {} } } },
accessory:
{ mappings: {},
name: 'sc_Leuchtkugel',
alias: 'Leuchtkugel',
device: 'sc_Leuchtkugel',
type: 'WifiLight',
model: undefined,
PossibleSets: 'on off dim dimup dimdown HSV RGB sync pair unpair',
hasDim: undefined,
pctMax: undefined,
hasRGB: 'RGB',
isLight: true,
isBlind: undefined,
isWindow: undefined,
isThermostat: undefined,
isContactSensor: undefined,
isOccupancySensor: undefined,
log: [Function],
connection:
{ base_url: 'http://localhost:8083',
request:
{ [Function: request]
get: [Function],
head: [Function],
post: [Function],
put: [Function],
patch: [Function],
del: [Function],
jar: [Function],
cookie: [Function],
defaults: [Function],
forever: [Function],
Request: [Object],
debug: undefined,
initParams: [Function: initParams] } } } },

'sc_Leuchtkugel-sat':
{ characteristic:
{ instanceID: 10,
accessoryID: 1,
type: '0000002F-0000-1000-8000-0026BB765291',
value: 100,
perms: [ 'pw', 'pr', 'ev' ],
format: 'int',
supportEvents: true,
supportBonjour: false,
manfDescription: 'Adjust the Saturation of the Light',
designedMaxLength: undefined,
designedMinValue: 0,
designedMaxValue: 100,
designedMinStep: 1,
unit: '%',
eventEnabled: true,
bonjourEnabled: false,
subscribedPeers: {},
onUpdate: [Function],
onRegister: [Function],
locals: undefined,
onRead: [Function],
accessoryController:
{ accessoryID: 1,
instanceID: 12,
objects:
{ '1': [Object],
'2': [Object],
'3': [Object],
'4': [Object],
'5': [Object],
'6': [Object],
'7': [Object],
'8': [Object],
'9': [Object],
'10': [Circular],
'11': [Object] },
services: [ [Object], [Object] ],
tcpServer:
{ servicePort: 51828,
persistStore: [Object],
accessoryInfo: [Object],
hapPort: 51829,
server: [Object],
sessions: {},
portMap: {} } } },
accessory:
{ mappings: {},
name: 'sc_Leuchtkugel',
alias: 'Leuchtkugel',
device: 'sc_Leuchtkugel',
type: 'WifiLight',
model: undefined,
PossibleSets: 'on off dim dimup dimdown HSV RGB sync pair unpair',
hasDim: undefined,
pctMax: undefined,
hasRGB: 'RGB',
isLight: true,
isBlind: undefined,
isWindow: undefined,
isThermostat: undefined,
isContactSensor: undefined,
isOccupancySensor: undefined,
log: [Function],
connection:
{ base_url: 'http://localhost:8083',
request:
{ [Function: request]
get: [Function],
head: [Function],
post: [Function],
put: [Function],
patch: [Function],
del: [Function],
jar: [Function],
cookie: [Function],
defaults: [Function],
forever: [Function],
Request: [Object],
debug: undefined,
initParams: [Function: initParams] } } } },

'sc_Leuchtkugel-bri':
{ characteristic:
{ instanceID: 11,
accessoryID: 1,
type: '00000008-0000-1000-8000-0026BB765291',
value: 0,
perms: [ 'pw', 'pr', 'ev' ],
format: 'int',
supportEvents: true,
supportBonjour: false,
manfDescription: 'Adjust Brightness of the Light',
designedMaxLength: undefined,
designedMinValue: 0,
designedMaxValue: undefined,
designedMinStep: 1,
unit: '%',
eventEnabled: true,
bonjourEnabled: false,
subscribedPeers: {},
onUpdate: [Function],
onRegister: [Function],
locals: undefined,
onRead: [Function],
accessoryController:
{ accessoryID: 1,
instanceID: 12,
objects:
{ '1': [Object],
'2': [Object],
'3': [Object],
'4': [Object],
'5': [Object],
'6': [Object],
'7': [Object],
'8': [Object],
'9': [Object],
'10': [Object],
'11': [Circular] },
services: [ [Object], [Object] ],
tcpServer:
{ servicePort: 51828,
persistStore: [Object],
accessoryInfo: [Object],
hapPort: 51829,
server: [Object],
sessions: {},
portMap: {} } } },
accessory:
{ mappings: {},
name: 'sc_Leuchtkugel',
alias: 'Leuchtkugel',
device: 'sc_Leuchtkugel',
type: 'WifiLight',
model: undefined,
PossibleSets: 'on off dim dimup dimdown HSV RGB sync pair unpair',
hasDim: undefined,
pctMax: undefined,
hasRGB: 'RGB',
isLight: true,
isBlind: undefined,
isWindow: undefined,
isThermostat: undefined,
isContactSensor: undefined,
isOccupancySensor: undefined,
log: [Function],
connection:
{ base_url: 'http://localhost:8083',
request:
{ [Function: request]
get: [Function],
head: [Function],
post: [Function],
put: [Function],
patch: [Function],
del: [Function],
jar: [Function],
cookie: [Function],
defaults: [Function],
forever: [Function],
Request: [Object],
debug: undefined,
initParams: [Function: initParams] } } } },


Die Lampe wird in EVE gefunden, ich komme auch dazu den Code einzugeben, und nach Eingabe des Codes ist die Lampe verschwunden.
Danach ist kein Pairen mehr möglich, erst nach löschen der persist Datei.

Ma_Bo

#512
Hallo an alle,
gibt es ein kleines HowTo, wie ich das ganze ans laufen bekomme ?
Oder hat einer ein Image, welches ich mir auf einen Pi B+ spielen könnte ?

Versuche jetzt schon seit gestern Homebridge ans laufen zu bekommen, aber ständig kommen Fehlermeldungen.

Ich habe dieses Imgae auf eine SD Karte gespielt : 2015-05-05-raspbian-wheezy.img
dann habe ich folgendes gemacht :

sudo raspi-config
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove -y && sudo reboot
sudo apt-get -f install && sudo apt-get -y install perl libdevice-serialport-perl libio-socket-ssl-perl libwww-perl libxml-simple-perl
sudo wget http://fhem.de/fhem-5.6.deb && sudo dpkg -i fhem-5.6.deb
cd /opt && sudo chmod -R a+w fhem && sudo usermod -a -G tty pi && sudo usermod -a -G tty fhem


smit habe ich fhem schonmal am laufen.

jetzt habe ich versucht :

sudo apt-get update && apt-get upgrade
sudo apt-get install git-core libnss-mdns libavahi-compat-libdnssd-dev -y
sudo wget http://node-arm.herokuapp.com/node_0.12.1-1_armhf.deb
sudo dpkg -i node_0.12.1-1_armhf.deb
sudo node -v && npm -v
sudo git clone https://github.com/KhaosT/HAP-NodeJS.git
cd HAP-NodeJS/
sudo npm install node-persist && npm install srp && npm install mdns
sudo npm install ed25519 && npm install curve25519
sudo node BridgedCore.js


bis hierher kein Problem.

Dann :

sudo git clone https://github.com/nfarina/homebridge.git
cd homebridge
sudo npm install


Dann kommen Fehlermeldungen (siehe Bild)
Nach einem Reboot, kommt das was in Bild : homebridge_install_nach_reboot.jpg steht.
Ich weiss einfach nicht mehr weiter.
NUC mit FHEM, HM Heizungsthermostate, HM Wandthermostate, Intertechno Funksteckdosen, 10" Tablet als Wanddisplay, KeyMatic, Fensterkontakte, Fensterkontakte umgebaut als Wassermelder und Briefkastenmelder, Aussenthermostat, Anwesenheitssteuerung über Fritz Box, Google Home usw. usw.

volschin

Warum hältst Du dich nicht erstmal an die offizielle Anleitung?
https://github.com/nfarina/homebridge

Also die beiden mit git angelegten Verzeichnisse nochmal komplett löschen und nur homebridge (wie in der Anleitung und ohne sudo)  installieren. alles andere läuft darüber.
Intel NUC+Ubuntu 24.04+Docker+FHEM6
HomeMatic: HM-MOD-RPI-PCB+HM-USB-CFG2+hmland+diverse, HUE: Hue-Bridge, RaspBee+deCONZ+diverse
Amzn Dash-Buttons, Siro Rollos
4xRPi, 4xCO20, OWL+USB, HarmonyHub, FRITZ!Box 7690, Echo Dots+Show8, HomeBridge

justme1968

@TheDestroyer: ich kann gerade nicht selber nachschauen. bitte versuch mal die version aus meinem github branch: https://github.com/justme-1968/homebridge/blob/master/platforms/FHEM.js

ansonsten schaue ich es mir an wenn ich zurück bin.

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

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

Ma_Bo

@ volschin : auch das endet nur in Fehlermeldungen.
Ich stell meine Versuche erstmal ein, evtl. gibt es ja bald ein HowTo, welches von Grundauf erklärt, wie und wo wasinstalliert werden muss.

Trotzdem Danke für deine Hilfe.
NUC mit FHEM, HM Heizungsthermostate, HM Wandthermostate, Intertechno Funksteckdosen, 10" Tablet als Wanddisplay, KeyMatic, Fensterkontakte, Fensterkontakte umgebaut als Wassermelder und Briefkastenmelder, Aussenthermostat, Anwesenheitssteuerung über Fritz Box, Google Home usw. usw.

rapster

Zwar keine Ahnung bzgl RasPi,

aber probier doch mal NICHT als "pi" Benutzer sondern als root (wechseln mit "su -") zu installieren, und NICHT im home Verzeichnis sondern evtl. mal in /opt/homebridge oder so.

desweiteren Kannst du dir das:
sudo git clone https://github.com/KhaosT/HAP-NodeJS.git
cd HAP-NodeJS/
sudo npm install node-persist && npm install srp && npm install mdns
sudo npm install ed25519 && npm install curve25519
sudo node BridgedCore.js

komplett sparen, ein:
git clone https://github.com/nfarina/homebridge.git
cd homebridge
npm install

reicht vollkommen.

Node habe ich bei mir ebenfalls anderst installiert, kann aber natürlich sein dass dein Weg auch funktioniert.
Das habe ich bei mir zur Installation der Homebridge incl. Node 0.12 benötigt:
curl -sL https://deb.nodesource.com/setup_0.12 | bash -
apt-get install nodejs git g++ libavahi-compat-libdnssd-dev git-core libnss-mdns
git clone https://github.com/nfarina/homebridge.git
cd homebridge
npm install
npm install forever -g

Danach lief das... (allerdings normales Debian, kein Raspi)

Gruß
Claudiu


volschin

Zitat von: Ma_Bo am 17 August 2015, 16:00:53
@ volschin : auch das endet nur in Fehlermeldungen.
Ich stell meine Versuche erstmal ein, evtl. gibt es ja bald ein HowTo, welches von Grundauf erklärt, wie und wo wasinstalliert werden muss.

Trotzdem Danke für deine Hilfe.
Was mir gerade auffällt, Du schreibst garnichts darüber, dass Du vor dem Start die config.json angepasst hast. hast Du das nur unterschlagen oder vergessen?
Intel NUC+Ubuntu 24.04+Docker+FHEM6
HomeMatic: HM-MOD-RPI-PCB+HM-USB-CFG2+hmland+diverse, HUE: Hue-Bridge, RaspBee+deCONZ+diverse
Amzn Dash-Buttons, Siro Rollos
4xRPi, 4xCO20, OWL+USB, HarmonyHub, FRITZ!Box 7690, Echo Dots+Show8, HomeBridge

Ma_Bo

Hab ich bearbeitet ;)
Dies Steht drin :

{
            "platform": "FHEM",
            "name": "FHEM",
            "server": "192.168.178.45",
            "port": "8083",
            "filter": "room=Test"
        },
NUC mit FHEM, HM Heizungsthermostate, HM Wandthermostate, Intertechno Funksteckdosen, 10" Tablet als Wanddisplay, KeyMatic, Fensterkontakte, Fensterkontakte umgebaut als Wassermelder und Briefkastenmelder, Aussenthermostat, Anwesenheitssteuerung über Fritz Box, Google Home usw. usw.

Newbee

Zitat von: Ma_Bo am 17 August 2015, 16:44:57
Hab ich bearbeitet ;)
Dies Steht drin :

{
            "platform": "FHEM",
            "name": "FHEM",
            "server": "192.168.178.45",
            "port": "8083",
            "filter": "room=Test"
        },


Hallo Ma_Bo,

hatte am Anfang auch ein paar Schwierigkeiten HomeKit auf dem Pi B zum Laufen zu bringen.
Hatte es wie folgt hinbekommen.


$ git clone https://github.com/nfarina/homebridge.git
$ cd homebridge
$ sudo npm install


Habe dann noch die Berechtigung des Verzeichnisses mit

sudo chown -r pi:pi homebridge

geändert und dann lief es bei mir.

Eventuell hilft es!?

Mein config.json sieht wie folgt aus


{
    "platforms": [
        {
            "platform": "FHEM",
            "name": "FHEM",
            "server": "192.168.xxx.zzz",
            "port": "8083",
            "ssl": "true",
            "auth": {"user": "xxxx", "pass": "xxxx"},
            "filter": "room=ABC"
        }
    ],

    "accessories": []
}


Das wird schon habe auch einige Anläufe gebraucht.

Gruß Newbee
Intel-NUC mit ubuntu server 20.04; FHEM 6.0
HM, Dect, Netatmo, Hue

Ma_Bo

Danke für eure Hilfe, mir hat eben ein netter User hier, seinen kompletten Ordner "homebridge" geschickt, ein paar kleine Anpassungen in der config.json und schon rennt der Karren.

Kann schon ein paar devices schalten.

Grüße Marcel
NUC mit FHEM, HM Heizungsthermostate, HM Wandthermostate, Intertechno Funksteckdosen, 10" Tablet als Wanddisplay, KeyMatic, Fensterkontakte, Fensterkontakte umgebaut als Wassermelder und Briefkastenmelder, Aussenthermostat, Anwesenheitssteuerung über Fritz Box, Google Home usw. usw.

volschin

Ich denke, es war eine fehlerhafte config.json. So wie sie Newbee gepostet hat, muss sie korrekt aussehen.
Aber Hauptsache es läuft jetzt.  :)
Intel NUC+Ubuntu 24.04+Docker+FHEM6
HomeMatic: HM-MOD-RPI-PCB+HM-USB-CFG2+hmland+diverse, HUE: Hue-Bridge, RaspBee+deCONZ+diverse
Amzn Dash-Buttons, Siro Rollos
4xRPi, 4xCO20, OWL+USB, HarmonyHub, FRITZ!Box 7690, Echo Dots+Show8, HomeBridge

TheDestroyer

@Andre:
Vielen Dank für deine Mühe, leider funktioniert das ganze immernoch nicht.  :-\

Ich bin mir zwar nicht ganz sicher, aber ich glaube ich habe einen Fehler in deiner aktuellen Version gefunden.
Wenn ich die aktuelle Version von FHEM.js aus Github probieren will bekomme ich folgenden Fehler beim Start:
sudo npm start run

> homebridge@0.0.0 start /opt/homebridge
> node app.js "run"

Starting HomeBridge server...
*** 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>
Loading 4 platforms...
[FHEM] Initializing FHEM platform...
starting longpoll: http://localhost:8083/fhem.pl?XHR=1&inform=type=status;filter=.*;since=null;fmt=JSON&timestamp=1440010820661
[FHEM] Fetching FHEM switchable devices...
[FHEM] fetching: http://localhost:8083/fhem?cmd=jsonlist2%20room=Wohnzimmer&XHR=1
[FHEM] Initializing FHEM platform...
[FHEM] Fetching FHEM switchable devices...
[FHEM] fetching: http://localhost:8083/fhem?cmd=jsonlist2%20room=K%C3%BCche&XHR=1
[FHEM] Initializing FHEM platform...
[FHEM] Fetching FHEM switchable devices...
[FHEM] fetching: http://localhost:8083/fhem?cmd=jsonlist2%20room=Schlafzimmer&XHR=1
[FHEM] Initializing FHEM platform...
[FHEM] Fetching FHEM switchable devices...
[FHEM] fetching: http://localhost:8083/fhem?cmd=jsonlist2%20room=Esszimmer&XHR=1
Server listening on: http://<ip>:8080
[FHEM] got: 1 results
[FHEM] kue_Lampe is light
[FHEM] kue_Lampe has onOff [[object Object]]
/opt/homebridge/platforms/FHEM.js:617
tributes.model : (s.Internals.model ? s.Internals.model : s.Readings.model.Val
                                                                    ^
TypeError: Cannot read property 'Value' of undefined
    at Object.FHEMAccessory (/opt/homebridge/platforms/FHEM.js:617:120)
    at /opt/homebridge/platforms/FHEM.js:364:40
    at Array.map (native)
    at Request._callback (/opt/homebridge/platforms/FHEM.js:353:31)
    at Request.self.callback (/opt/homebridge/node_modules/request/request.js:373:22)
    at Request.emit (events.js:110:17)
    at Request.<anonymous> (/opt/homebridge/node_modules/request/request.js:1318:14)
    at Request.emit (events.js:129:20)
    at Gunzip.<anonymous> (/opt/homebridge/node_modules/request/request.js:1266:12)
    at Gunzip.emit (events.js:129:20)

npm ERR! Linux 4.0.9-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "run"
npm ERR! node v0.12.6
npm ERR! npm  v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! homebridge@0.0.0 start: `node app.js "run"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the homebridge@0.0.0 start script 'node app.js "run"'.
npm ERR! This is most likely a problem with the homebridge package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node app.js "run"
npm ERR! You can get their info via:
npm ERR!     npm owner ls homebridge
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /opt/homebridge/npm-debug.log


Ich hab jetzt bei Zeile 617
  this.model            = s.Attributes.model ? s.Attributes.model : (s.Internals.model ? s.Internals.model : s.Readings.model.Value);
einfach das .Value von s.Readings.model.Value weggelassen.

Jetzt kann ich Homebridge zwar wieder starten, mein problem ist aber leider immernoch nicht behoben.

flurin

#523
@TheDestroyer

Die Änderung kam von mir. Man muss vorher noch testen, ob das Reading vorhanden ist:

Versuchs vorläufig so:


this.model            = s.Attributes.model ? s.Attributes.model : s.Internals.model;


Gruss
flurin

flurin

#524
Hallo,

Homebridge wurde updated (Merge von "use-hap-refactor"), es gibt zusätzliche Parameter in config.json, die normalerweise nicht geändert werden sollten.


    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:27",
        "port": 51826,
        "pin": "031-45-154"
    },


Gruss
flurin