Brauche Hilfe beim erweitern der config.json

  • Liebe Community,


    ich versuche seit einigen Tagen meine Konfiguration zu erweitern. Konkret möchte ich die bestehende und funktionierende config.json um die Funktionaltiät von IFTTT erweitern. Nachfolgende die funktionierende Konfiguration:

    in die oben gelistete und funktionierende config.json oben möchte ich nachfolgenden Block einfügen:



    Aber ich kriege die beiden Blöcke nicht fehlerfrei in eine config.json zusammen, auch Checks im JSON Validator bringen mich nicht weiter. Ich schaffe einfach die richtige Positionierung der eckigen und halbrunden Klammern nicht.


    Es wäre supertoll, wenn ein JSON kundiger mir hier die gesamte config.json (als gesamten Textblock) posten könnte, und zwar eine Version die den Test im JSON Validator besteht und die mir ermöglicht sowohl das Netatmo als auch das IFTTT Plugin zu nutzen.


    Please help ;)

  • Kein JSON kundiger hin? Ich krieg einfach nicht die richtige Syntax zusammen :(

  • Läuft jetzt rund! Danke für Eure Inputs ;)

  • Hierzu habe ich auch noch eine Anfänger-Frage. Aktuell habe ich nur das hue-plugin erfolgreich am laufen.


    Ich will zwei weitere plugins mitaufnehnen (harmony und vorwerk).


    Mir ist bewusst, dass ich den Code unter "platforms" einfügen muss, sehr wichtig sind die Klammern.


    Ist es auch wichtig in Zeilen die "Einrückungen", also Leerzeichen zu beschten oder spielt dies keine Rolle?

  • Ich konnte das plugin für den harmonyhub leider nicht installieren:


    Habe es mit folgendem Befehl versucht:


    sudo npm install -g [email protected]


    Dabei erhielt ich diese Meldung:


    pi@raspberrypi:~ $ sudo npm install -g [email protected]

    npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

    npm ERR! code 128

    npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b cdata-for-ltx-parser https://github.com/swissmanu/ltx.git /root/.npm/_cacache/tmp/git-clone-cf169e96

    npm ERR! fatal: Konnte führende Verzeichnisse von '/root/.npm/_cacache/tmp/git-clone-cf169e96' nicht erstellen.: Keine Berechtigung

    npm ERR!


    npm ERR! A complete log of this run can be found in:

    npm ERR! /root/.npm/_logs/2017-08-04T23_49_35_557Z-debug.log

    pi@raspberrypi:~ $



    Ich habe daraufhin die config.json erst gar nicht verändert. Ich würde aber folgende config.json einfügen wollen, sobald das plugin installiert werden kann. Ich muss vermutlich irgendwelche Rechte erteilen, habe aber leider keine Ahnung, wie dies geht.


    Wenn ihr mich jetzt fragt, ob ich Homebridge als root oder Dienst am laufen habe, so weiss ich dies nicht. Jedenfalls rufe ich die config.json immer mit dem Befehl sudo nano /home/pi/.homebridge/config.json auf. Würde also eher auf Dienst tippen.


    Hier meine zukünftige config.json:


    {

    "bridge": {

    "name": "Homebridge",

    "username": "CC:22:3D:E3:CE:30",

    "port": 51826,

    "pin": "031-45-154"

    },

    "accessories": [


    ],

    "platforms": [{

    "platform": "HarmonyHub",

    "name": "Harmony Hub"

    },

    {

    "platform": "Hue",

    "name": "Hue",

    "host": "192.168.192.37",

    "users": {

    "001788FFFE28C123": "flg9iqP3ypcp-COBeBWjxnxiiMpA1YvgR25R0cge"

    },

    "heartrate": 5,

    "timeout": 5,

    "lights": true,

    "philipslights": false,

    "ct": false,

    "groups": false,

    "group0": true,

    "rooms": false,

    "sensors": true,

    "excludeSensorTypes": [


    ],

    "schedules": false,

    "rules": false

    }

    ]

    }


    Folgende Versionen laufen aktuell:

    [email protected]



    ??? [email protected]



    ??? [email protected]




    Hier noch der Inhalt der log-Datei:


    Last login: Sat Aug 5 01:04:22 on ttys000

    Kohlers-Mac-mini:~ manuel$ ssh [email protected]

    [email protected]'s password:


    The programs included with the Debian GNU/Linux system are free software;

    the exact distribution terms for each program are described in the

    individual files in /usr/share/doc/*/copyright.


    Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent

    permitted by applicable law.

    Last login: Sat Aug 5 01:45:12 2017 from 192.168.192.6

    pi@raspberrypi:~ $ sudo npm install -g [email protected]

    npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

    npm ERR! code 128

    npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b cdata-for-ltx-parser https://github.com/swissmanu/ltx.git /root/.npm/_cacache/tmp/git-clone-cf169e96

    npm ERR! fatal: Konnte führende Verzeichnisse von '/root/.npm/_cacache/tmp/git-clone-cf169e96' nicht erstellen.: Keine Berechtigung

    npm ERR!


    npm ERR! A complete log of this run can be found in:

    npm ERR! /root/.npm/_logs/2017-08-04T23_49_35_557Z-debug.log

    pi@raspberrypi:~ $ sudo npm install -g [email protected]

    npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

    npm ERR! code 128

    npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b cdata-for-ltx-parser https://github.com/swissmanu/ltx.git /root/.npm/_cacache/tmp/git-clone-849b708c

    npm ERR! fatal: Konnte führende Verzeichnisse von '/root/.npm/_cacache/tmp/git-clone-849b708c' nicht erstellen.: Keine Berechtigung

    npm ERR!


    npm ERR! A complete log of this run can be found in:

    npm ERR! /root/.npm/_logs/2017-08-05T00_01_55_169Z-debug.log

    pi@raspberrypi:~ $ sudo npm i [email protected]

    npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

    npm ERR! code 128

    npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b cdata-for-ltx-parser https://github.com/swissmanu/ltx.git /root/.npm/_cacache/tmp/git-clone-9f5cbdc2

    npm ERR! fatal: Konnte führende Verzeichnisse von '/root/.npm/_cacache/tmp/git-clone-9f5cbdc2' nicht erstellen.: Keine Berechtigung

    npm ERR!


    npm ERR! A complete log of this run can be found in:

    npm ERR! /root/.npm/_logs/2017-08-05T00_03_08_627Z-debug.log

    pi@raspberrypi:~ $ sudo npm install -g --unsafe-perm homebridge/[email protected] -g

    npm ERR! code ENOLOCAL

    npm ERR! Could not install from "homebridge/[email protected]" as it does not contain a package.json file.


    npm ERR! A complete log of this run can be found in:

    npm ERR! /root/.npm/_logs/2017-08-05T00_04_31_326Z-debug.log

    pi@raspberrypi:~ $ sudo npm install -g --unsafe-perm [email protected] -g

    npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

    npm ERR! code 128

    npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b cdata-for-ltx-parser https://github.com/swissmanu/ltx.git /root/.npm/_cacache/tmp/git-clone-b3cc3d34

    npm ERR! fatal: Konnte führende Verzeichnisse von '/root/.npm/_cacache/tmp/git-clone-b3cc3d34' nicht erstellen.: Keine Berechtigung

    npm ERR!


    npm ERR! A complete log of this run can be found in:

    npm ERR! /root/.npm/_logs/2017-08-05T00_06_14_528Z-debug.log

    pi@raspberrypi:~ $ sudo nano /root/.npm/_logs/2017-08-05T00_06_14_528Z-debug.log























    GNU nano 2.2.6 Datei: /root/.npm/_logs/2017-08-05T00_06_14_528Z-debug.log


    0 info it worked if it ends with ok

    1 verbose cli [ '/usr/local/bin/node',

    1 verbose cli '/usr/local/bin/npm',

    1 verbose cli 'install',

    1 verbose cli '-g',

    1 verbose cli '--unsafe-perm',

    1 verbose cli '[email protected]',

    1 verbose cli '-g' ]

    2 info using [email protected]

    3 info using [email protected]

    4 verbose npm-session 8529ed1faeb8f500

    5 silly install loadCurrentTree

    6 silly install readGlobalPackageData

    7 http fetch GET 200 https://registry.npmjs.org/homebridge-harmonyhub 184ms (from cache)

    8 silly pacote version manifest for [email protected] fetched in 329ms

    9 silly install loadIdealTree

    10 silly install cloneCurrentTreeToIdealTree

    11 silly install loadShrinkwrap

    12 silly install loadAllDepsIntoIdealTree

    13 silly resolveWithNewModule [email protected] checking installable status

    14 http fetch GET 200 https://registry.npmjs.org/debug 37ms (from cache)

    15 silly pacote version manifest for [email protected] fetched in 49ms

    16 http fetch GET 200 https://registry.npmjs.org/ms 28ms (from cache)

    17 silly pacote version manifest for [email protected] fetched in 33ms

    18 http fetch GET 200 https://registry.npmjs.org/harmonyhubjs-client 31ms (from cache)

    19 silly pacote version manifest for [email protected] fetched in 39ms

    20 silly pacote version manifest for [email protected] fetched in 17ms

    21 silly pacote version manifest for [email protected] fetched in 4ms

    22 http fetch GET 200 https://registry.npmjs.org/node-xmpp-client 24ms (from cache)

    23 silly pacote version manifest for [email protected] fetched in 47ms

    24 http fetch GET 200 https://registry.npmjs.org/browser-request 18ms (from cache)

    25 silly pacote version manifest for [email protected] fetched in 28ms

    26 http fetch GET 304 https://registry.npmjs.org/faye-websocket 393ms (from cache)

    27 silly pacote version manifest for [email protected] fetched in 400ms

    28 http fetch GET 304 https://registry.npmjs.org/websocket-driver 332ms (from cache)

    29 silly pacote version manifest for [email protected] fetched in 346ms

    30 http fetch GET 304 https://registry.npmjs.org/websocket-extensions 75ms (from cache)

    31 silly pacote version manifest for [email protected] fetched in 81ms

    32 http fetch GET 200 https://registry.npmjs.org/istanbul 18ms (from cache)

    33 silly pacote version manifest for [email protected] fetched in 31ms

    34 http fetch GET 304 https://registry.npmjs.org/abbrev 67ms (from cache)

    35 silly pacote version manifest for [email protected] fetched in 80ms

    36 http fetch GET 304 https://registry.npmjs.org/async 90ms (from cache)

    37 silly pacote version manifest for [email protected] fetched in 122ms

    38 http fetch GET 304 https://registry.npmjs.org/escodegen 84ms (from cache)

    39 silly pacote version manifest for [email protected] fetched in 98ms

    40 http fetch GET 200 https://registry.npmjs.org/estraverse 11ms (from cache)

    41 silly pacote version manifest for [email protected] fetched in 20ms

    42 http fetch GET 200 https://registry.npmjs.org/esutils 18ms (from cache)

    43 silly pacote version manifest for [email protected] fetched in 23ms

    44 http fetch GET 200 https://registry.npmjs.org/esprima 21ms (from cache)

    45 silly pacote version manifest for [email protected] fetched in 56ms

    46 http fetch GET 200 https://registry.npmjs.org/optionator 16ms (from cache)

    47 silly pacote version manifest for [email protected] fetched in 23ms

    48 http fetch GET 200 https://registry.npmjs.org/prelude-ls 11ms (from cache)

    49 silly pacote version manifest for [email protected] fetched in 20ms

    50 http fetch GET 200 https://registry.npmjs.org/deep-is 11ms (from cache)

    51 silly pacote version manifest for [email protected] fetched in 15ms

    52 http fetch GET 304 https://registry.npmjs.org/wordwrap 54ms (from cache)

    53 silly pacote version manifest for [email protected] fetched in 58ms

    54 http fetch GET 200 https://registry.npmjs.org/type-check 13ms (from cache)

    55 silly pacote version manifest for [email protected] fetched in 19ms

    56 http fetch GET 200 https://registry.npmjs.org/levn 11ms (from cache)

    57 silly pacote version manifest for [email protected] fetched in 16ms

    58 http fetch GET 200 https://registry.npmjs.org/fast-levenshtein 25ms (from cache)

    59 silly pacote version manifest for [email protected] fetched in 31ms

    60 http fetch GET 304 https://registry.npmjs.org/source-map 74ms (from cache)

    61 silly pacote version manifest for [email protected] fetched in 82ms

    62 http fetch GET 304 https://registry.npmjs.org/amdefine 63ms (from cache)

    63 silly pacote version manifest for [email protected] fetched in 68ms

    64 silly pacote version manifest for [email protected] fetched in 6ms


    ^G Hilfe ^O Speichern ^R Datei öffnen ^Y Seite zurück ^K Ausschneiden ^C Cursor

    ^X Beenden ^J Ausrichten ^W Wo ist ^V Seite vor ^U Ausschn. rückgängig ^T Rechtschr.




    Einmal editiert, zuletzt von Kohle_81 ()

  • Du kannst versuchen, das Harmony Plugin mit folgendem Befehl zu installieren. Das erteilt die nötigen Rechte.


    Code
    sudo chown -R $USER /usr/local && npm install -g [email protected]


    Der Part zum Harmony Hub in deiner config.json ist ok. Der Eintrag zum Hue Plugin könntest du noch etwas 'ausdünnen'.


    Deine Fragen von zuvor: Die Einrückungen spielen keine Rolle. Die dienen nur der Übersichtlichkeit.

  • @Krocko:


    Vielen Dank für den Hinweis. Ich habe den Befehl nach meinem Hilferuf auch gefunden und in die Befehlszeile eingegeben. Es hat leider auch nicht funktioniert.


    Es erscheint dann folgende Meldung:


    sudo chown -R $USER /usr/local && npm install -g [email protected]
    npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
    npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
    npm WARN pi No description
    npm WARN pi No repository field.
    npm WARN pi No README data
    npm WARN pi No license field.



    up to date in 0.444s

    Einmal editiert, zuletzt von Kohle_81 ()

  • @Krocko


    Ich habe vorhin einfach nochmals den Befehl eingegeben und siehe da, beim dann jetzt vierten Versuch lief die Installation problemlos. Keine Ahnung, an was es gelegen hat, aber es funktioniert und das ist die Hauptsache.

    Ich habe allerdings das aktuelle plugin vom harmonyhub installiert und bin bis jetzt zufrieden.


    Generell finde ich dieses Forum einfach Spitze, dass einem so schnell geholfen wird!!!! Ich bin doch noch ziemlich am Anfang und bin daher über Unterstützung froh.

    Ich hoffe, dass ich eines Tages auch anderen helfen kann.

  • Du kannst versuchen, das Harmony Plugin mit folgendem Befehl zu installieren. Das erteilt die nötigen Rechte.


    Code
    sudo chown -R $USER /usr/local && npm install -g [email protected]


    Der Part zum Harmony Hub in deiner config.json ist ok. Der Eintrag zum Hue Plugin könntest du noch etwas 'ausdünnen'.

    @Krocko


    Danke für die Rückmeldung zur config.json.


    Was kann ich aus der config.json beim hue-plugin entfernen?


    Ich verwende mehrere Hue Lampen, den motion sensor und die osram plugs.


    Bin aber für solche Hinweise sehr dankbar. Hat dies Auswirkungen auf die Aktualisierungsgeschwindigkeit oder was ist der Hintergrund?

  • Hast du die V1 Bridge, oder die V2?


    Hier findest du die Anleitung, was du bei der jeweiligen Bridge hinzufügen musst.

    Ich verwende die V2 Konfiguration und habe nur den Eintrag "philipsLights": true hinzugefügt.

    Damit habe ich nicht das Problem, das die Lampen von unterwegs aus oft nicht erreichbar sind und ich kann die Transition Time nutzen.

  • Ich verwende die Bridge in der zweiten Ausführung, also V2.


    Und es werden mir dann mit deinem Eintrag philipslight: true dennoch alle Lampen, Sensoren und Plugs angezeigt?


    Was bedeutet transition time? Habe ich noch nie gehört....

  • Ok, hört sich gut an. Das heißt mein bisheriger Eintrag zu hue wie folgt:



    {

    "platform": "Hue",

    "name": "Hue",

    "host": "192.168.192.37",

    "users": {

    "001788FFFE28C123": "flg9iqP3ypcp-COBeBWjxnxiiMpA1YvgR25R0cge"

    },

    "heartrate": 5,

    "timeout": 5,

    "lights": true,

    "philipslights": false,

    "ct": false,

    "groups": false,

    "group0": true,

    "rooms": false,

    "sensors": true,

    "excludeSensorTypes": [


    ],

    "schedules": false,

    "rules": false

    }


    kann ich reduzieren. Ich habe nachfolgend mal gelöscht und so konfiguriert, wie ich es für richtig halte:



    {

    "platform": "Hue",

    "name": "Hue",

    "host": "192.168.192.37",

    "users": {

    "001788FFFE28C123": "flg9iqP3ypcp-COBeBWjxnxiiMpA1YvgR25R0cge"

    },

    "philipslights": true,

    "excludeSensorTypes": [ "Daylight", "CLIP", "Geofence" ],


    }

  • Das letzte Komma muss ich vermutlich dann weglassen, da hue bei mir der letzte platform Eintrag ist in der config.json, oder?

  • sensors und lights würde ich noch mit einfügen und auf true setzen.

  • Ok super, vielen Dank für die Unterstützung. Wird heut Nacht umgesetzt, wenn Frauchen im Bett ist und ich noch bissle tüfteln darf ?

  • Das ging wie gehofft flott. Vielen Dank an Kocko für die Tipps, ich habe die überfluessigen Zeilen gelöscht und excluded mit aufgenommen.


    Reagiert schneller und die App ist aufgeräumt, da hätte ich auch selber mal drauf kommen können.