homebridge/homekit

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

Vorheriges Thema - Nächstes Thema

visionsurfer


Mitch

Never touch a running system  >:(

Hab gerade einen Update von Homebridge gemacht und jetzt startet sie nicht mehr  :o

SyntaxError: Unexpected strict mode reserved word
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/index.js:3:14)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)


node sollte passen

markus@qfserver:~$ node -v
v0.12.4
markus@qfserver:~$ nodejs -v
v7.1.0
FHEM im Proxmox Container

Mitch

so, habe jetzt mit n fast alle node Versionen getestet...leider ohne Erfolg  >:(

Die Fehlermeldung variiert dann auch:

markus@qfserver:~$ sudo n stable

     install : node-v7.0.0
       mkdir : /usr/local/n/versions/node/7.0.0
       fetch : https://nodejs.org/dist/v7.0.0/node-v7.0.0-linux-x64.tar.gz
######################################################################## 100,0%
   installed : v7.0.0

markus@qfserver:~$ n
markus@qfserver:~$ sudo homebridge
/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/dns_sd.js:35
    throw ex;
    ^

Error: The module '/usr/local/lib/node_modules/homebridge/node_modules/mdns/build/Release/dns_sd_bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 14. This version of Node.js requires
NODE_MODULE_VERSION 51. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or`npm install`).
    at Object.Module._extensions..node (module.js:600:18)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/dns_sd.js:24:20)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
FHEM im Proxmox Container

justme1968

instalier homebridge mal mit --force. das sollte die dependencies neu kompilieren.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

Mitch

