HTTPMOD Login Honeywell Evohome Totalconnect

Begonnen von LaMa163, 11 Februar 2018, 16:43:03

Vorheriges Thema - Nächstes Thema

LaMa163

Hallo Zusammen,

ich würde gerne meine Evohome Thermostate auslesen und in FHEM anzeigen lassen. Dazu möchte ich mein Honeywell Online Konto abfragen.

Ich schaffe es aktuell nicht mich mittels HTTPMOD einzuloggen.

Prinzipiell kann man sich über die folgende Landing Page einloggen:

https://international.mytotalconnectcomfort.com/Account/Login

Sobald man dies getan hat wird man auf eine Seite weitergeleitet wo man sein System (location) auswählt und danach kommt man auf die gewünschte Seite. Bei mir hier:

https://international.mytotalconnectcomfort.com/Locations/View/27xxxxx

Mein HTTPMOD sieh im Moment so aus:

define Evohome HTTPMOD https://international.mytotalconnectcomfort.com/Locations/View/27xxxxx 3600
attr Evohome userattr requestHeader1 sid01Data sid01URL
attr Evohome enableCookies 1
attr Evohome reAuthRegex id="login"|Unauthorized
attr Evohome requestHeader1 Cookie: $sid
attr Evohome sid01Data {"EmailAddress":"email@beispiel.com","Password":"password","IsServiceStatusReturned":true,"ApiActive":true,"ApiDown":false,"RedirectUrl":"","events":[],"formErrors":[]}
attr Evohome sid01URL https://international.mytotalconnectcomfort.com/Account/Login


Aktuell bleibt das Modul immer auf der Login Seite hängen. Ausgelesen wird immer nur die Login Seite und nicht mein Evohome System nach dem Login.

Hat irgendjemand Ideen woran es liegen könnte?



UPDATE! für alle die ihr Honeywell Evohome System über TotalConnect in FHEM einbinden wollen hier die HTTPMOD-Definition: (Danke an amenomade)

defmod Evohome2 HTTPMOD https://international.mytotalconnectcomfort.com/Api/LocationsApi/GetLocationSystem?id=xxxxxx 0
attr Evohome2 enableControlSet 1
attr Evohome2 enableCookies 1
attr Evohome2 reAuthRegex id="login"|do.not.have.permission
attr Evohome2 room Evohome
attr Evohome2 sid01IdRegex (?s)antiForgeryToken.*?value="(.*?)"
attr Evohome2 sid01URL https://international.mytotalconnectcomfort.com/api/statusApi/getStatus
attr Evohome2 sid02Data {"EmailAddress":"mail%40provider.com","Password":"password","IsServiceStatusReturned":true,"ApiActive":true,"ApiDown":false,"RedirectUrl":"","events":[],"formErrors":[]}
attr Evohome2 sid02Header01 Content-Type: application/json;;charset=utf-8
attr Evohome2 sid02Header02 antiForgeryToken:$sid
attr Evohome2 sid02URL https://international.mytotalconnectcomfort.com/api/accountApi/login
attr Evohome2 extractAllJSON 1



Gesendet von iPhone mit Tapatalk

elmer

Hast du es geschafft dich im Konto anzumelden? Ich suche auch seit Monaten eine Lösung wie ich Evohome mit Fhem verbinden kann.

StefanStrobel

Hallo,

seit ein paar Wochen gibt es ein neues Feature in HTTPMOD, mit dem es eventuell einfacher geht:
attr MyDevice handleRedirects 1

Wenn das nicht hilft, muss die genaue Abfolge von HTTP-Requests, deren Inhalt (Header und Daten) analysiert und nachgebildet werden. (z.B. mit der Burp Suite). Fhem ist eben kein Browser mit eingebautem JavaScript Interpreter etc.

Gruss
   Stefan

elmer

Geht leider auch nicht

