Miele 3rd party API in FHEM einbinden

Begonnen von xerion, 16 Januar 2019, 22:26:52

Vorheriges Thema - Nächstes Thema

amenomade

Nach
ZitatPOST /oauth2/auth HTTP/1.0
Host: api.mcs3.miele.com
User-Agent: fhem
Accept-Encoding: gzip,deflate
Content-Length: 221
Content-Type: application/x-www-form-urlencoded

Soll folgendes zurückkommen:
Zitat2019.08.28 21:13:41 4: https://api.mcs3.miele.com/oauth/auth: HTTP response code 302
2019.08.28 21:13:41 5: HttpUtils https://api.mcs3.miele.com/oauth/auth: Got data, length: 0
2019.08.28 21:13:41 5: HttpUtils response header:
HTTP/1.1 302 Found

Date: Wed, 28 Aug 2019 19:13:41 GMT

Connection: close

Location: https://api.mcs3.miele.com/thirdparty/login/?code=DE_4ef03cdabd95bacexxxxxxxxxxxxxxxx&state=login

Access-Control-Allow-Origin: *

Access-Control-Allow-Credentials: true

Access-Control-Allow-Methods: PUT, GET, POST, OPTIONS

Du kriegst aber
Zitat2019.08.28 19:12:56 4: https://api.mcs3.miele.com/oauth2/auth: HTTP response code 401
2019.08.28 19:12:56 5: HttpUtils https://api.mcs3.miele.com/oauth2/auth: Got data, length: 21
2019.08.28 19:12:56 5: HttpUtils response header:
HTTP/1.1 401 Unauthorized

Also.... Zugangsdaten: clientID clientSecret email passwort, etwas stimmt nicht
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

volschin

Du hast laut Log den AuthRegex 500 drin, den hat Miele aber schon wieder gefixt. Wieder Unauthorized eintragen.
Intel NUC+Ubuntu 22.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 7590, Echo Dots+Show8, Logi Circle 2, HomeBridge
TIG Stack (Telegraf, InfluxDB, Grafana)

amenomade

Zitat von: volschin am 29 August 2019, 11:04:04
Du hast laut Log den AuthRegex 500 drin, den hat Miele aber schon wieder gefixt. Wieder Unauthorized eintragen.

Ne, das hat er schon korrigiert:
Zitat2019.08.28 19:12:54 5: Dunsthaube: CheckAuth is checking buffer with ReAuthRegex reAuthRegex 500.Internal.Server.Error|Unauthorized|default.backend...401
2019.08.28 19:12:54 4: Dunsthaube: CheckAuth decided new authentication required
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

alkazaa

OK, ich kann Erfolg melden:

NachdemreAuthRegex 500.Internal.Server.Error|Unauthorized|default.backend...401zunächst nichts gebracht hat, obwohl ich ALLE client_ID, client_secret, email, password mit Ctrl-C, Ctrl-V nochmal neu in die entsprechenden Attribute reingeschrieben hat, habe ich das device gelöscht und neu angelegt. Die attr-Blöcke aus dem "Fritz Muster" tutorial habe ch dazu in notepadd++ vorbereitet und als ganzes in der FHEM f18 GUI ausgeführt (zuvor hatte ich jeden attr Befehl einzeln abgesetzt, was natürlich die Fehlerwahrscheinlichkeit erhöht hatte).

Wie auch immer, jetzt bekomme ich beim Internal 'httpheader'
HTTP/1.1 200 OK
Date: Thu, 29 Aug 2019 16:57:43 GMT
Content-Type: application/json
Content-Length: 550
Connection: close
Vary: Accept-Encoding
Content-Encoding: gzip
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: PUT, GET, POST, OPTIONS
Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
Strict-Transport-Security: max-age=15724800; includeSubDomains



Warum es jetzt geht, da kann ich nur spekulieren: wenn ich es richtig erkannt habe, sorgt anemomades reAuthRegex dafür dass mehrere 'geduldige' retries bei der Anmeldung durchgeführt werden. Das könnte dazu passen, dass ich zur Zeit mit einem LTE-Router der Magenta-Firma arbeiten muss, da die Glasfaser zu meinem Haus von einem Bagger zerfressen wurde. Und die Datenrate mit dem LTE Teil ist arg langsam.

Danke nochmals, jetzt kann ich  mich im nächsten Schritt um die Definition der Readings kümmern.

Beste Grüße
Franz

deune

Hallo Franz,

der letzte Post ist schon etwas her, aber vielleicht bist Du auch irgendwie weiter gekommen.
Darf ich fragen, ob Du Deine Miele Geräte zufriedenstellend eingebunden hast und ob Du dies auch berichten würdest?

Ich stehe nun auch für zwei Geräten, die ich gerne einbinden würde.

Herzliche Grüße
Holger

xerion

Zitat von: deune am 14 April 2020, 07:15:54
Hallo Franz,

der letzte Post ist schon etwas her, aber vielleicht bist Du auch irgendwie weiter gekommen.
Darf ich fragen, ob Du Deine Miele Geräte zufriedenstellend eingebunden hast und ob Du dies auch berichten würdest?

Ich stehe nun auch für zwei Geräten, die ich gerne einbinden würde.

Herzliche Grüße
Holger
Hallo,

ich nutze die Anbindung noch nach wie vor für unsere Waschmaschine. Funktioniert also noch.


Gesendet von meinem JSN-L21 mit Tapatalk

Ich würde mich  freuen, wenn du meinen Einladungscode für Tibber, der Stromanbieter, der dir hilft, deinen Stromverbrauch zu verstehen und zu reduzieren, nutzt: https://invite.tibber.com/5fc08jbs. So bekommen wir beide 50 Euro und 100 % Ökostrom / https://geld-fuer-eauto.de/ref/334561880

Olaf

#126
Ich würde gerne unsere Spülmaschine einbinden, bekomme es aber leider bisher nicht hin.

Ich habe mich dabei an dieses Muster gehalten:
https://forum.fhem.de/index.php/topic,95989.msg915870.html#msg915870

Mittlerweile bekommt man den Developer Account, wenn man sich hier registriert (statt E-Mail an developer@miele.com): https://www.miele.com/f/com/en/register_api.aspx

Meine Definition sieht wie folgt aus:

defmod Spuelmaschine HTTPMOD https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de 120
attr Spuelmaschine reAuthRegex 500.Internal.Server.Error|Unauthorized|default.backend...401
attr Spuelmaschine requestHeader01 Authorization: Bearer $sid
attr Spuelmaschine requestHeader02 Content-Type: application/json
attr Spuelmaschine sid1URL  https://api.mcs3.miele.com/thirdparty/login/?response_type=code&state=login&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&scope=&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F
attr Spuelmaschine sid2Data email=xxxxxxx@xxxxxx.xxx&password=xxxxxxxxxxxxxxxx&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F&state=login&response_type=code&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&vgInformationSelector=de-DE
attr Spuelmaschine sid2IdRegex (?s)code=(DE_[0-9a-f]+)
attr Spuelmaschine sid2IgnoreRedirects 1
attr Spuelmaschine sid2URL https://api.mcs3.miele.com/oauth/auth
attr Spuelmaschine sid3Data grant_type=authorization_code&code=$sid&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&client_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
attr Spuelmaschine sid3IdJSON access_token
attr Spuelmaschine sid3URL https://api.mcs3.miele.com/thirdparty/token/
attr Spuelmaschine verbose 3
attr Spuelmaschine reading01Name remainigtime_h
attr Spuelmaschine reading01JSON state_remainingTime_0
attr Spuelmaschine reading02Name remainigtime_m
attr Spuelmaschine reading02JSON state_remainingTime_1
attr Spuelmaschine reading03Name elapsedtime_h
attr Spuelmaschine reading03JSON state_elapsedTime_0
attr Spuelmaschine reading04Name elapsedtime_m
attr Spuelmaschine reading04JSON state_elapsedTime_1
attr Spuelmaschine reading05Name spinningspeed
attr Spuelmaschine reading05JSON state_spinningSpeed
attr Spuelmaschine reading06Name state
attr Spuelmaschine reading06JSON state_status_value_raw
attr Spuelmaschine room EG Küche
attr Spuelmaschine alias Spülmaschine
attr Spuelmaschine group Geräte

define at_Spuelmaschine at +*00:02:00 {\
fhem "set Spuelmaschine reread";;\
if (ReadingsVal("Spuelmaschine", "state", 0)==4) {\
system("curl -X PUT \"https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/actions\" -H  \"accept: */*\" -H  \"Content-Type: application/json\" -H \"Authorization: Bearer ".InternalVal("Spuelmaschine","sid", "")."\" -d '{\"processAction\":1}' &")\
}\
}
attr at_Spuelmaschine room System
attr at_Spuelmaschine alias Spülmaschine auswerten
attr at_Spuelmaschine group Routinen


Zugangsdaten stimmen, d.h. ich kann mich in Miele@Mobile einloggen und sehe dort die Spülmaschine. Ich habe auch den Test gemacht und erhalte (nach dem Hinweis, dass ich die Zugangsdaten prüfen solle), eine URL mit DE_xxxxxx.

Mein Log sieht wie folgt aus:

2020.05.08 11:02:35 5 : Spuelmaschine: set called with reread
2020.05.08 11:02:35 5 : Spuelmaschine: GetUpdate called (reread)
2020.05.08 11:02:35 5 : Spuelmaschine: AddToQueue adds type update to URL https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de, no data, header Authorization: Bearer $sid Content-Type: application/json, retry 0, initial queue len: 0
2020.05.08 11:02:35 5 : Spuelmaschine: HandleSendQueue called, qlen = 1
2020.05.08 11:02:35 4 : Spuelmaschine: HandleSendQueue sends update with timeout 2 to https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de, No Data, header: Authorization: Bearer $sid Content-Type: application/json
2020.05.08 11:02:35 5 : HttpUtils url=https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de
2020.05.08 11:02:35 4 : IP: api.mcs3.miele.com -> 137.117.150.39
2020-05-08 11:02:35 HTTPMOD Spuelmaschine reread
2020-05-08 11:02:35 at at_Spuelmaschine Next: 11:04:35
2020.05.08 11:02:35 5 : HttpUtils request header: GET /v1/devices/00010xxxxxxx/?language=de HTTP/1.0 Host: api.mcs3.miele.com User-Agent: fhem Accept-Encoding: gzip,deflate Authorization: Bearer $sid Content-Type: application/json
2020.05.08 11:02:35 4 : https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de: HTTP response code 401
2020.05.08 11:02:35 5 : HttpUtils https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de: Got data, length: 21
2020.05.08 11:02:35 5 : HttpUtils response header: HTTP/1.1 401 Unauthorized Server: openresty/1.15.8.2 Date: Fri, 08 May 2020 09:02:35 GMT Content-Type: text/html Connection: close Strict-Transport-Security: max-age=15724800; includeSubDomains
2020.05.08 11:02:35 4 : Spuelmaschine: Read callback: request type was update retry 0, header: HTTP/1.1 401 Unauthorized Server: openresty/1.15.8.2 Date: Fri, 08 May 2020 09:02:35 GMT Content-Type: text/html Connection: close Strict-Transport-Security: max-age=15724800; includeSubDomains, body length 21
2020.05.08 11:02:35 5 : Spuelmaschine: Read callback: body default backend - 401
2020.05.08 11:02:35 4 : Spuelmaschine: Read found no charset header (bodyDecode was set to auto)
2020.05.08 11:02:35 3 : Spuelmaschine: error while parsing JSON data: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "default backend - 40...") at (eval 77776) line 1.
2020.05.08 11:02:35 5 : Spuelmaschine: GetCookies is looking for Cookies
2020.05.08 11:02:35 5 : Spuelmaschine: ExtractSid called, context reading, num
2020.05.08 11:02:35 4 : Spuelmaschine: checking for redirects, code=401, ignore=0
2020.05.08 11:02:35 4 : Spuelmaschine: no redirects to handle
2020.05.08 11:02:35 5 : Spuelmaschine: GetRegex found precompiled reAuthRegex for  as (?^:500.Internal.Server.Error|Unauthorized|default.backend...401)
2020.05.08 11:02:35 5 : Spuelmaschine: CheckAuth is checking buffer with ReAuthRegex (?^:500.Internal.Server.Error|Unauthorized|default.backend...401)
2020.05.08 11:02:35 4 : Spuelmaschine: CheckAuth decided new authentication required
2020.05.08 11:02:35 4 : Spuelmaschine: Auth called with Steps: 1 2 3
2020.05.08 11:02:35 5 : Spuelmaschine: AddToQueue prepends type auth3 to URL https://api.mcs3.miele.com/thirdparty/token/, data grant_type=authorization_code&code=$sid&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&client_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, no headers, retry 0, initial queue len: 0
2020.05.08 11:02:35 5 : Spuelmaschine: AddToQueue prepends type auth2 to URL https://api.mcs3.miele.com/oauth/auth, data email=xxxxxxx@xxxxxx.xxx&password=xxxxxxxxxxxxxxxx&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F&state=login&response_type=code&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&vgInformationSelector=de-DE, no headers, ignore redirects, retry 0, initial queue len: 1
2020.05.08 11:02:35 5 : Spuelmaschine: AddToQueue prepends type auth1 to URL https://api.mcs3.miele.com/thirdparty/login/?response_type=code&state=login&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&scope=&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F, no data, no headers, retry 0, initial queue len: 2
2020.05.08 11:02:35 5 : Spuelmaschine: HandleSendQueue called, qlen = 3
2020.05.08 11:02:35 5 : Spuelmaschine: HandleSendQueue - minSendDelay not over, rescheduling
2020.05.08 11:02:35 5 : Spuelmaschine: AddToQueue adds type update to URL https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de, no data, header Authorization: Bearer $sid Content-Type: application/json, retry 1, initial queue len: 3
2020.05.08 11:02:35 5 : Spuelmaschine: HandleSendQueue called, qlen = 4
2020.05.08 11:02:35 5 : Spuelmaschine: HandleSendQueue - minSendDelay not over, rescheduling
2020.05.08 11:02:35 4 : Spuelmaschine: CheckAuth requeued request update after auth, retryCount 0 ...
2020.05.08 11:02:36 5 : Spuelmaschine: HandleSendQueue called, qlen = 4
2020.05.08 11:02:36 4 : Spuelmaschine: HandleSendQueue sends auth1 with timeout 2 to https://api.mcs3.miele.com/thirdparty/login/?response_type=code&state=login&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&scope=&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F, No Data, No Header
2020.05.08 11:02:36 5 : HttpUtils url=https://api.mcs3.miele.com/thirdparty/login/?response_type=code&state=login&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&scope=&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F
2020.05.08 11:02:36 4 : IP: api.mcs3.miele.com -> 137.117.150.39
2020.05.08 11:02:37 5 : HttpUtils request header: GET /thirdparty/login/?response_type=code&state=login&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&scope=&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F HTTP/1.0 Host: api.mcs3.miele.com User-Agent: fhem Accept-Encoding: gzip,deflate
2020.05.08 11:02:37 4 : https://api.mcs3.miele.com/thirdparty/login/?response_type=code&state=login&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&scope=&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F: HTTP response code 200
2020.05.08 11:02:37 5 : HttpUtils https://api.mcs3.miele.com/thirdparty/login/?response_type=code&state=login&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&scope=&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F: Got data, length: 6383
2020.05.08 11:02:37 5 : HttpUtils response header: HTTP/1.1 200 OK Server: openresty/1.15.8.2 Date: Fri, 08 May 2020 09:02:37 GMT Content-Type: text/html Content-Length: 2223 Connection: close Strict-Transport-Security: max-age=15724800; includeSubDomains Vary: Accept-Encoding Content-Encoding: gzip Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: PUT, GET, POST, OPTIONS Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
2020.05.08 11:02:37 4 : Spuelmaschine: Read callback: request type was auth1 retry 0, header: HTTP/1.1 200 OK Server: openresty/1.15.8.2 Date: Fri, 08 May 2020 09:02:37 GMT Content-Type: text/html Content-Length: 2223 Connection: close Strict-Transport-Security: max-age=15724800; includeSubDomains Vary: Accept-Encoding Content-Encoding: gzip Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: PUT, GET, POST, OPTIONS Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization, body length 6383
2020.05.08 11:02:37 5 : Spuelmaschine: Read callback: body <html lang="de"> <head> <!--Let browser know website is optimized for mobile--> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta charset="utf-8"> <!-- Suppress favicon request--> <link rel="shortcut icon" type="image/x-icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABILAAASCwAAAAAAAAAAAAAUAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/EwCL/xMAjP8TAIv/EgCL/xIAi/8TAIv/EgCL/xMAi/8SAIv/EwCL/xIAi/8TAIv/FACM/xQAjP8UAIz/FwON/yYUlf8bCY//KBaW/ysZmP8tG5j/JhSV/y4dmf8mFJX/KxmX/ygVlv8tG5j/JxSV/xQAjP8UAIz/EwCM/x4Lkf+BdsH/nJPO/7Ot2v+aks7/s63a/6Wd0/+9t9//lo3M/7Wv2/+noNT/vbff/5mQzf8mFJX/EwCL/xMAjP8cCJD/qaLV/8C64P+9uN//mpLO/4+GyP9pXLX/hnvE/3Fluv+1rtv/iH/F/4B2wf9zaLv/HQqR/xMAjP8UAIz/FwOO/zMhm/8mFZX/JxaV/y0bmP8fDZL/FwWO/xIAi/8VBI3/MiCa/yIRk/8SAIv/EgCL/xMAjP8UAIz/FACM/xQAjP8SAIv/EwCL/xMAi/8SAIv/EwCM/xQAjP8UAIz/FACM/xIAi/8TAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="> <!--Import Google Icon Font--> <!--Import materialize.css--> <!--Import own css--> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link rel="stylesheet" href="/assets/css/materialize.min.css?1556550173384"> <link type="text/css" rel="stylesheet" href="/assets/css/mieleStyle.css?1556550173387" media="screen,projection"/> <!-- Import scrips --> <!-- Compiled and minified JavaScript --> <script src="/assets/js/materialize.min.js?1556550173386"></script> <!--Hotfix for selection error on IOS 13, see MIELCLD3-4504--> <script src="/assets/js/selectHotfix.js"></script> <script> document.addEventListener('DOMContentLoaded', function () { M.FormSelect.init(document.querySelectorAll('select')); }); </script> </head> <body id="mieleLoginSite"> <div class="container"> <div class="row"> <div class="col s12 m8 offset-m2 offset-l2 l8"> <div class="center"> <img class="responsive-img" src="/assets/images/miele_logo.svg" width="150" alt="miele.com"/> </div> <h1 class="center mediumFont">Login</h1> <form method="post" action="/oauth/auth"> <div class="input-field"> <i class="material-icons prefix">account_circle</i> <input required id="e-mail" type="email" name="email"> <label for="e-mail">Email Address</label> </div> <div class="input-field"> <i class="material-icons prefix">https</i> <input required id="password" type="password" name="password"> <label for="password">Password</label> </div> <!-- add here all hidden inputs --> <input type="hidden" name="response_type" value="code"> <input type="hidden" name="redirect_uri" value="https://api.mcs3.miele.com/thirdparty/login/"> <input type="hidden" name="state" value="login"> <input type="hidden" name="client_id" value="0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx"> <div class="input-field" style="margin-top: 25px;"> <i class="material-icons prefix no-margin">language</i> <select required name="vgInformationSelector" size="5"> <option value="" disabled>Please select your country</option> <option value="en-AU">Miele Australia</option> <option value="nl-BE">Miele België</option> <option value="en-CA">Miele Canada</option> <option value="es-CL">Miele Chile</option> <option value="hr-HR">Miele Croatia</option> <option value="cs-CZ">Miele Czechia</option> <option value="da-DK">Miele Danmark</option> <option value="de-DE">Miele Deutschland</option> <option value="et-EE">Miele Eesti</option> <option value="es-ES">Miele España</option> <option value="fr-FR">Miele France</option> <option value="ko-KR">Miele Hanguk</option> <option value="zh-HK">Miele Hong Kong</option> <option value="en-IE">Miele Ireland</option> <option value="en-IL">Miele Israel</option> <option value="it-IT">Miele Italia</option> <option value="el-CY">Miele Kypros</option> <option value="lv-LV">Miele Latvija</option> <option value="lt-LT">Miele Lietuva</option> <option value="de-LU">Miele Luxemburg</option> <option value="hu-HU">Miele Magyarország</option> <option value="en-MY">Miele Malaysia</option> <option value="es-MX">Miele México</option> <option value="nl-NL">Miele Nederland</option> <option value="en-NZ">Miele New Zealand</option> <option value="ja-JP">Miele Nihon</option> <option value="no-NO">Miele Norge</option> <option value="pl-PL">Miele Polska</option> <option value="pt-PT">Miele Portugual</option> <option value="ro-RO">Miele România</option> <option value="de-CH">Miele Schweiz</option> <option value="en-SG">Miele Singapore</option> <option value="sl-SI">Miele Slovenia</option> <option value="sk-SK">Miele Slovensko</option> <option value="en-ZA">Miele South Africa</option> <option value="fi-FI">Miele Suomi</option> <option value="sv-SE">Miele Sverige</option> <option value="en-TH">Miele Thailand</option> <option value="tr-TR">Miele Türkiye</option> <option value="en-GB">Miele UK</option> <option value="en-US">Miele USA</option> <option value="en-AE">Miele United Arab Emirates</option> <option value="zh-CN">Miele Zhōngguó</option> <option value="de-AT">Miele Österreich</option> <option value="el-GR">Miele Ελλάδα</option> <option value="ru-BY">Miele Беларуси</option> <option value="bg-BG">Miele България</option> <option value="ru-KZ">Miele Казахстан</option> <option value="ru-RU">Miele Россия</option> <option value="sr-RS">Miele Србија</option> <option value="ru-UA">Miele Україна</option> </select> <label>Country</label> </div> <div class="center"> <button class="btn waves-effect waves-light miele-red" type="submit">Submit</button> </div> </form> </div> </div> </div> </body> </html>
2020.05.08 11:02:37 4 : Spuelmaschine: Read found no charset header (bodyDecode was set to auto)
2020.05.08 11:02:37 3 : Spuelmaschine: error while parsing JSON data: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "<html lang="de">\n<h...") at (eval 77778) line 1.
2020.05.08 11:02:37 5 : Spuelmaschine: GetCookies is looking for Cookies
2020.05.08 11:02:37 5 : Spuelmaschine: ExtractSid called, context sid, num 1
2020.05.08 11:02:37 4 : Spuelmaschine: checking for redirects, code=200, ignore=0
2020.05.08 11:02:37 4 : Spuelmaschine: no redirects to handle
2020.05.08 11:02:37 5 : Spuelmaschine: HandleSendQueue called, qlen = 3
2020.05.08 11:02:37 4 : Spuelmaschine: HandleSendQueue sends auth2 with timeout 2 to https://api.mcs3.miele.com/oauth/auth, data: email=xxxxxxx@xxxxxx.xxx&password=xxxxxxxxxxxxxxxx&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F&state=login&response_type=code&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&vgInformationSelector=de-DE, No Header
2020.05.08 11:02:37 5 : HttpUtils url=https://api.mcs3.miele.com/oauth/auth
2020.05.08 11:02:37 4 : IP: api.mcs3.miele.com -> 137.117.150.39
2020.05.08 11:02:38 5 : HttpUtils request header: POST /oauth/auth HTTP/1.0 Host: api.mcs3.miele.com User-Agent: fhem Accept-Encoding: gzip,deflate Content-Length: 219 Content-Type: application/x-www-form-urlencoded
2020.05.08 11:02:38 4 : https://api.mcs3.miele.com/oauth/auth: HTTP response code 200
2020.05.08 11:02:38 5 : HttpUtils https://api.mcs3.miele.com/oauth/auth: Got data, length: 4618
2020.05.08 11:02:38 5 : HttpUtils response header: HTTP/1.1 200 OK Server: openresty/1.15.8.2 Date: Fri, 08 May 2020 09:02:38 GMT Content-Type: text/plain Content-Length: 4618 Connection: close Vary: Accept-Encoding Strict-Transport-Security: max-age=15724800; includeSubDomains Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: PUT, GET, POST, OPTIONS Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
2020.05.08 11:02:38 4 : Spuelmaschine: Read callback: request type was auth2 retry 0, header: HTTP/1.1 200 OK Server: openresty/1.15.8.2 Date: Fri, 08 May 2020 09:02:38 GMT Content-Type: text/plain Content-Length: 4618 Connection: close Vary: Accept-Encoding Strict-Transport-Security: max-age=15724800; includeSubDomains Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: PUT, GET, POST, OPTIONS Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization, body length 4618
2020.05.08 11:02:38 5 : Spuelmaschine: Read callback: body <html lang="de"> <head> <!--Import Google Icon Font--> <!--Import materialize.css--> <!--Import own css--> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link type="text/css" rel="stylesheet" href="/assets/css/materialize.min.css" media="screen,projection"/> <link type="text/css" rel="stylesheet" href="/assets/css/mieleStyle.css" media="screen,projection"/> <!-- Suppress favicon request--> <link rel="shortcut icon" type="image/x-icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABILAAASCwAAAAAAAAAAAAAUAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/EwCL/xMAjP8TAIv/EgCL/xIAi/8TAIv/EgCL/xMAi/8SAIv/EwCL/xIAi/8TAIv/FACM/xQAjP8UAIz/FwON/yYUlf8bCY//KBaW/ysZmP8tG5j/JhSV/y4dmf8mFJX/KxmX/ygVlv8tG5j/JxSV/xQAjP8UAIz/EwCM/x4Lkf+BdsH/nJPO/7Ot2v+aks7/s63a/6Wd0/+9t9//lo3M/7Wv2/+noNT/vbff/5mQzf8mFJX/EwCL/xMAjP8cCJD/qaLV/8C64P+9uN//mpLO/4+GyP9pXLX/hnvE/3Fluv+1rtv/iH/F/4B2wf9zaLv/HQqR/xMAjP8UAIz/FwOO/zMhm/8mFZX/JxaV/y0bmP8fDZL/FwWO/xIAi/8VBI3/MiCa/yIRk/8SAIv/EgCL/xMAjP8UAIz/FACM/xQAjP8SAIv/EwCL/xMAi/8SAIv/EwCM/xQAjP8UAIz/FACM/xIAi/8TAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/FACM/xQAjP8UAIz/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="> <!--Let browser know website is optimized for mobile--> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta charset="utf-8"> </head> <body id="mieleLoginSite"> <div class="container"> <div class="row"> <div class="col s12 m8 offset-m2 offset-l2 l8"> <div class="center"> <img class="responsive-img" src="/assets/images/miele_logo.svg" width="150" alt="miele.com"/> </div> <h1 class="center mediumFont">Zugriff erteilen</h1> <div class="center mediumFont smaller">Die Anwendung FHEM möchte auf Ihre Gerätedaten zugreifen:</div> </div> </div> <div class="row"> <div class="col s12 m8 offset-m2 offset-l3 l6"> <ul> <li class="center">Funktionsmerkmale Ihrer Miele-Geräte</li> <li class="center">Gerätenutzungsdaten Ihrer Miele-Geräte</li> <li class="center">Gerätezustandsdaten Ihrer Miele-Geräte</li> <li class="center">Steuerung Ihrer Miele-Geräte</li> </ul> </div> </div> <div class="row"> <div class="col s12 m8 offset-m2 offset-l3 l6"> <p class="center"> Der Zugriff auf die o.g. Daten ist erforderlich, damit die Anwendung Ihnen Ihre vernetzten Miele-Geräte sowie deren Status- und Geräteinformationen anzeigen kann. Mit Ihrer Einwilligung erlauben Sie der Anwendung Zugriff auf Ihre Daten. Sie können Ihre Einwilligung jederzeit widerrufen. Ihren Widerruf richten Sie bitte mit dem Betreff ,,Revoke Consent" an <a href="mailto:developer@miele.com?subject=Revoke%20Consent&body=Hereby%20I%20would%20like%20to%20revoke%20my%20consent%20for%20the%20client%200a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx%20and%20the%20user%20account%20mertgen%40gmx.net.">developer@miele.com</a> . Weitere Informationen zu der Datenverarbeitung durch Miele, insbesondere zu Ihren Rechten als Betroffener, können Sie der <a href="http://www.miele.de/datenschutz">Miele Datenschutzerklärung</a> entnehmen. Für die Nutzung der Anwendung beachten Sie bitte die Nutzungs- und Datenschutzbestimmungen von FHEM. </p> <div class="center"> <form class="hidden" method="get" action="https://api.mcs3.miele.com/thirdparty/login/"> <input type="hidden" name="code" value="DE_3b84a2dfb559f792aba68f93e6864294"> <input type="hidden" name="state" value="login"> <input id="button" class="waves-effect waves-light btn miele-red" type="submit" value="ZULASSEN"> </form> <form class="hidden" method="get" action="https://api.mcs3.miele.com/thirdparty/login/"> <input type="hidden" name="error" value="access_denied"> <input id="button" class="waves-effect waves-light btn miele-gray" type="submit" value="ABBRECHEN"> </form> </div> </div> </div> </div> </body> </html>
2020.05.08 11:02:38 4 : Spuelmaschine: Read found no charset header (bodyDecode was set to auto)
2020.05.08 11:02:38 3 : Spuelmaschine: error while parsing JSON data: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "<html lang="de">\n<h...") at (eval 77780) line 1.
2020.05.08 11:02:38 5 : Spuelmaschine: GetCookies is looking for Cookies
2020.05.08 11:02:38 5 : Spuelmaschine: ExtractSid called, context sid, num 2
2020.05.08 11:02:38 5 : Spuelmaschine: GetRegex found precompiled IdRegex for sid2 as (?^:(?s)code=(DE_[0-9a-f]+))
2020.05.08 11:02:38 5 : Spuelmaschine: ExtractSid could not match buffer to IdRegex (?^:(?s)code=(DE_[0-9a-f]+))
2020.05.08 11:02:38 4 : Spuelmaschine: checking for redirects, code=200, ignore=1
2020.05.08 11:02:38 4 : Spuelmaschine: no redirects to handle
2020.05.08 11:02:39 5 : Spuelmaschine: HandleSendQueue called, qlen = 2
2020.05.08 11:02:39 4 : Spuelmaschine: HandleSendQueue sends auth3 with timeout 2 to https://api.mcs3.miele.com/thirdparty/token/, data: grant_type=authorization_code&code=$sid&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&client_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, No Header
2020.05.08 11:02:39 5 : HttpUtils url=https://api.mcs3.miele.com/thirdparty/token/
2020.05.08 11:02:39 4 : IP: api.mcs3.miele.com -> 137.117.150.39
2020.05.08 11:02:39 5 : HttpUtils request header: POST /thirdparty/token/ HTTP/1.0 Host: api.mcs3.miele.com User-Agent: fhem Accept-Encoding: gzip,deflate Content-Length: 203 Content-Type: application/x-www-form-urlencoded
2020.05.08 11:02:39 4 : https://api.mcs3.miele.com/thirdparty/token/: HTTP response code 500
2020.05.08 11:02:39 5 : HttpUtils https://api.mcs3.miele.com/thirdparty/token/: Got data, length: 42
2020.05.08 11:02:39 5 : HttpUtils response header: HTTP/1.1 500 Internal Server Error Server: openresty/1.15.8.2 Date: Fri, 08 May 2020 09:02:39 GMT Content-Type: text/plain Content-Length: 42 Connection: close Strict-Transport-Security: max-age=15724800; includeSubDomains Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: PUT, GET, POST, OPTIONS Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
2020.05.08 11:02:39 4 : Spuelmaschine: Read callback: request type was auth3 retry 0, header: HTTP/1.1 500 Internal Server Error Server: openresty/1.15.8.2 Date: Fri, 08 May 2020 09:02:39 GMT Content-Type: text/plain Content-Length: 42 Connection: close Strict-Transport-Security: max-age=15724800; includeSubDomains Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: PUT, GET, POST, OPTIONS Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization, body length 42
2020.05.08 11:02:39 5 : Spuelmaschine: Read callback: body no vg given. grant_type=AUTHORIZATION_CODE
2020.05.08 11:02:39 4 : Spuelmaschine: Read found no charset header (bodyDecode was set to auto)
2020.05.08 11:02:39 3 : Spuelmaschine: error while parsing JSON data: 'null' expected, at character offset 0 (before "no vg given. grant_t...") at (eval 77785) line 1.
2020.05.08 11:02:39 5 : Spuelmaschine: GetCookies is looking for Cookies
2020.05.08 11:02:39 5 : Spuelmaschine: ExtractSid called, context sid, num 3
2020.05.08 11:02:39 5 : Spuelmaschine: Checking SID with JSON access_token
2020.05.08 11:02:39 4 : Spuelmaschine: checking for redirects, code=500, ignore=0
2020.05.08 11:02:39 4 : Spuelmaschine: no redirects to handle
2020.05.08 11:02:40 5 : Spuelmaschine: HandleSendQueue called, qlen = 1
2020.05.08 11:02:40 4 : Spuelmaschine: HandleSendQueue sends update with timeout 2 to https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de, No Data, header: Authorization: Bearer $sid Content-Type: application/json
2020.05.08 11:02:40 5 : HttpUtils url=https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de
2020.05.08 11:02:40 4 : IP: api.mcs3.miele.com -> 137.117.150.39
2020.05.08 11:02:40 5 : HttpUtils request header: GET /v1/devices/00010xxxxxxx/?language=de HTTP/1.0 Host: api.mcs3.miele.com User-Agent: fhem Accept-Encoding: gzip,deflate Authorization: Bearer $sid Content-Type: application/json
2020.05.08 11:02:40 4 : https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de: HTTP response code 401
2020.05.08 11:02:40 5 : HttpUtils https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de: Got data, length: 21
2020.05.08 11:02:40 5 : HttpUtils response header: HTTP/1.1 401 Unauthorized Server: openresty/1.15.8.2 Date: Fri, 08 May 2020 09:02:40 GMT Content-Type: text/html Connection: close Strict-Transport-Security: max-age=15724800; includeSubDomains
2020.05.08 11:02:40 4 : Spuelmaschine: Read callback: request type was update retry 1, header: HTTP/1.1 401 Unauthorized Server: openresty/1.15.8.2 Date: Fri, 08 May 2020 09:02:40 GMT Content-Type: text/html Connection: close Strict-Transport-Security: max-age=15724800; includeSubDomains, body length 21
2020.05.08 11:02:40 5 : Spuelmaschine: Read callback: body default backend - 401
2020.05.08 11:02:40 4 : Spuelmaschine: Read found no charset header (bodyDecode was set to auto)
2020.05.08 11:02:40 3 : Spuelmaschine: error while parsing JSON data: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "default backend - 40...") at (eval 77787) line 1.
2020.05.08 11:02:40 5 : Spuelmaschine: GetCookies is looking for Cookies
2020.05.08 11:02:40 5 : Spuelmaschine: ExtractSid called, context reading, num
2020.05.08 11:02:40 4 : Spuelmaschine: checking for redirects, code=401, ignore=0
2020.05.08 11:02:40 4 : Spuelmaschine: no redirects to handle
2020.05.08 11:02:40 5 : Spuelmaschine: GetRegex found precompiled reAuthRegex for  as (?^:500.Internal.Server.Error|Unauthorized|default.backend...401)
2020.05.08 11:02:40 5 : Spuelmaschine: CheckAuth is checking buffer with ReAuthRegex (?^:500.Internal.Server.Error|Unauthorized|default.backend...401)
2020.05.08 11:02:40 4 : Spuelmaschine: CheckAuth decided new authentication required
2020.05.08 11:02:40 4 : Spuelmaschine: Authentication still required but no retries left - did last authentication fail?
2020.05.08 11:02:40 5 : Spuelmaschine: Read starts parsing response to update with defined readings: 01,02,03,04,05,06
2020.05.08 11:02:40 5 : Spuelmaschine: ExtractReading remainigtime_h with json state_remainingTime_0 ...
2020.05.08 11:02:40 5 : Spuelmaschine: ExtractReading remainigtime_h did not match
2020.05.08 11:02:40 5 : Spuelmaschine: ExtractReading remainigtime_m with json state_remainingTime_1 ...
2020.05.08 11:02:40 5 : Spuelmaschine: ExtractReading remainigtime_m did not match
2020.05.08 11:02:40 5 : Spuelmaschine: ExtractReading elapsedtime_h with json state_elapsedTime_0 ...
2020.05.08 11:02:40 5 : Spuelmaschine: ExtractReading elapsedtime_h did not match
2020.05.08 11:02:40 5 : Spuelmaschine: ExtractReading elapsedtime_m with json state_elapsedTime_1 ...
2020.05.08 11:02:40 5 : Spuelmaschine: ExtractReading elapsedtime_m did not match
2020.05.08 11:02:40 5 : Spuelmaschine: ExtractReading spinningspeed with json state_spinningSpeed ...
2020.05.08 11:02:40 5 : Spuelmaschine: ExtractReading spinningspeed did not match
2020.05.08 11:02:40 5 : Spuelmaschine: ExtractReading state with json state_status_value_raw ...
2020.05.08 11:02:40 5 : Spuelmaschine: ExtractReading state did not match
2020.05.08 11:02:40 4 : Spuelmaschine: Read response to update didn't match any Reading
2020.05.08 11:02:40 5 : Spuelmaschine: HandleSendQueue called, qlen = 0
2020.05.08 11:02:41 5 : Spuelmaschine: GetUpdate called (update)
2020.05.08 11:02:41 5 : Spuelmaschine: update timer modified: will call GetUpdate in 120.0 seconds at 2020-05-08 11:04:41
2020.05.08 11:02:41 5 : Spuelmaschine: AddToQueue adds type update to URL https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de, no data, header Authorization: Bearer $sid Content-Type: application/json, retry 0, initial queue len: 0
2020.05.08 11:02:41 5 : Spuelmaschine: HandleSendQueue called, qlen = 1
2020.05.08 11:02:41 4 : Spuelmaschine: HandleSendQueue sends update with timeout 2 to https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de, No Data, header: Authorization: Bearer $sid Content-Type: application/json
2020.05.08 11:02:41 5 : HttpUtils url=https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de
2020.05.08 11:02:41 4 : IP: api.mcs3.miele.com -> 137.117.150.39
2020.05.08 11:02:41 5 : HttpUtils request header: GET /v1/devices/00010xxxxxxx/?language=de HTTP/1.0 Host: api.mcs3.miele.com User-Agent: fhem Accept-Encoding: gzip,deflate Authorization: Bearer $sid Content-Type: application/json
2020.05.08 11:02:41 4 : https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de: HTTP response code 401
2020.05.08 11:02:41 5 : HttpUtils https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de: Got data, length: 21
2020.05.08 11:02:41 5 : HttpUtils response header: HTTP/1.1 401 Unauthorized Server: openresty/1.15.8.2 Date: Fri, 08 May 2020 09:02:41 GMT Content-Type: text/html Connection: close Strict-Transport-Security: max-age=15724800; includeSubDomains
2020.05.08 11:02:41 4 : Spuelmaschine: Read callback: request type was update retry 0, header: HTTP/1.1 401 Unauthorized Server: openresty/1.15.8.2 Date: Fri, 08 May 2020 09:02:41 GMT Content-Type: text/html Connection: close Strict-Transport-Security: max-age=15724800; includeSubDomains, body length 21
2020.05.08 11:02:41 5 : Spuelmaschine: Read callback: body default backend - 401
2020.05.08 11:02:41 4 : Spuelmaschine: Read found no charset header (bodyDecode was set to auto)
2020.05.08 11:02:41 3 : Spuelmaschine: error while parsing JSON data: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "default backend - 40...") at (eval 77789) line 1.
...


Das Device sieht aktuell wie folgt aus:

Internals:
   BUSY       0
   CFGFN      /opt/fhem/mycfg/59_miele.cfg
   DEF        https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de 120
   FUUID      5eb5004b-f33f-2e30-9838-a1752f1d0e1e88e2
   Interval   120
   JSONEnabled 1
   LASTSEND   1588932406.11815
   LastAuthTry 2020-05-08 12:06:42
   MainURL    https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de
   ModuleVersion 3.5.22 - 7.2.2020
   NAME       Spuelmaschine
   NOTIFYDEV  global
   NR         1014
   NTFY_ORDER 50-Spuelmaschine
   STATE      ???
   TRIGGERTIME 1588932521.9524
   TRIGGERTIME_FMT 2020-05-08 12:08:41
   TYPE       HTTPMOD
   addr       https://api.mcs3.miele.com:443
   auth       0
   code       401
   compress   1
   conn       
   data       
   displayurl https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de
   header     Authorization: Bearer $sid
Content-Type: application/json
   host       api.mcs3.miele.com
   httpheader HTTP/1.1 401 Unauthorized
Server: openresty/1.15.8.2
Date: Fri, 08 May 2020 10:06:46 GMT
Content-Type: text/html
Connection: close
Strict-Transport-Security: max-age=15724800; includeSubDomains
   httpversion 1.0
   hu_blocking 0
   hu_filecount 1015
   hu_port    443
   hu_portSfx
   ignoreredirects 1
   loglevel   4
   path       /v1/devices/00010xxxxxxx/?language=de
   protocol   https
   redirects  0
   timeout    2
   url        https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de
   value      0
   CompiledRegexes:
   QUEUE:
   READINGS:
   REQUEST:
     data       
     header     Authorization: Bearer $sid
Content-Type: application/json
     ignoreredirects 0
     retryCount 1
     type       update
     url        https://api.mcs3.miele.com/v1/devices/00010xxxxxxx/?language=de
     value      0
   sslargs:
Attributes:
   alias      Spülmaschine
   group      Geräte
   reAuthRegex 500.Internal.Server.Error|Unauthorized|default.backend...401
   reading01JSON state_remainingTime_0
   reading01Name remainigtime_h
   reading02JSON state_remainingTime_1
   reading02Name remainigtime_m
   reading03JSON state_elapsedTime_0
   reading03Name elapsedtime_h
   reading04JSON state_elapsedTime_1
   reading04Name elapsedtime_m
   reading05JSON state_spinningSpeed
   reading05Name spinningspeed
   reading06JSON state_status_value_raw
   reading06Name state
   requestHeader01 Authorization: Bearer $sid
   requestHeader02 Content-Type: application/json
   room       EG Küche
   sid1URL    https://api.mcs3.miele.com/thirdparty/login/?response_type=code&state=login&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&scope=&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F
   sid2Data   email=xxxxxxx@xxxxxx.xxx&password=xxxxxxxxxxxxxxxx&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F&state=login&response_type=code&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&vgInformationSelector=de-DE
   sid2IdRegex (?s)code=(DE_[0-9a-f]+)
   sid2IgnoreRedirects 1
   sid2URL    https://api.mcs3.miele.com/oauth/auth
   sid3Data   grant_type=authorization_code&code=$sid&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F&client_id=0a9a9061-f42a-xxxx-xxxx-xxxxxxxxxxxx&client_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   sid3IdJSON access_token
   sid3URL    https://api.mcs3.miele.com/thirdparty/token/
   userattr   reading01JSON reading01Name reading02JSON reading02Name reading03JSON reading03Name reading04JSON reading04Name reading05JSON reading05Name reading06JSON reading06Name requestHeader01 requestHeader02 sid1URL sid2Data sid2IdRegex sid2IgnoreRedirects:0,1 sid2URL sid3Data sid3IdJSON sid3URL
   verbose    5


Ich bin wie immer für jeden Tipp dankbar.

VG, Olaf

amenomade

#127
Zitat2020.05.08 11:02:38 5 : Spuelmaschine: GetRegex found precompiled IdRegex for sid2 as (?^:(?s)code=(DE_[0-9a-f]+))
2020.05.08 11:02:38 5 : Spuelmaschine: ExtractSid could not match buffer to IdRegex (?^:(?s)code=(DE_[0-9a-f]+))
Er findet den Token nicht.

Wenn Du in einem Browser folgendes eingibst:
https://api.mcs3.miele.com/thirdparty/login/?client_id=zzzDEIN_CLIENTIDzzzz&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F&state=login&response_type=codeund dich dort anmeldest, was kommt zurück als WeiterleitungsURL?

EDIT: Es kann sein, dass die API sich geändert hat, weil:
Zitat2020.05.08 11:02:38 5 : Spuelmaschine: Read callback: body  (...)  value="DE_3b84a2dfb559f792aba68f93e6864294"> <input type="hidden" (...)
Da ist der Token
Versuche mit:
sid2IdRegex (?s)value="(DE_[0-9a-f]+)
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Olaf

Das
sid2IdRegex (?s)value="(DE_[0-9a-f]+)
hat es gebracht.

Jetzt bekomme ich als httpheader:

HTTP/1.1 200 OK
Server: openresty/1.15.8.2
Date: Sun, 10 May 2020 16:23:51 GMT
Content-Type: application/json
Content-Length: 584
Connection: close
Strict-Transport-Security: max-age=15724800; includeSubDomains
access-control-allow-credentials: true
access-control-allow-headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
access-control-allow-methods: PUT, GET, POST, OPTIONS
access-control-allow-origin: *
Content-Encoding: gzip
Strict-Transport-Security: max-age=15724800; includeSubDomains
Vary: Accept-Encoding


Vielen Dank!

choenig

Hi,

ich habe schon vor geraumer Zeit ein Modul für die Miele 3rd-Party Cloud API geschrieben. Jetzt habe ich das Modul veröffentlich (Ist noch im Beta-Stadium, Benutzung auf eigene Gefahr).

Wer es mal testen möchte, kann hier mal vorbeischauen :)

https://forum.fhem.de/index.php/topic,112114.0.html

LG
Christian

speedAmaster

#130
Hallo,
ich wollte mich an meiner Miele Waschmaschine versuchen - macht mit meiner PV jetzt wirklich Sinn.
Leider bekomme ich sonderbare Fehler.

Ich habe mich bei Miele angemeldet und habe meine ClientID und ClientSecret erhalten, email und PW funktionieren.
Mein CFG sieht die folgt aus:
defmod Waschmaschine HTTPMOD https://api.mcs3.miele.com/v1/devices/000148773697/?language=de 120
attr Waschmaschine room Technik
attr Waschmaschine enableControlSet 1
attr Waschmaschine reAuthRegex 500.Internal.Server.Error|Unauthorized|default.backend...401
attr Waschmaschine requestHeader01 Authorization: Bearer $sid
attr Waschmaschine requestHeader02 Content-Type: application/json
attr Waschmaschine sid1URL  https://api.mcs3.miele.com/thirdparty/login/?response_type=code&state=login&client_id=7c5ab07d-xxxx&scope=&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F
attr Waschmaschine sid2Data email=a@b.de&password=enthält_ein_!&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F&state=login&response_type=code&client_id=7c5ab07d-xxxx&vgInformationSelector=de-DE
attr Waschmaschine sid2IdRegex (?s)code=(DE_[0-9a-f]+)
attr Waschmaschine sid2IgnoreRedirects 1
attr Waschmaschine sid2URL https://api.mcs3.miele.com/oauth/auth
attr Waschmaschine sid3Data grant_type=authorization_code&code=$sid&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F&client_id=7c5ab07d-xxxx&client_secret=yyyy
attr Waschmaschine sid3IdJSON access_token
attr Waschmaschine sid3URL https://api.mcs3.miele.com/thirdparty/token/
attr Waschmaschine verbose 5
attr Waschmaschine icon scene_washing_machine


Ich habe mal den ersten Link in meinen Browser eingegeben
https://api.mcs3.miele.com/thirdparty/login/?response_type=code&state=login&client_id=7c5ab07d-xxxx&scope=&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F
erhalte dann eine LOGIN Seite (in welche ich mich einlogge), erhalte dann
Zugriff erteilen
Die Anwendung FHEM möchte auf Ihre Gerätedaten zugreifen:

    Funktionsmerkmale Ihrer Miele-Geräte
    Gerätenutzungsdaten Ihrer Miele-Geräte
    Gerätezustandsdaten Ihrer Miele-Geräte
    Steuerung Ihrer Miele-Geräte

wo ich dann "Zustimme"
erhalte dann im Browser
Kontoverknüpfung fehlgeschlagen! Bitte überprüfen Sie ihre Zugangsdaten.
{"code":405,"message":"HTTP 405 Method Not Allowed"}

im FHEM selbst erhalte ich
HTTP/1.1 401 Unauthorized
Date: Mon, 19 Oct 2020 10:26:55 GMT
Content-Type: text/html
Connection: close
Strict-Transport-Security: max-age=15724800; includeSubDomains


woran könnte dies denn liegen? an meinem "!" im Passwort?

xerion

Zitat von: speedAmaster am 19 Oktober 2020, 12:27:54
Hallo,
ich wollte mich an meiner Miele Waschmaschine versuchen - macht mit meiner PV jetzt wirklich Sinn.
Leider bekomme ich sonderbare Fehler.

Ich habe mich bei Miele angemeldet und habe meine ClientID und ClientSecret erhalten, email und PW funktionieren.
Mein CFG sieht die folgt aus:
defmod Waschmaschine HTTPMOD https://api.mcs3.miele.com/v1/devices/000148773697/?language=de 120
attr Waschmaschine room Technik
attr Waschmaschine enableControlSet 1
attr Waschmaschine reAuthRegex 500.Internal.Server.Error|Unauthorized|default.backend...401
attr Waschmaschine requestHeader01 Authorization: Bearer $sid
attr Waschmaschine requestHeader02 Content-Type: application/json
attr Waschmaschine sid1URL  https://api.mcs3.miele.com/thirdparty/login/?response_type=code&state=login&client_id=7c5ab07d-xxxx&scope=&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F
attr Waschmaschine sid2Data email=a@b.de&password=enthält_ein_!&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F&state=login&response_type=code&client_id=7c5ab07d-xxxx&vgInformationSelector=de-DE
attr Waschmaschine sid2IdRegex (?s)code=(DE_[0-9a-f]+)
attr Waschmaschine sid2IgnoreRedirects 1
attr Waschmaschine sid2URL https://api.mcs3.miele.com/oauth/auth
attr Waschmaschine sid3Data grant_type=authorization_code&code=$sid&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F&client_id=7c5ab07d-xxxx&client_secret=yyyy
attr Waschmaschine sid3IdJSON access_token
attr Waschmaschine sid3URL https://api.mcs3.miele.com/thirdparty/token/
attr Waschmaschine verbose 5
attr Waschmaschine icon scene_washing_machine


Ich habe mal den ersten Link in meinen Browser eingegeben
https://api.mcs3.miele.com/thirdparty/login/?response_type=code&state=login&client_id=7c5ab07d-xxxx&scope=&redirect_uri=https%3A%2F%2Fapi.mcs3.miele.com%2Fthirdparty%2Flogin%2F
erhalte dann eine LOGIN Seite (in welche ich mich einlogge), erhalte dann
Zugriff erteilen
Die Anwendung FHEM möchte auf Ihre Gerätedaten zugreifen:

    Funktionsmerkmale Ihrer Miele-Geräte
    Gerätenutzungsdaten Ihrer Miele-Geräte
    Gerätezustandsdaten Ihrer Miele-Geräte
    Steuerung Ihrer Miele-Geräte

wo ich dann "Zustimme"
erhalte dann im Browser
Kontoverknüpfung fehlgeschlagen! Bitte überprüfen Sie ihre Zugangsdaten.
{"code":405,"message":"HTTP 405 Method Not Allowed"}

im FHEM selbst erhalte ich
HTTP/1.1 401 Unauthorized
Date: Mon, 19 Oct 2020 10:26:55 GMT
Content-Type: text/html
Connection: close
Strict-Transport-Security: max-age=15724800; includeSubDomains


woran könnte dies denn liegen? an meinem "!" im Passwort?
Ich würde dir empfehlen das neue Miele Modul dafür zu nutzen und nicht mehr httpmod.
Ich würde mich  freuen, wenn du meinen Einladungscode für Tibber, der Stromanbieter, der dir hilft, deinen Stromverbrauch zu verstehen und zu reduzieren, nutzt: https://invite.tibber.com/5fc08jbs. So bekommen wir beide 50 Euro und 100 % Ökostrom / https://geld-fuer-eauto.de/ref/334561880

amenomade

#132
Zitat von: xerion am 19 Oktober 2020, 12:54:34
Ich würde dir empfehlen das neue Miele Modul dafür zu nutzen und nicht mehr httpmod.

Ich als ursprünglicher Autor des HTTPMODs auch :)
Ich gewährleiste keinen Support mehr fürs HTTPMOD, da das Modul von Christian inzwischen viel mehr kann. Support fürs Modul mache ich aber gerne noch ab und zu ;)

Das Modul findest Du hier: https://forum.fhem.de/index.php/topic,112114.msg1064214.html#msg1064214
... bis Christian es endlich in svn eincheckt (private joke) ;)
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

speedAmaster

in der Tat! super vielen Dank an euch beide!!

somit kann dieser Stream wohl "geschlossen" werden

xerion

Moin zusammen,

habe heute eine nette Mail von Miele bekommen:
Dear User of the Miele 3rd Party API

To ensure the availability of our API we regularly check the log files. During the last check we noticed that your account generates an unusually high amount of token refresh requests. We kindly ask you to check the behavior of your application.
If the behavior still consists after March 17th, we're forced to invalidate the account without further notice.

Kind regards
Miele 3rd party API Team
Ich würde mich  freuen, wenn du meinen Einladungscode für Tibber, der Stromanbieter, der dir hilft, deinen Stromverbrauch zu verstehen und zu reduzieren, nutzt: https://invite.tibber.com/5fc08jbs. So bekommen wir beide 50 Euro und 100 % Ökostrom / https://geld-fuer-eauto.de/ref/334561880