Ne, hat leider auch nicht funktioniert  >:(

Habe jetzt alles manuell deinstalliert und gelöscht und node neu installiert.
Jetzt geht es wieder.
Hatte wohl mittlerweile einen ziemlichen node-Salat  ;D
FHEM im Proxmox Container

Mitch

Jetzt habe ich doch noch eine Frage:

Ich habe für einige Rollos Dummys, darauf einen DOIF und damit steuer ich HM und FS20 Empfänger.
Der Dummy kennt im Prinzip nur Auf und Zu.

Internals:
   NAME       Rollo.Buero
   NR         99
   STATE      Auf
   TYPE       dummy
   .userReadings:
   Readings:
     2016-11-12 12:08:50   direction       rauf
     2016-11-12 12:08:50   position        oben
     2016-11-12 12:08:50   state           Auf
Attributes:
   alias      Rollo Büro
   comment    drive-down-80 {((ReadingsNum("Rollo.Buero","drive-down",0)/100)*80)}, drive-up-80 {((ReadingsNum("Rollo.Buero","drive-up",0)/100)*20)}
   devStateIcon Auf:fts_shutter_10 Zu:fts_shutter_100 20:fts_shutter_70
   drive-down 33
   drive-up   35
   fm_type    state,offbutton,onbutton
   genericDeviceType blind
   group      Rollos
   homebridgeMapping clear
On=state,valueOn=Auf,valueOff=Zu,cmdOn=Auf,cmdOff=Zu
   room       Buero,Homekit,Rollos
   setList    Auf Zu
   userReadings position, direction
   userattr   drive-up drive-down
   webCmd     Auf:Zu:20


Leider erkennt Homekit den Staus nicht und kann auch nicht steuern.

Wenn ich in Homekit klicke, steht dort wird geöffnet und der Dummy wird auf pct 100 geschalten.

Jemand eine Idee?
FHEM im Proxmox Container

justme1968

wenn es nur zwei zustände gibt musst du genericDeviceType switch setzen.

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

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

Mitch

Ja, das geht natürlich, aber dann ist
1. das Icon falsch und
2. wird es von Homekit nicht als Rollo erkannt und auch nicht in der Zusammenfassung als offen dargestellt

Ich dachte, ich kann den genericType "frei" festlegen und dann mit dem mapping entsprechend die Befehle "verbiegen"?
FHEM im Proxmox Container

justme1968

du kannst alles frei konfgurieren. aber dann musst du auch die charactersitics umbiegen die ein rolladen hat.

cmdOn/Off und valueOn/Off gibt es nur bei einem schalter. ein homekit rolladen kenn nur CurrentPosition und TargetPosition. die musst du so mappen das Auf und Zu über values auf 100 und 0 gemapped wird und 100 und 0 über cmds auf Auf und Zu.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

Mitch

Ich bekomm es einfach nicht hin  :-[

Ich habe jetzt mit eventMap, userreadings und Co. rumprobiert, aber es mag nicht so richtig.
Ich habe geschafft, dass Homekit die Rollo hoch und runter fahren kann, aber der Status stimmt nie.
Das zerhaut mir dann auch meine DOIFs.

Homekit sendet ja PCT 100 für ganz rauf und PCT 0 für ganz runter. Mehr brauche ich auch nicht.
Jetzt muss ich irgendwie das Mapping so hinbekommen, dass

Homekit -> FHEM => PCT 100 = Auf (also wenn Homekit PCT 100 schickt, muss bei FHEM Auf ankommen)
Homekit -> FHEM => PCT 0 = Zu

FHEM -> Homekit => state/STATE = Auf für Homekit PCT 100
FHEM -> Homekit => state/STATE = Zu für Homekit PCT 0
FHEM im Proxmox Container

justme1968

versuch es mal so:attr <name> homebridgeMapping CurrentPosition=state,values=Zu:0;;Auf:100 TargetPosition=CurrentPosition,minStep=50,cmds=0:Zu;;/.*/:Auf

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

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

kirk1h

hi,

ich hab heute mal homebridge und homebridge-fhem auf den aktuellen stand gebracht.
leider leider werden jetzt meine daten nicht mehr richtig geparsed. kommt immer 1 raus:


HEIZUNG ABGAS:

[11/13/2016, 11:26:53 PM] [FHEM] Initializing platform accessory 'tempAbgas'...
[11/13/2016, 11:26:53 PM] [FHEM] creating services for tempAbgas
[11/13/2016, 11:26:53 PM] [FHEM]   information service for tempAbgas
[11/13/2016, 11:26:53 PM] [FHEM]     manufacturer, model and serial number characteristics for tempAbgas
[11/13/2016, 11:26:53 PM] [FHEM]   TemperatureSensor service for tempAbgas
[11/13/2016, 11:26:53 PM] [FHEM]     CurrentTemperature characteristic for tempAbgas:state
[11/13/2016, 11:26:53 PM] [FHEM]       initial value is: 1 (number)
[11/13/2016, 11:26:53 PM] [FHEM]       props: { format: 'float',
  unit: 'celsius',
  minValue: 1,
  maxValue: 400,
  minStep: 1,
  perms: [ 'pr', 'ev' ] }

[11/13/2016, 11:30:59 PM] [FHEM]     caching: CurrentTemperature: 1 (as number; from '118')

--

PUFFERSPEICHER %:

[11/13/2016, 11:26:53 PM] [FHEM] Initializing platform accessory 'percentPuffer'...
[11/13/2016, 11:26:53 PM] [FHEM] creating services for percentPuffer
[11/13/2016, 11:26:53 PM] [FHEM]   information service for percentPuffer
[11/13/2016, 11:26:53 PM] [FHEM]     manufacturer, model and serial number characteristics for percentPuffer
[11/13/2016, 11:26:53 PM] [FHEM]   HumiditySensor service for percentPuffer
[11/13/2016, 11:26:53 PM] [FHEM]     CurrentRelativeHumidity characteristic for percentPuffer:state
[11/13/2016, 11:26:53 PM] [FHEM]       initial value is: 1 (number)
[11/13/2016, 11:26:53 PM] [FHEM]       props: { format: 'float',
  unit: 'percentage',
  minValue: 0,
  maxValue: 100,
  minStep: 1,
  perms: [ 'pr', 'ev' ] }

[11/13/2016, 11:26:53 PM] [FHEM]     caching: CurrentRelativeHumidity: 1 (as number; from '100')

irgendwelche tipps?

justme1968

zeig mal die konsole mit --debug und ein jsonlist2 von einem device.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

kirk1h

#1588
vor dem update von homebridge und homebridge-fhem gings monate lang ohne probleme.

{
  "Arg":"percentPuffer",
  "Results": [
  {
    "Name":"percentPuffer",
    "PossibleSets":" ",
    "PossibleAttrs":"alias comment:textField-long eventMap group room suppressReading userReadings:textField-long verbose:0,1,2,3,4,5 readingList setList useSetExtensions event-on-change-reading event-on-update-reading event-aggregator event-min-interval stateFormat:textField-long timestamp-on-change-reading cmdIcon devStateIcon devStateStyle genericDeviceType:ignore,switch,outlet,light,blind,thermometer,thermostat,garage,window,lock homebridgeMapping:textField-long icon sortby webCmd widgetOverride userattr",
    "Internals": {
      "NAME": "percentPuffer",
      "NR": "163",
      "STATE": "100",
      "TYPE": "dummy"
    },
    "Readings": {      "state": { "Value":"100", "Time":"2016-11-14 00:28:31" }    },
    "Attributes": {
      "alias": "PUFFER",
      "genericDeviceType": "HumiditySensor",
      "homebridgeMapping": "CurrentRelativeHumidity=state",
      "room": "HomeKit"
    }
  }  ],
  "totalResultsReturned":1
}



*** WARNING *** The program 'nodejs' 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=nodejs>
*** WARNING *** The program 'nodejs' 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=nodejs&f=DNSServiceRegister>
[11/14/2016, 12:29:53 AM] Loaded plugin: homebridge-fhem
homebridge API version: 2.1
[11/14/2016, 12:29:53 AM] Registering platform 'homebridge-fhem.FHEM'
[11/14/2016, 12:29:53 AM] ---
[11/14/2016, 12:29:53 AM] Loaded config.json with 0 accessories and 1 platforms.
[11/14/2016, 12:29:53 AM] ---
[11/14/2016, 12:29:53 AM] Loading 1 platforms...
[11/14/2016, 12:29:53 AM] [FHEM] Initializing homebridge-fhem.FHEM platform...
starting longpoll: http://127.0.0.1:8083/fhem.pl?XHR=1&inform=type=status;addglobal=1;filter=.*;since=null;fmt=JSON&timestamp=1479079794596
[11/14/2016, 12:29:54 AM] [FHEM] Checking genericDeviceType...
[11/14/2016, 12:29:54 AM] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7BAttrVal(%22global%22,%22userattr%22,%22%22)%7D&XHR=1
[11/14/2016, 12:29:54 AM] [FHEM] Fetching FHEM devices...
[11/14/2016, 12:29:54 AM] [FHEM] fetching: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20room=HomeKit&XHR=1
[11/14/2016, 12:29:54 AM] Loading 0 accessories...
Server listening on: http://<ip>:8282
[11/14/2016, 12:29:54 AM] [FHEM] got: 4 results
[11/14/2016, 12:29:54 AM] [FHEM] mappings for SD2: { FirmwareRevision: { reading: 'D-firmware', _isInformation: true },
  On:
   { reading: 'state',
     valueOff: '/off|A0|000000/',
     cmdOn: 'on',
     cmdOff: 'off' } }
[11/14/2016, 12:29:54 AM] [FHEM] SD2 is light
[11/14/2016, 12:29:54 AM] [FHEM] SD2 has
[11/14/2016, 12:29:54 AM] [FHEM]   FirmwareRevision [D-firmware]
[11/14/2016, 12:29:54 AM] [FHEM]   On [state;on,off]
  2016-11-14 00:29:54 caching: SD2-D-firmware: 2.5
[11/14/2016, 12:29:54 AM] [FHEM]     caching: FirmwareRevision: 2.5 (as string; from '2.5')
  2016-11-14 00:29:54 caching: SD2-state: off
[11/14/2016, 12:29:54 AM] [FHEM] SD2-state valueOn/valueOff: value off mapped to 0
[11/14/2016, 12:29:54 AM] [FHEM]     caching: On: false (as boolean; from 'off')
[11/14/2016, 12:29:54 AM] [FHEM] mappings for SD4: { FirmwareRevision: { reading: 'D-firmware', _isInformation: true },
  On:
   { reading: 'state',
     valueOff: '/off|A0|000000/',
     cmdOn: 'on',
     cmdOff: 'off' } }
[11/14/2016, 12:29:54 AM] [FHEM] SD4 is switch
[11/14/2016, 12:29:54 AM] [FHEM] SD4 has
[11/14/2016, 12:29:54 AM] [FHEM]   FirmwareRevision [D-firmware]
[11/14/2016, 12:29:54 AM] [FHEM]   On [state;on,off]
  2016-11-14 00:29:54 caching: SD4-D-firmware: 2.6
[11/14/2016, 12:29:54 AM] [FHEM]     caching: FirmwareRevision: 2.6 (as string; from '2.6')
  2016-11-14 00:29:54 caching: SD4-state: MISSING ACK
[11/14/2016, 12:29:54 AM] [FHEM] SD4-state valueOn/valueOff: value MISSING ACK mapped to 1
[11/14/2016, 12:29:54 AM] [FHEM]     caching: On: true (as boolean; from 'MISSING ACK')
[11/14/2016, 12:29:54 AM] [FHEM] homebridgeMapping: CurrentRelativeHumidity=state
[11/14/2016, 12:29:54 AM] [FHEM] mappings for percentPuffer: { CurrentRelativeHumidity: { reading: 'state' } }
[11/14/2016, 12:29:54 AM] [FHEM] percentPuffer is HumiditySensor
[11/14/2016, 12:29:54 AM] [FHEM] percentPuffer has
[11/14/2016, 12:29:54 AM] [FHEM]   CurrentRelativeHumidity [state]
  2016-11-14 00:29:54 caching: percentPuffer-state: 99
[11/14/2016, 12:29:54 AM] [FHEM]     caching: CurrentRelativeHumidity: 1 (as number; from '99')
[11/14/2016, 12:29:54 AM] [FHEM] homebridgeMapping: CurrentTemperature=state,minValue=1,maxValue=400,minStep=1

[11/14/2016, 12:29:54 AM] [FHEM] mappings for tempAbgas: { CurrentTemperature: { reading: 'state', minValue: 1, maxValue: 400, minStep: 1 } }
[11/14/2016, 12:29:54 AM] [FHEM] tempAbgas is thermometer
[11/14/2016, 12:29:54 AM] [FHEM] tempAbgas has
[11/14/2016, 12:29:54 AM] [FHEM]   CurrentTemperature [state]
  2016-11-14 00:29:54 caching: tempAbgas-state: 100
[11/14/2016, 12:29:54 AM] [FHEM]     caching: CurrentTemperature: 1 (as number; from '100')
[11/14/2016, 12:29:54 AM] [FHEM] Initializing platform accessory 'SD2'...
[11/14/2016, 12:29:54 AM] [FHEM] creating services for SD2
[11/14/2016, 12:29:54 AM] [FHEM]   information service for SD2
[11/14/2016, 12:29:54 AM] [FHEM]     manufacturer, model and serial number characteristics for SD2
[11/14/2016, 12:29:54 AM] [FHEM]     firmware revision characteristic for SD2
[11/14/2016, 12:29:54 AM] [FHEM]   Lightbulb service for SD2
[11/14/2016, 12:29:54 AM] [FHEM]     On characteristic for SD2:state
[11/14/2016, 12:29:54 AM] [FHEM]       initial value is: false (boolean)
[11/14/2016, 12:29:54 AM] [FHEM]       props: { format: 'bool',
  unit: null,
  minValue: null,
  maxValue: null,
  minStep: null,
  perms: [ 'pr', 'pw', 'ev' ] }
[11/14/2016, 12:29:54 AM] [FHEM] Initializing platform accessory 'SD4'...
[11/14/2016, 12:29:54 AM] [FHEM] creating services for SD4
[11/14/2016, 12:29:54 AM] [FHEM]   information service for SD4
[11/14/2016, 12:29:54 AM] [FHEM]     manufacturer, model and serial number characteristics for SD4
[11/14/2016, 12:29:54 AM] [FHEM]     firmware revision characteristic for SD4
[11/14/2016, 12:29:54 AM] [FHEM]   Switch service for SD4
[11/14/2016, 12:29:54 AM] [FHEM]     On characteristic for SD4:state
[11/14/2016, 12:29:54 AM] [FHEM]       initial value is: true (boolean)
[11/14/2016, 12:29:54 AM] [FHEM]       props: { format: 'bool',
  unit: null,
  minValue: null,
  maxValue: null,
  minStep: null,
  perms: [ 'pr', 'pw', 'ev' ] }
[11/14/2016, 12:29:54 AM] [FHEM] Initializing platform accessory 'percentPuffer'...
[11/14/2016, 12:29:54 AM] [FHEM] creating services for percentPuffer
[11/14/2016, 12:29:54 AM] [FHEM]   information service for percentPuffer
[11/14/2016, 12:29:54 AM] [FHEM]     manufacturer, model and serial number characteristics for percentPuffer
[11/14/2016, 12:29:54 AM] [FHEM]   HumiditySensor service for percentPuffer
[11/14/2016, 12:29:54 AM] [FHEM]     CurrentRelativeHumidity characteristic for percentPuffer:state
[11/14/2016, 12:29:54 AM] [FHEM]       initial value is: 1 (number)
[11/14/2016, 12:29:54 AM] [FHEM]       props: { format: 'float',
  unit: 'percentage',
  minValue: 0,
  maxValue: 100,
  minStep: 1,
  perms: [ 'pr', 'ev' ] }
[11/14/2016, 12:29:54 AM] [FHEM] Initializing platform accessory 'tempAbgas'...
[11/14/2016, 12:29:54 AM] [FHEM] creating services for tempAbgas
[11/14/2016, 12:29:54 AM] [FHEM]   information service for tempAbgas
[11/14/2016, 12:29:54 AM] [FHEM]     manufacturer, model and serial number characteristics for tempAbgas
[11/14/2016, 12:29:54 AM] [FHEM]   TemperatureSensor service for tempAbgas
[11/14/2016, 12:29:54 AM] [FHEM]     CurrentTemperature characteristic for tempAbgas:state
[11/14/2016, 12:29:54 AM] [FHEM]       initial value is: 1 (number)
[11/14/2016, 12:29:54 AM] [FHEM]       props: { format: 'float',
  unit: 'celsius',
  minValue: 1,
  maxValue: 400,
  minStep: 1,
  perms: [ 'pr', 'ev' ] }
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

    ┌────────────┐
    │ 999-99-999 │
    └────────────┘

[11/14/2016, 12:29:55 AM] Homebridge is running on port 81.
  2016-11-14 00:29:55 caching: tempAbgas-state: 99
[11/14/2016, 12:29:55 AM] [FHEM]     caching: CurrentTemperature: 1 (as number; from '99')
  2016-11-14 00:32:33 caching: tempAbgas-state: 98
[11/14/2016, 12:32:33 AM] [FHEM]     caching: CurrentTemperature: 1 (as number; from '98')
  2016-11-14 00:32:35 caching: percentPuffer-state: 100
[11/14/2016, 12:32:35 AM] [FHEM]     caching: CurrentRelativeHumidity: 1 (as number; from '100')

justme1968

habs repariert. bitte hombridge-fhem noch mal updaten bzw. drüber installieren.

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

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