2018.07.29 19:52:48 3: Evohome: Read callback: Error: write to https://international.mytotalconnectcomfort.com:443 timed out
2018.07.29 19:52:48 4: Evohome: Read callback: request type was update retry 0, body empty
2018.07.29 19:52:48 5: Evohome: GetCookies is looking for Cookies
2018.07.29 19:52:48 5: Evohome: ExtractSid called, context reading, num
2018.07.29 19:52:48 1: PERL WARNING: Use of uninitialized value in split at ./FHEM/98_HTTPMOD.pm line 2452.
2018.07.29 19:52:48 1: PERL WARNING: Use of uninitialized value in split at ./FHEM/98_HTTPMOD.pm line 2453.
2018.07.29 19:52:48 1: PERL WARNING: Use of uninitialized value $code in concatenation (.) or string at ./FHEM/98_HTTPMOD.pm line 2455.
2018.07.29 19:52:48 4: Evohome: checking for redirects, code=, ignore=0
2018.07.29 19:52:48 1: PERL WARNING: Use of uninitialized value $code in numeric eq (==) at ./FHEM/98_HTTPMOD.pm line 2456.
2018.07.29 19:52:48 4: Evohome: no redirects to handle
2018.07.29 19:52:48 5: Evohome: CheckAuth is checking buffer with ReAuthRegex id="login"|Unauthorized
2018.07.29 19:52:48 4: Evohome: CheckAuth decided no authentication required

StefanStrobel

Dein erster Zugriff auf die Seite endet schon  im Timeout.
Entsprechend matcht auch die reAuthRegex nicht.
Du hast auch keine Readings definiert.

Gruß
    Stefan

LaMa163

@elmer

bist du irgendwie weiter gekommen?
Ich beiße mir die Zähne daran aus. Kriege es einfach nicht hin...

amenomade

#6
Der Trick ist der antiForgeryToken (und die Login URL)

defmod Evohome HTTPMOD https://international.mytotalconnectcomfort.com/Locations/ 0
attr Evohome userattr sid01Data sid01Header01 sid01IdRegex sid01URL sid02Data sid02Header01 sid02Header02 sid02URL
attr Evohome enableControlSet 1
attr Evohome enableCookies 1
attr Evohome reAuthRegex id="login"
attr Evohome sid01IdRegex (?s)antiForgeryToken.*?value="(.*?)"
attr Evohome sid01URL https://international.mytotalconnectcomfort.com/api/statusApi/getStatus
attr Evohome sid02Data {"EmailAddress":"xxxxMyEmail","Password":"xxxxMyPasswort","IsServiceStatusReturned":true,"ApiActive":true,"ApiDown":false,"RedirectUrl":"","events":[],"formErrors":[]}
attr Evohome sid02Header01 Content-Type: application/json;;charset=utf-8
attr Evohome sid02Header02 antiForgeryToken:$sid
attr Evohome sid02URL https://international.mytotalconnectcomfort.com/api/accountApi/login
attr Evohome verbose 5

Als HauptURL nutze ich einfach /Locations/, da ich keine Geräte in meinem Testkonto habe. Das sollte aber genauso mit /Locations/View/27xxxxx oder andere URLs der API funktionieren.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

LaMa163

Werde ich heute Abend direkt mal ausprobieren. Ich halte dich auf dem laufenden.


Gesendet von iPhone mit Tapatalk

LaMa163

#8
mein Device sieht jetzt so aus:

defmod Evohome2 HTTPMOD https://international.mytotalconnectcomfort.com/Locations/View/xxxxxxx 0
attr Evohome2 userattr reading1Name reading1Regex sid01Data sid01Header01 sid01IdRegex sid01URL sid02Data sid02Header01 sid02Header02 sid02URL
attr Evohome2 enableControlSet 1
attr Evohome2 enableCookies 1
attr Evohome2 reAuthRegex id="login"
attr Evohome2 reading1Name Temperatur
attr Evohome2 reading1Regex <span>Wohnzimmer</span>[^0-9]+([0-9\.]+)
attr Evohome2 room Evohome
attr Evohome2 sid01IdRegex (?s)antiForgeryToken.*?value="(.*?)"
attr Evohome2 sid01URL https://international.mytotalconnectcomfort.com/api/statusApi/getStatus
attr Evohome2 sid02Data {"EmailAddress":"mail%40provider.com","Password":"password","IsServiceStatusReturned":true,"ApiActive":true,"ApiDown":false,"RedirectUrl":"","events":[],"formErrors":[]}
attr Evohome2 sid02Header01 Content-Type: application/json;;charset=utf-8
attr Evohome2 sid02Header02 antiForgeryToken:$sid
attr Evohome2 sid02URL https://international.mytotalconnectcomfort.com/api/accountApi/login
attr Evohome2 verbose 5


wo sehe ich denn ob alles funktioniert?
Ein Reading spuckt er mir nicht aus. Eigentlich würde ich gerne die Wohnzimmer Temperatur auslesen.

wenn ich ein Reading

attr Evohome2 reading03Name alles
attr Evohome2 reading03Regex (.*)


anlege ist das Ergebnis

alles
HTTP/1.1 200 OK


amenomade

#9
Zitatwo sehe ich denn ob alles funktioniert?
In der Log, nach einem "set Evohome2 reread" (Du hast ja 0 als Interval => es wird nur was gemacht, wenn Du ein reread machst).
Bitte posten (ggf. anonymisieren)
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

amenomade

#10
Du kriegst
Body: {"Content":null,"Errors":["E-mail address or password incorrect. Please check your details."],"RedirectUrl":null,"CurrentCulture":"en-GB"}
Zeig mal bitte ein "list" von deinem HTTPMOD - "list Evohome2" im Kommandofeld von Fhem -  (anonymisiert, aber prüfe die Zugangsdaten)

Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

LaMa163

Zugangsdaten habe ich geprüft. Die stimmen.
Mal ne blöde Frage... email Adresse mit @ oder %40 angeben?

Internals:
   BUSY       0
   CFGFN     
   DEF        https://international.mytotalconnectcomfort.com/Locations/View/xxxxxxx 60
   Interval   60
   LASTSEND   1552409374.44999
   LastAuthTry 2019-03-12 17:49:32
   MainURL    https://international.mytotalconnectcomfort.com/Locations/View/xxxxxxx
   ModuleVersion 3.5.0 - 4.7.2018
   NAME       Evohome2
   NR         415
   STATE      ???
   TRIGGERTIME 1552409431.85504
   TRIGGERTIME_FMT 2019-03-12 17:50:31
   TYPE       HTTPMOD
   addr       https://international.mytotalconnectcomfort.com:443
   auth       0
   buf       
   code       200
   compress   1
   conn       
   data       
   displayurl https://international.mytotalconnectcomfort.com:443/Account/Login?ReturnUrl=%2fLocations%2fView%2fxxxxxxx
   header     Cookie: ARRAffinity=1be1c5e3182f898e3600620bf67c76015bbe9d0d4bbd5354eece81c0fb17caaf; AnonymousCookie=d3753441-c9c6-4832-852e-439a3de06c1e; __RequestVerificationToken=rZSV0qSrZtokHZY_oqVfJpHZYAO218z1cRFEXFL_bW-ZWnNpAJopd0nyWhQ25rDYvVhJE9oAC4LM7Px8JReSR-borCc1
   host       international.mytotalconnectcomfort.com
   httpheader HTTP/1.1 200 OK
