Xiaomi Mi Flora / Flower Care - Smarter Pflanzensensor homebridge-mi-flower-care

  • Habe mir den gesamten Log anzeigen lassen. Es werden Daten vom Flower Care an den Pi übertragen:


    Fri, 05 Apr 2019 21:46:58 GMT miflora data: <Buffer b8 00 00 3f 00 00 00 06 85 00 02 3c 00 fb 34 9b>

    Fri, 05 Apr 2019 21:46:58 GMT miflora temperature: 18.4 °C

    Fri, 05 Apr 2019 21:46:58 GMT miflora Light: 63 lux

    Fri, 05 Apr 2019 21:46:58 GMT miflora moisture: 6 %

    Fri, 05 Apr 2019 21:46:58 GMT miflora fertility: 133 µS/cm

    Fri, 05 Apr 2019 21:46:58 GMT att c4:7c:8d:6a:5d:93: write: 0a3800

    Fri, 05 Apr 2019 21:46:58 GMT hci write acl data pkt - writing: 0240000700030004000a3800


    Aber in der Home App tut sich noch nichts. Werde ich mir Morgen früh mal anschauen, vielleicht regelt sich das.


    @vgnsxe Vielen Dank für die Hilfe!

  • Habe mich gerade selbst laenger mit den sensoren rumschlagen muessen, da ich auf einen PI umgezogen bin und hab folgendes festgestellt, versuch mal:


    Code
    getcap $(eval readlink -f /usr/local/lib/node_modules/homebridge-mi-flower-care/index.js)

    Danach kommt ein Ergebnis raus, da brauchen wir das was nach dem = steht:


    Code
    /usr/local/lib/node_modules/homebridge-mi-flower-care/index.js = cap_net_admin,cap_net_raw+eip

    danach


    Code
    which node

    Und jetzt verbinden wir den oberen Befehl mit dem Pfad von which node, als Beispiel bei mir:


    Code
    sudo setcap cap_net_admin,cap_net_raw+eip $(eval readlink -f /usr/local/bin/node)


    Bei dir koennte das natuerlich anders aussehen.


    Bei mir war der Grund, dass das Plugin nicht ausreichend bluetooth Rechte hatte und deshalb immer rumgemeckert hat und nix gepolled hat.

    Nachdem ich das nun gefixed hab laeuft alles :)


    Es kann aber auch sein, dass es bei dir eine ganz andere Ursache hat, warum nix im log erscheint, das ist also nur ein Versuch..

  • @vgnsxe und sschuste Vielen Dank Euch beiden! Habe beides ausprobiert, habe aber gleichen Zustand wie gestern Abend. Das Log zeigt mir minütlich Daten, die kommen aber in der Home App nicht an. Log sieht z. B. so aus:


    Sat, 06 Apr 2019 18:58:56 GMT miflora temperature: 19.3 °C

    Sat, 06 Apr 2019 18:58:56 GMT miflora Light: 65 lux

    Sat, 06 Apr 2019 18:58:56 GMT miflora moisture: 5 %

    Sat, 06 Apr 2019 18:58:56 GMT miflora fertility: 79 µS/cm

    Sat, 06 Apr 2019 18:58:56 GMT att c4:7c:8d:6a:5d:93: write: 0a3800


    Das bedeutet doch, das der Pi mit dem Flower Care kommuniziert, oder? Aber irgendwie werden die Daten dann nicht an die Home App weitergegeben.

  • stell doch mal den Poll-intervall auf 30, speicher deine config und gebe dann im Terminal folgendes ein:


    Code
    sudo systemctl restart homebridge.service && sudo systemctl -fau homebridge.service

    Und dann lass mal alles durchlaufen, kontrollier, ob es irgendwo einen Fehler gibt und schau was nach ca. 30Sekunden angezeigt wird.

  • Ah sorry.


    ein .service war zu viel...


    Code
    sudo systemctl restart homebridge.service && sudo systemctl -fau homebridge

    So muss es sein :D

  • Was ist heut bloß los mit mir....


    Code
    sudo systemctl restart homebridge.service && sudo journalctl -fau homebridge

    Jetzt aber, ENDLICH. Sorry...

  • Folgende Ausgabe erscheint:


    pi@raspberrypi:~ $ sudo systemctl restart homebridge.service && sudo journalctl -fau homebridge

    -- Logs begin at Thu 2016-11-03 18:16:42 CET. --

    Apr 06 22:13:20 raspberrypi systemd[1]: Stopping LSB: Start daemon at boot time...

    Apr 06 22:13:20 raspberrypi sudo[25705]: pam_unix(sudo:session): session closed for user root

    Apr 06 22:13:21 raspberrypi homebridge[25924]: Stopping homebridge...

    Apr 06 22:13:21 raspberrypi homebridge[25924]: Stopped

    Apr 06 22:13:21 raspberrypi systemd[1]: Stopped LSB: Start daemon at boot time.

    Apr 06 22:13:21 raspberrypi systemd[1]: Starting LSB: Start daemon at boot time...

    Apr 06 22:13:21 raspberrypi homebridge[25944]: Starting homebridge

    Apr 06 22:13:21 raspberrypi sudo[25946]: root : TTY=unknown ; PWD=/root ; USER=root ; ENV=DEBUG=* ; COMMAND=/usr/local/bin/homebridge

    Apr 06 22:13:21 raspberrypi sudo[25946]: pam_unix(sudo:session): session opened for user root by (uid=0)

    Apr 06 22:13:22 raspberrypi systemd[1]: Started LSB: Start daemon at boot time.

    Apr 06 22:13:22 raspberrypi node[25953]: *** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.

    Apr 06 22:13:22 raspberrypi node[25953]: *** WARNING *** Please fix your application to use the native API of Avahi!

    Apr 06 22:13:22 raspberrypi node[25953]: *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>

    Apr 06 22:13:22 raspberrypi node[25953]: *** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.

    Apr 06 22:13:22 raspberrypi node[25953]: *** WARNING *** Please fix your application to use the native API of Avahi!

    Apr 06 22:13:22 raspberrypi node[25953]: *** WARNING *** For more information see <http://0pointer.de/avahi-compa…node&f=DNSServiceRegister>


    Die üblichen Warnmeldungen, auch ein paar Minuten später erscheint nichts neues.

  • Und außer diesen Warnungen erscheint dir NIX? Ich kenne diese Meldungen nur von meinem frueheren MacMini, auf welchem Geraet hast du denn homebridge ueberhaupt installiert? Also ja ich sehe, dass du auf einem PI angemeldet bist, aber nach welcher Anleitung bist du da denn vorgegangen?


    Eig. muesste dir dieses live log ja auch anzeigen, welche accessories und platforms gerade initialisiert werden etc...


    bei mir sieht es beispielsweise so aus:


    pi@raspberrypi:~ $ sudo systemctl restart homebridge.service && sudo journalctl -fau homebridge

    -- Logs begin at Sat 2019-04-06 12:12:19 CEST. --

    Apr 06 22:10:30 raspberrypi homebridge[25810]: [2019-4-6 22:10:30] [Hue] Flur Deckenlampe: set homekit on from 0 to 1

    Apr 06 22:10:30 raspberrypi homebridge[25810]: [2019-4-6 22:10:30] [Hue] Flur Deckenlampe: set homekit brightness from 0% to 100%

    Apr 06 22:10:50 raspberrypi homebridge[25810]: [2019-4-6 22:10:50] [Hue] Flur Deckenlampe: set homekit brightness from 100% to 0%

    Apr 06 22:10:50 raspberrypi homebridge[25810]: [2019-4-6 22:10:50] Got SIGTERM, shutting down Homebridge...

    Apr 06 22:10:50 raspberrypi systemd[1]: Stopping Node.js HomeKit Server...

    Apr 06 22:10:55 raspberrypi systemd[1]: homebridge.service: Main process exited, code=exited, status=143/n/a

    Apr 06 22:10:55 raspberrypi systemd[1]: Stopped Node.js HomeKit Server.

    Apr 06 22:10:55 raspberrypi systemd[1]: homebridge.service: Unit entered failed state.

    Apr 06 22:10:55 raspberrypi systemd[1]: homebridge.service: Failed with result 'exit-code'.

    Apr 06 22:10:55 raspberrypi systemd[1]: Started Node.js HomeKit Server.

    Apr 06 22:10:57 raspberrypi homebridge[25967]: [2019-4-6 22:10:57] Loaded config.json with 10 accessories and 7 platforms.

    Apr 06 22:10:57 raspberrypi homebridge[25967]: [2019-4-6 22:10:57] ---

    Apr 06 22:10:57 raspberrypi homebridge[25967]: [2019-4-6 22:10:57] Loaded plugin: homebridge-config-ui-x

    Apr 06 22:10:57 raspberrypi homebridge[25967]: [2019-4-6 22:10:57] Registering platform 'homebridge-config-ui-x.config'

    Apr 06 22:10:57 raspberrypi homebridge[25967]: [2019-4-6 22:10:57] ---



    Und halt noch weiter....

  • Habe den Pi mit der Homebridge-App eingerichtet. Ich glaube ich weiß, worauf Du hinaus willst. Bei der App nennt sich das Debugging. Wenn ich die Befehle der App eingebe erscheint folgendes:


    pi@raspberrypi:~ $ sudo homebridge -U /root/.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-compa…node&f=DNSServiceRegister>

    [2019-4-6 22:35:20] Loaded plugin: homebridge-livolo-switches

    [2019-4-6 22:35:20] Registering platform 'homebridge-livolo-switches.livolo-switches'

    [2019-4-6 22:35:20] ---

    [2019-4-6 22:35:20] Loaded plugin: homebridge-mi-flower-care

    [2019-4-6 22:35:21] Registering accessory 'homebridge-mi-flower-care.mi-flower-care'

    [2019-4-6 22:35:21] ---

    [2019-4-6 22:35:21] Loaded plugin: homebridge-rademacher-homepilot

    [2019-4-6 22:35:21] Registering platform 'homebridge-rademacher-homepilot.RademacherHomePilot'

    [2019-4-6 22:35:21] ---

    [2019-4-6 22:35:22] Loaded plugin: homebridge-raspberrypi-temperature

    [2019-4-6 22:35:22] Registering accessory 'homebridge-raspberrypi-temperature.RaspberryPiTemperature'

    [2019-4-6 22:35:22] ---

    [2019-4-6 22:35:22] Loaded plugin: homebridge-wol

    [2019-4-6 22:35:22] Registering accessory 'homebridge-wol.NetworkDevice'

    [2019-4-6 22:35:22] ---

    [2019-4-6 22:35:22] Loaded config.json with 3 accessories and 2 platforms.

    [2019-4-6 22:35:22] ---

    [2019-4-6 22:35:22] Loading 2 platforms...

    [2019-4-6 22:35:22] [HomePilot] Initializing RademacherHomePilot platform...

    [2019-4-6 22:35:22] [Livolo] Initializing livolo-switches platform...

    [2019-4-6 22:35:22] [Livolo] Livolo Init

    [2019-4-6 22:35:22] Loading 3 accessories...

    [2019-4-6 22:35:22] [Example PC] Initializing NetworkDevice accessory...

    [2019-4-6 22:35:22] [Pi Temp] Initializing RaspberryPiTemperature accessory...

    [2019-4-6 22:35:22] [Tomaten ] Initializing mi-flower-care accessory...

    Setup Payload:

    X-HM://0023ISZJXP1KO

    Scan this code with your HomeKit app on your iOS device to pair with Homebridge:


    Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:


    ??????????????

    ? 031-45-981 ?

    ??????????????


    [2019-4-6 22:35:22] [Livolo] DidFinishLaunching

    [2019-4-6 22:35:22] Homebridge is running on port 51826.

    [2019-4-6 22:35:22] [HomePilot] Online: Büro links [1010006]

    [2019-4-6 22:35:22] [HomePilot] Online: Büro rechts [1010008]

    [2019-4-6 22:35:22] [HomePilot] Online: Küche [1010004]

    [2019-4-6 22:35:22] [HomePilot] Online: Schlafzimmer links [1010012]

    [2019-4-6 22:35:22] [HomePilot] Online: Schlafzimmer rechts [1010014]

    [2019-4-6 22:35:22] [HomePilot] Online: Wohnzimmer links [1010010]

    [2019-4-6 22:35:22] [HomePilot] Online: Wohnzimmer rechts [1010002]

    [2019-4-6 22:35:22] [HomePilot] Online: Badezimmer [1010020]

    [2019-4-6 22:35:22] [HomePilot] Online: Terrassen-Tür [1010016]

    [2019-4-6 22:35:22] [HomePilot] Online: Esszimmer [1010018]

    connected

  • Ah okay, wusste nicht, dass es ueberhaupt noch jemanden gibt, der die App nutzt und sie auch funktioniert :D


    Okay Tomaten wird schonmal initialisiert, das klingt doch schonmal gut.


    Kannst du in der App dir ein aktuellen live log, fortlaufend anzeigen lassen, denn in deinem log wissen wir jetzt erstmal nur, dass das Plugin sauber durchstartet...


    Denke es waere fuer dich und alle die hier am supporten sind einfacher, wenn du wenigstens config-ui-x installieren koenntest um eine web GUI zu haben, oder aber du guckst, ob du dich ueber einen computer mit dem PI connecten kannst und gehst, da gewisse Befehle von hier nochmal durch.

  • Bin mit meinem Macbook per Terminal auf dem Pi. Bin aber nicht wirklich sicher damit, deshalb nutze ich für die Einrichtung von Plugins die App. Bei mir funktioniert die prima.


    Die Befehle habe ich bisher alle am Terminal eingegeben.


    Die App hat ein System-Log, da tauchen die gleichen Daten wie beim Debugging auf. Und ein Error-Log, da taucht leider etwas zum Flower-Care auf:


    Sat, 06 Apr 2019 20:51:38 GMT miflora device discovered: undefined

    Sat, 06 Apr 2019 20:51:38 GMT gap advertisement = {"manufacturerData":{"type":"Buffer","data":[76,0,9,6,3,100,192,168,0,63]},"serviceData":[],"serviceUuids":[],"solicitationServiceUuids":[],"serviceSolicitationUuids":[]}

    Sat, 06 Apr 2019 20:51:38 GMT hci rssi = -52

    Sat, 06 Apr 2019 20:51:38 GMT hci eir = 02011b0bff4c0009060364c0a8003f

    Sat, 06 Apr 2019 20:51:38 GMT hci address type = random

    Sat, 06 Apr 2019 20:51:38 GMT hci address = 06:a8:21:93:dd:30

    Sat, 06 Apr 2019 20:51:38 GMT hci type = 3

    Sat, 06 Apr 2019 20:51:38 GMT hci LE meta event data = 030130dd9321a8060f02011b0bff4c0009060364c0a8003fcc

    Sat, 06 Apr 2019 20:51:38 GMT hci LE meta event status = 1

    Sat, 06 Apr 2019 20:51:38 GMT hci LE meta event type = 2

    Sat, 06 Apr 2019 20:51:38 GMT hci sub event type = 62

    Sat, 06 Apr 2019 20:51:38 GMT hci event type = 4

    Sat, 06 Apr 2019 20:51:38 GMT hci onSocketData: 043e1b0201030130dd9321a8060f02011b0bff4c0009060364c0a8003fcc

    Sat, 06 Apr 2019 20:51:38 GMT miflora device discovered: undefined

    Sat, 06 Apr 2019 20:51:38 GMT gap advertisement = {"manufacturerData":{"type":"Buffer","data":[76,0,16,5,1,24,189,204,250]},"serviceData":[],"serviceUuids":[],"solicitationServiceUuids":[],"serviceSolicitationUuids":[]}

    Sat, 06 Apr 2019 20:51:38 GMT hci rssi = -82

    Sat, 06 Apr 2019 20:51:38 GMT hci eir =

    Sat, 06 Apr 2019 20:51:38 GMT hci address type = random

    Sat, 06 Apr 2019 20:51:38 GMT hci address = 4e:ac:88:aa:43:6f

    Sat, 06 Apr 2019 20:51:38 GMT hci type = 4

    Sat, 06 Apr 2019 20:51:38 GMT hci LE meta event data = 04016f43aa88ac4e00ae

    Sat, 06 Apr 2019 20:51:38 GMT hci LE meta event status = 1

    Sat, 06 Apr 2019 20:51:38 GMT hci LE meta event type = 2

  • Wenn ich am Terminal mit dem Befehl tail -f /var/log/homebridge.err den Error-Log aufrufe, erscheint auch was zum Flower-Care:


    Sat, 06 Apr 2019 20:59:40 GMT miflora data: <Buffer c0 00 00 2f 00 00 00 05 4d 00 02 3c 00 fb 34 9b>

    Sat, 06 Apr 2019 20:59:40 GMT miflora temperature: 19.2 °C

    Sat, 06 Apr 2019 20:59:40 GMT miflora Light: 47 lux

    Sat, 06 Apr 2019 20:59:40 GMT miflora moisture: 5 %

    Sat, 06 Apr 2019 20:59:40 GMT miflora fertility: 77 µS/cm

    Sat, 06 Apr 2019 20:59:40 GMT att c4:7c:8d:6a:5d:93: write: 0a3800

    Sat, 06 Apr 2019 20:59:40 GMT hci write acl data pkt - writing: 0240000700030004000a3800

    Sat, 06 Apr 2019 20:59:40 GMT hci onSocketData: 0240200c00080004000b622a332e322e31

    Sat, 06 Apr 2019 20:59:40 GMT hci event type = 2

    Sat, 06 Apr 2019 20:59:40 GMT hci cid = 4

    Sat, 06 Apr 2019 20:59:40 GMT hci handle = 64

    Sat, 06 Apr 2019 20:59:40 GMT hci data = 0b622a332e322e31

    Sat, 06 Apr 2019 20:59:40 GMT att c4:7c:8d:6a:5d:93: read: 0b622a332e322e31

    Sat, 06 Apr 2019 20:59:40 GMT miflora firmware data: <Buffer 62 2a 33 2e 32 2e 31>

    Sat, 06 Apr 2019 20:59:43 GMT hci onSocketData: 0240200800040004001b210000

    Sat, 06 Apr 2019 20:59:43 GMT hci event type = 2

    Sat, 06 Apr 2019 20:59:43 GMT hci cid = 4

    Sat, 06 Apr 2019 20:59:43 GMT hci handle = 64

    Sat, 06 Apr 2019 20:59:43 GMT hci data = 1b210000

    Sat, 06 Apr 2019 20:59:46 GMT hci onSocketData: 0240200800040004001b210000

    Sat, 06 Apr 2019 20:59:46 GMT hci event type = 2

    Sat, 06 Apr 2019 20:59:46 GMT hci cid = 4

    Sat, 06 Apr 2019 20:59:46 GMT hci handle = 64

    Sat, 06 Apr 2019 20:59:46 GMT hci data = 1b210000

    Sat, 06 Apr 2019 20:59:49 GMT hci onSocketData: 0240200800040004001b210000

    Sat, 06 Apr 2019 20:59:49 GMT hci event type = 2

    Sat, 06 Apr 2019 20:59:49 GMT hci cid = 4

    Sat, 06 Apr 2019 20:59:49 GMT hci handle = 64

    Sat, 06 Apr 2019 20:59:49 GMT hci data = 1b210000

    Sat, 06 Apr 2019 20:59:50 GMT hci onSocketData: 04050400400013

    Sat, 06 Apr 2019 20:59:50 GMT hci event type = 4

    Sat, 06 Apr 2019 20:59:50 GMT hci sub event type = 5

    Sat, 06 Apr 2019 20:59:50 GMT hci handle = 64

    Sat, 06 Apr 2019 20:59:50 GMT hci reason = 19


    Und der Log hört gar nicht auf, rennt ständig weiter .... :(

  • Wenn die App zum installieren verwendet wird, dann wird systemctl und journalctl nicht verwendet.


    Stefan

  • Habe nun mal versucht den Pi mit dem Flower Care zu pairen. Das sieht dann so aus:


    pi@raspberrypi:~ $ sudo bluetoothctl

    [NEW] Controller B8:27:EB:79:18:2B raspberrypi [default]

    [NEW] Device C4:7C:8D:6A:5D:93 Flower care

    [bluetooth]# pair C4:7C:8D:6A:5D:93

    Attempting to pair with C4:7C:8D:6A:5D:93

    [CHG] Device C4:7C:8D:6A:5D:93 Connected: yes

    Failed to pair: org.bluez.Error.AuthenticationFailed

    [CHG] Device C4:7C:8D:6A:5D:93 Connected: no


    Zuerst ist der Flower Care verbunden, dann wieder nicht. Die Meldung "Failed to pair: org.bluez.Error.AuthenticationFailed" kann ich mir nicht erklären.


    Nach einer Weile erscheint wieder folgende Meldung:

    [CHG] Device C4:7C:8D:6A:5D:93 Connected: yes

    [CHG] Device C4:7C:8D:6A:5D:93 Connected: no


    Ist das vielleicht normal, da der Pi ja nicht ständig mit dem Flower Care verbunden ist, sondern nur im eingestellten Intervall?

  • Habe heute einen zweiten Flower Care in Betrieb genommen, ohne die Hersteller-App zu nutzen. Über Homebridge eingebunden, wieder keine Daten. Das Verhalten des Pi ist aber eigenartig. Der zweite Flower Care wird regelmäßig als "new" angezeigt und dann nach ein paar Sekunden als "del", danach wieder als "new", usw.


    pi@raspberrypi:~ $ bluetoothctl

    [NEW] Controller B8:27:EB:79:18:2B raspberrypi [default]

    [NEW] Device C4:7C:8D:6A:5D:93 Flower care

    [NEW] Device C4:7C:8D:6A:61:B8 Flower care

    [CHG] Device C4:7C:8D:6A:5D:93 Connected: yes

    [CHG] Device C4:7C:8D:6A:61:B8 Connected: no

    [DEL] Device C4:7C:8D:6A:61:B8 Flower care

    [CHG] Device C4:7C:8D:6A:5D:93 Connected: no

    [NEW] Device C4:7C:8D:6A:61:B8 Flower care

    [CHG] Device C4:7C:8D:6A:5D:93 Connected: yes

    [CHG] Device C4:7C:8D:6A:61:B8 Connected: no

    [DEL] Device C4:7C:8D:6A:61:B8 Flower care

    [CHG] Device C4:7C:8D:6A:5D:93 Connected: no

    [bluetooth]# exit


    Bin ratlos ...