Miele (und andere Smarthome Geräte)

Da passiert garnix!

/etc/ssl/certs/ ist reichlich gefüllt. Auch mit diversen DigiCert…pem

Gibt bei mir nen Stacktrace und wenn es “woanders” funktioniert würde ich entweder mom auf das Homegear-Image tippen oder, dass die SD-Kart nen Hau hat.

Ich glaube aber das Homegear-Image scheidet fast aus, weil @sathya wirklich wie ein Fuchs auf Sicherheit, Zertifikate, etc. achtet.
Magst du einfach mal nen Raspbian auf den Pi braten und damit mal testen?

Ok, musste erst noch strace installieren. Nun habe ich mehr Infos bekommen:

openat(AT_FDCWD, "/proc/sys/crypto/fips_enabled", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/etc/gcrypt/hwf.deny", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/proc/self/auxv", O_RDONLY) = 3
openat(AT_FDCWD, "/proc/cpuinfo", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/root/.curlrc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/ssl/openssl.cnf", O_RDONLY|O_LARGEFILE) = 4
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = 4

Taucht da nirgends /etc/ssl/certs/ auf?

Nein, das taucht tatsächlich nicht auf:

pi@homegear(rw):/etc/ssl/certs$ sudo strace curl https://www.google.com |& grep open
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libcurl.so.4", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libz.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libpthread.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libnghttp2.so.14", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libidn2.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/librtmp.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libssh2.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libpsl.so.5", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libssl.so.1.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libcrypto.so.1.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libgssapi_krb5.so.2", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libkrb5.so.3", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libk5crypto.so.3", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libcom_err.so.2", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libldap_r-2.4.so.2", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/liblber-2.4.so.2", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libunistring.so.2", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libgnutls.so.30", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libhogweed.so.4", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libnettle.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libgmp.so.10", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libgcrypt.so.20", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libdl.so.2", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libkrb5support.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libkeyutils.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libresolv.so.2", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libsasl2.so.2", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libp11-kit.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libtasn1.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libgpg-error.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libffi.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/ssl/openssl.cnf", O_RDONLY|O_LARGEFILE) = 3
openat(AT_FDCWD, "/proc/sys/crypto/fips_enabled", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/etc/gcrypt/hwf.deny", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/proc/self/auxv", O_RDONLY) = 3
openat(AT_FDCWD, "/proc/cpuinfo", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(AT_FDCWD, "/root/.curlrc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/ssl/openssl.cnf", O_RDONLY|O_LARGEFILE) = 4
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = 4

Dann findet curl die certs auf dem Pi nicht… frag mich nicht warum.
Schau mal ob dir das weiterhilft: https://serverfault.com/questions/823815/curl-not-using-cert-from-etc-ssl-certs-ca-certificate-crt

Steht in deiner /etc/homegear/php.ini irgendwas bei [curl] oder bei [openssl]? Bei mir ist da alles auskommentiert - somit nutzt PHP von homegear den Systempfad… und da gibt es bei dir in node-blue ja Probleme.

Die sind auch bei mir auskommentiert.

Hmm… dann gehen mir die Ideen aus… kann mir wie gesagt nicht vorstellen, dass @sathya irgendwas im Homegear-Image deaktiviert hat.

Ich kann nochmals mit einer frischen Installation beginnen. Kannst du mir sagen, welches Image (woher) und welche Homegear Version ich verwenden soll?

https://github.com/codmpm/node-red-contrib-loxone/wiki/Anfänger%3A-Installation-RPi%2C-node-red%2C-nodes bis inkl. “Raspberry Pi Grundkonfiguration” und dann die nightly installieren, wie du es schon gemacht hast.

Danke für deine Hilfe @pmayer, dann will ich mal …

STÜNDEN SPÄTER …

In der Tat: nach der frischinstallation gemäss deiner Anleitung. Funktioniert der curl https://api.mcs3.miele.com/oauth/auth
Doch in Node-blue kann Miele nicht installiert werden:

-----------------------------------------------------------
2020-01-25T01:45:10.617Z Install : miele 1.0.0-1


-----------------------------------------------------------
2020-01-25T01:46:05.860Z Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Get:3 https://apt.node-blue.com/nightly/raspbian buster/ InRelease [5,375 B]
Err:3 https://apt.node-blue.com/nightly/raspbian buster/ InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 898BB4C44F646455
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
1 Like

Es scheint wie verhext: erst funzt die TLS Verbindung zu Miele nicht, dann nach der kompletten Neuistallation, funktioniert das zwar, dafür die TLS Verbindung zur Node-blue Palette nicht!!!

ARGH!

pi@raspberrypi:~ $ sudo apt-get update

ergibt:

Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease                
Get:3 https://apt.node-blue.com/nightly/raspbian buster/ InRelease [5,375 B]   
Err:3 https://apt.node-blue.com/nightly/raspbian buster/ InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 898BB4C44F646455
Reading package lists... Done
W: GPG error: https://apt.node-blue.com/nightly/raspbian buster/ InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 898BB4C44F646455
E: The repository 'https://apt.node-blue.com/nightly/raspbian buster/ InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Wie kann ich das Zertifikat für apt.node-blue.com nachinstallieren?

EDIT:
Habe den Key gefunden und nachinstalliert:

wget https://apt.node-blue.com/Release.key -O - | sudo apt-key add -

Immerhin funktioniert nun sudo apt-get update

Leider nix Neues!

Also ich kann Bestätigen, dass ich die Korrekten Credentials habe. Denn auf https://www.miele.com/developer/swagger-ui/index.html konnte ich erfolgreich auf die Maschine zugreifen und den Status abfragen.

In Node-blue passiert mit den gleichen Credentials leider nix. Ich bin unsicher, wass ich bei Country (de_CH oder de_DE oder en_US) und bei Language (laut API de oder en) eintragen soll. Dennoch liefert die Debug Node nix nach dem Deploy.

Hmm… event log?

@sathya, wer hat denn den Miele-Node entwickelt?

Sorry @pmayer hier noch das Eventlog:

2020-01-27T17:47:31.616Z Node 4553ee11.052378: Node is not fully configured.
2020-01-27T17:47:40.815Z Flows have been (re)started successfully.
2020-01-27T17:48:32.925Z Node 4553ee11.052378: Unknown error obtaining authorization code. E. g. server is not reachable.

Ok… ich müsste das jetzt debuggen. Habe aber kein Miele-Gerät und wahrscheinlich ist der urspüngliche Author da der bessere Ansprechpartnert.

Laut node-info müsste das @sathya sein.

Ich helfe gerne und “stelle” meine Waschmaschine zur Verfügung.

Wichtig scheint hier auch die korrekte Angabe des Landes unter “Country”. Denn meine Credentials funktionieren nur in der Schweiz. Wie finde ich heraus, welche Schreibweise das Feld “Country” erfordert?

06

PS: Wenn ich meine Credentials falsch eingebe, erscheint im Event log die selbe Fehlermeldung. Vielleicht kannst du so dennoch debuggen ?
Kann ich auch in der Konsole den Debugelevel hochschrauben, so wie in Homegear?

:star_struck:Halleluja, es funktioniert!!!
Country war falsch ausgefüllt! So funktionierts bei mir:
38

Es ist wichtig, dass alle Angaben korrekt eingefügt sind!

  1. Account bei Miele erstellen. Dabei ist die Länderauswahl später entscheidend und muss im Feld “Country” korrekt eingegeben werden. In meinem Fall (in der Schweiz) ch-ch.
  2. Auf der Miele App (Smartphone) die Geräte (in meinem Fall Waschmaschine) koppeln.
  3. Unter https://www.miele.com/developer/ API Credentials beantragen.
  4. In der Miele Node “Username” und “Password” (aus Punkt 1) und “Client ID” und “Client secret” (aus Schritt 3) sowie “Country” (aus Schritt 1) eingeben.

“Language” bestimmt, ob die Antworten vom Miele Server auf Deutsch (de) oder Englisch (en) zurück geschickt werden.

Weitere Infos:
Miele API: https://www.miele.com/developer/
Miele MQTT: https://github.com/oklona/Miele-MQTT

Wie immer herzlichen Dank an den ermüdungslosen Support von @pmayer und die Implementierung von @sathya!

Und hier noch die Payload von der Node:

$message : Object
object
payload: object
deviceName: ""
hash: "xxx"
serialNumber: "x"
state: object
ProgramID: object
dryingStep: object
elapsedTime: array[2]
light: 0
plateStep: array[0]
programPhase: object
programType: object
remainingTime: array[2]
remoteEnable: object
signalDoor: false
signalFailure: false
signalInfo: false
spinningSpeed: object
startTime: array[2]
status: object
targetTemperature: array[3]
temperature: array[3]
ventilationStep: object
typeId: 1
typeLabel: "Waschmaschine"
source: "xxx"

PS. So schaut es dann im Event log aus:

2020-01-27T18:08:24.436Z Flows have been (re)started successfully.
2020-01-27T18:09:18.077Z Node 4553ee11.052378: Successfully obtained access token.
3 Likes

Und damit ich der Community etwas zurückgeben kann. So sieht die gesamte Payload des Programmes “Maschine Reinigen” aus. laufzeit 33 Minuten.

Spannend wird wohl das Objekt remainingTime: array[2] sein. In 0: sind die Stunden und in 1: die Minuten. Das Programm dauert also noch 25 Minuten.

0: 0
1: 25


$message['payload'] : Object
object
deviceName: ""
hash: "xxx"
serialNumber: "000xxxxxxxxxxx"
state: object
ProgramID: object
key_localized: "Programmbezeichnung"
value_localized: "Maschine reinigen"
value_raw: 91
dryingStep: object
key_localized: "Trockenstufe"
value_localized: ""
value_raw: null
elapsedTime: array[2]
0: 0
1: 7
light: 0
plateStep: array[0]
programPhase: object
key_localized: "Programmphase"
value_localized: "Reinigen"
value_raw: 263
programType: object
key_localized: "Programmart"
value_localized: ""
value_raw: 4
remainingTime: array[2]
0: 0
1: 25
remoteEnable: object
fullRemoteControl: true
smartGrid: true
signalDoor: false
signalFailure: false
signalInfo: false
spinningSpeed: object
key_localized: "Schleuderdrehzahl"
unit: "U/min"
value_localized: "600"
value_raw: 600
startTime: array[2]
0: 0
1: 0
status: object
key_localized: "Status"
value_localized: "In Betrieb"
value_raw: 5
targetTemperature: array[3]
0: object
unit: "Celsius"
value_localized: 85
value_raw: 8500
1: object
unit: "Celsius"
value_localized: null
value_raw: -32768
2: object
unit: "Celsius"
value_localized: null
value_raw: -32768
temperature: array[3]
0: object
unit: "Celsius"
value_localized: null
value_raw: -32768
1: object
unit: "Celsius"
value_localized: null
value_raw: -32768
2: object
unit: "Celsius"
value_localized: null
value_raw: -32768
ventilationStep: object
key_localized: "Lüfterstufe"
value_localized: ""
value_raw: null
typeId: 1
typeLabel: "Waschmaschine"
2 Likes

Kann mir jemand helfen, wie ich die verbleibende Zeit als Payload rausfiltern kann?

Ic hversuchte es mit einer Change Node. Doch untenstehende Regel bring nur NULL.

Bildschirmfoto 2020-02-06 um 18.26.07

Gemäss https://nodered.org/docs/user-guide/messages zeigt Node-red Baloontips und lässt den Pfad eines Wertes kopieren, bei Node-blue wird mir dies leider nciht angezeigt.