Cache-Control: no-cache, no-store,no-cache
Pragma: no-cache,no-cache
Content-Length: 17436
Content-Type: text/html; charset=utf-8
Expires: -1,-1
x-content-type-options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Date: Tue, 12 Mar 2019 16:49:34 GMT
Connection: close
   httpversion 1.0
   hu_blocking 0
   hu_filecount 914
   hu_port    443
   hu_portSfx
   ignoreredirects 0
   loglevel   4
   path       /Account/Login?ReturnUrl=%2fLocations%2fView%2fxxxxxx
   protocol   https
   redirects  1
   sid        6rmcc-llGQ4sE6VZoy1MdPb9_vgeljNg94HQ_a3kDfGiFDNByyd6weLSCpcuzEkI26QxYvbDIJD4opSfHrVgBjdP0SI1:1MnIN94D8ZfGN_5gmos06RE67j8vnVzQ7SixKftfZh0vO9-qpOMH1LXwkuRqdHUR9mYil8vH4kz4zI-4R2H01L4oYWo1
   timeout    2
   url        https://international.mytotalconnectcomfort.com:443/Account/Login?ReturnUrl=%2fLocations%2fView%2fxxxxxxx
   value      0
   HTTPCookieHash:
     ARRAffinity;:
       Name       ARRAffinity
       Options    Path=/;HttpOnly;Domain=international.mytotalconnectcomfort.com
       Path       
       Value      1be1c5e3182f898e3600620bf67c76015bbe9d0d4bbd5354eece81c0fb17caaf
     AnonymousCookie;/:
       Name       AnonymousCookie
       Options    expires=Tue, 12-Mar-2019 16:31:50 GMT; path=/; secure; HttpOnly
       Path       /
       Value      d3753441-c9c6-4832-852e-439a3de06c1e
     __RequestVerificationToken;/:
       Name       __RequestVerificationToken
       Options    path=/; secure; HttpOnly
       Path       /
       Value      rZSV0qSrZtokHZY_oqVfJpHZYAO218z1cRFEXFL_bW-ZWnNpAJopd0nyWhQ25rDYvVhJE9oAC4LM7Px8JReSR-borCc1
   QUEUE:
   READINGS:
     2019-03-12 17:49:34   alles           HTTP/1.1 200 OK
   REQUEST:
     data       
     header     
     ignoreredirects 0
     retryCount 1
     type       update
     url        https://international.mytotalconnectcomfort.com/Locations/View/xxxxxxx
     value      0
   defptr:
     readingBase:
       alles      reading
     readingNum:
       alles      03
     readingOutdated:
     requestReadings:
       update:
         alles      reading 03
   sslargs:
Attributes:
   enableControlSet 1
   enableCookies 1
   reAuthRegex id="login"
   reading03Name alles
   reading03Regex (.*)
   reading1Name Temperatur
   reading1Regex Wohnzimmer[^0-9]+([0-9\.]+)
   room       Evohome
   sid01IdRegex (?s)antiForgeryToken.*?value="(.*?)"
   sid01URL   https://international.mytotalconnectcomfort.com/api/statusApi/getStatus
   sid02Data  {"EmailAddress":"mail%40provider.com","Password":"password","IsServiceStatusReturned":true,"ApiActive":true,"ApiDown":false,"RedirectUrl":"","events":[],"formErrors":[]}
   sid02Header01 Content-Type: application/json;charset=utf-8
   sid02Header02 antiForgeryToken:$sid
   sid02URL   https://international.mytotalconnectcomfort.com/api/accountApi/login
   userattr   reading03Name reading03Regex reading1Name reading1Regex sid01Data sid01Header01 sid01IdRegex sid01URL sid02Data sid02Header01 sid02Header02 sid02URL
   verbose    5

amenomade

Bei mir hat es mit @ funktioniert.
Ich gucke mal. Vielleicht habe ich bei meinen Tests irgendwelche Zwischenschritte gemacht, die was bewirkt haben.
Aber deine HTTPMOD Version ist verältet... Da wurde in den letzten Zeiten viel ans Modul gemacht.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

LaMa163

ok...ich mache mal eben nen Update des Moduls

amenomade

Vorsicht mit selektiven Modul-Update. Das funktioniert nicht immer.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus