Hauptmenü

JSON Abfrage mit HTTPMOD

Begonnen von thm12345, 30 Mai 2019, 16:29:31

Vorheriges Thema - Nächstes Thema

thm12345

Hallo,

ich versuche gerade per HTTPMOD eine JSON-Abfrage auszuführen. Über die API-Funktionen bekomme ich Daten mit dem folgenden curl Befehl ausgegeben:
curl -X POST "https://api.tingg.io/accounts/auth/login" -H  "accept: application/json" -H  "Content-Type: application/json" -d "{\"email\":\"meine@mail.adresse\",\"password\":\"DasistmeinPasswort\"}"

Jetzt versuche ich diese Abfrage per HTTPMOD nachzubilden. Das funktioniert leider nicht :-). Ich vermute, dass es irgendwie an den Header- bzw. Datendefinitionen liegt. Hier meine Definition:


define tinggio01 HTTPMOD https://api.tingg.io/accounts/auth/login 60
setuuid tinggio01 5ce7fc8f-f33f-dc5c-bb0b-73eb62e7bf867449
attr tinggio01 userattr sid1IdRegex sid3Data sidHeader1 sidHeader2
attr tinggio01 disable 0
attr tinggio01 enableControlSet 1
attr tinggio01 room X.xx Test
attr tinggio01 set01Data {"set" :{"email" :"meine@mail.adresse" ,"password" :"DasistmeinPasswort" }}
attr tinggio01 setHeader1 Content-Type: application/json
attr tinggio01 setHeader2 accept: application/json


Zurück kommt "HTTP/1.1 404 Not Found...". Was mache ich falsch? Die Web
Dazu noch eine 2. Frage - wie bekomme ich dass Passwort abgelegt und eingetragen ohne es irgendwo im Klartext stehen zu haben?

Vielen Dank und Gruß
Thomas

amenomade

Versuch mal noch ein "/" nach login hinzuzufügen.

Aber! Ich glaube nicht, dass das tatsächlich die Seite ist, wo du die Daten auslesen möchtest, sondern die Login Seite. Danach wirst Du wahscheinlich weitergeleitet oder?
Bei HTTPMOD muss man die interessante Seite direkt aufrufen, dann mit reAuthRegex festestellen, ob ein Login benötigt wird, und dann mit sidxxxxxxx Attribute das login verfahren abbilden.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

thm12345

Vielen Dank für die schnelle Antwort. Ich konnte mich erst heute wieder ransetzen...

Ich bin ein wenig weitergekommen. Es findet keine Umleitung statt. Die Anmeldung klappt jetzt. Ich habe es auf die sid-Attribute umgestellt und verwende reAuthRegex. Dann waren noch die sid01Data falsch aufgebaut. Hier mein aktueller Code:
define tinggio01 HTTPMOD https://api.tingg.io/accounts/auth/login 0
attr tinggio01 disable 0
attr tinggio01 enableControlSet 1
attr tinggio01 extractAllJSON 1
attr tinggio01 get1Name Holen
attr tinggio01 reAuthRegex .*Not Found.*
attr tinggio01 requestHeader.* User-Agent: curl/7.52.1
attr tinggio01 room X.xx Test
attr tinggio01 sid01Data {"email" :"meine@mail.adresse" ,"password" :"DasistmeinPasswort"}
attr tinggio01 sidHeader1 Content-Type: application/json
attr tinggio01 sidHeader2 accept: application/json
attr tinggio01 verbose 5


Im Log sehe ich jetzt, dass die Anmeldung geklappt hat und ich entsprechende Daten bekomme. Das seltsame ist, dass das Modul jetzt 3 Verbindungsversuche zur Gegenstelle durchführt. Der erste bekommt eine 404 -> Erkennung für notwendige Authentifizierung(?!). Der 2. führt die Authentifizierung durch und bekommt die gewünschten Daten zurückgeliefert. Woher kommt der 3. Verbindungsversuch? Der macht alle Ergebnisse aus dem 2. Versuch wieder zu nichte... Anbei der Auszug aus dem Log:
2019.06.02 18:18:19.971 5: tinggio01: ExtractSid called, context get, num 1
2019.06.02 18:18:19.972 5: tinggio01: CheckAuth is checking buffer with ReAuthRegex .*Not Found.*
2019.06.02 18:18:19.972 4: tinggio01: CheckAuth decided new authentication required
2019.06.02 18:18:19.972 4: tinggio01: Authentication still required but no retries left - did last authentication fail?
2019.06.02 18:18:19.973 5: tinggio01: ExtractReading for context get, num 1 - no individual parse definition
2019.06.02 18:18:19.973 5: tinggio01: Read sets reading message to value Not Found of JSON message
2019.06.02 18:18:19.974 5: tinggio01: UpdateReadingList created list of reading.* nums to parse during getUpdate as
2019.06.02 18:18:19.974 5: tinggio01: Read starts parsing response to get1 with defined readings:
2019.06.02 18:18:19.975 4: tinggio01: Read response to get1 matched Reading(s) message
2019.06.02 18:18:19.993 5: tinggio01: HandleSendQueue called, qlen = 0
2019.06.02 18:18:33.769 5: tinggio01: get called with Holen
2019.06.02 18:18:33.770 5: tinggio01: get found option Holen in attribute get1Name
2019.06.02 18:18:33.770 4: tinggio01: get will now request Holen, no optional value
2019.06.02 18:18:33.772 4: tinggio01: AddToQueue adds get1, initial queue len: 0
2019.06.02 18:18:33.773 5: tinggio01: AddToQueue adds type get1 to URL https://api.tingg.io/accounts/auth/login, no data, no headers, retry 0
2019.06.02 18:18:33.773 5: tinggio01: HandleSendQueue called, qlen = 1
2019.06.02 18:18:33.775 4: tinggio01: HandleSendQueue sends request type get1 to URL https://api.tingg.io/accounts/auth/login, No Data, No Header
timeout 2
2019.06.02 18:18:33.775 5: HttpUtils url=https://api.tingg.io/accounts/auth/login
2019.06.02 18:18:33.781 4: IP: api.tingg.io -> 52.57.247.24
2019.06.02 18:18:33.878 5: HttpUtils request header:
GET /accounts/auth/login HTTP/1.0
Host: api.tingg.io
User-Agent: fhem
Accept-Encoding: gzip,deflate
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

2019.06.02 18:18:33.911 4: https://api.tingg.io/accounts/auth/login: HTTP response code 404
2019.06.02 18:18:33.912 5: HttpUtils https://api.tingg.io/accounts/auth/login: Got data, length: 23
2019.06.02 18:18:33.912 5: HttpUtils response header:
HTTP/1.1 404 Not Found
Server: nginx/1.15.6
Date: Sun, 02 Jun 2019 16:18:33 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 23
Connection: close
X-DNS-Prefetch-Control: off
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=15724800; includeSubDomains
X-Download-Options: noopen
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Access-Control-Allow-Origin: *
ETag: W/"17-SuRA/yvUWUo8rK6x7dKURLeBo+0"
Vary: Accept-Encoding
2019.06.02 18:18:33.913 4: tinggio01: Read callback: request type was get1 retry 0,
Body: {"message":"Not Found"}
2019.06.02 18:18:33.913 5: tinggio01: JSON Flatter called : prefix , ref is HASH(0x435a638)
2019.06.02 18:18:33.914 5: tinggio01: JSON Flatter sets message to Not Found
2019.06.02 18:18:33.914 4: tinggio01: extracted JSON values to internal
2019.06.02 18:18:33.915 5: tinggio01: ExtractSid called, context get, num 1
2019.06.02 18:18:33.916 5: tinggio01: CheckAuth is checking buffer with ReAuthRegex .*Not Found.*
2019.06.02 18:18:33.916 4: tinggio01: CheckAuth decided new authentication required
2019.06.02 18:18:33.916 4: tinggio01: Auth called with Steps: 01
2019.06.02 18:18:33.918 4: tinggio01: AddToQueue adds auth01, initial queue len: 0, prio
2019.06.02 18:18:33.918 5: tinggio01: AddToQueue prepends type auth01 to URL https://api.tingg.io/accounts/auth/login, data {"email" :"meine@mail.adresse" ,"password" :"DasistmeinPasswort"}, header Content-Type: application/json
accept: application/json, retry 0
2019.06.02 18:18:33.918 5: tinggio01: HandleSendQueue called, qlen = 1
2019.06.02 18:18:33.919 5: tinggio01: HandleSendQueue - minSendDelay not over, rescheduling
2019.06.02 18:18:33.920 4: tinggio01: AddToQueue adds get1, initial queue len: 1
2019.06.02 18:18:33.920 5: tinggio01: AddToQueue adds type get1 to URL https://api.tingg.io/accounts/auth/login, no data, no headers, retry 1
2019.06.02 18:18:33.921 5: tinggio01: HandleSendQueue called, qlen = 2
2019.06.02 18:18:33.922 5: tinggio01: HandleSendQueue - minSendDelay not over, rescheduling
2019.06.02 18:18:33.922 4: tinggio01: CheckAuth requeued request get1 after auth, retryCount 0 ...
2019.06.02 18:18:34.922 5: tinggio01: HandleSendQueue called, qlen = 2
2019.06.02 18:18:34.924 4: tinggio01: HandleSendQueue sends request type auth01 to URL https://api.tingg.io/accounts/auth/login,
data: {"email" :"meine@mail.adresse" ,"password" :"DasistmeinPasswort"},
header: Content-Type: application/json
accept: application/json
timeout 2
2019.06.02 18:18:34.924 5: HttpUtils url=https://api.tingg.io/accounts/auth/login
2019.06.02 18:18:34.928 4: IP: api.tingg.io -> 52.57.247.24
2019.06.02 18:18:35.027 5: HttpUtils request header:
POST /accounts/auth/login HTTP/1.0
Host: api.tingg.io
User-Agent: fhem
Accept-Encoding: gzip,deflate
Content-Type: application/json
accept: application/json
Content-Length: 56

2019.06.02 18:18:35.193 4: https://api.tingg.io/accounts/auth/login: HTTP response code 200
2019.06.02 18:18:35.193 5: HttpUtils https://api.tingg.io/accounts/auth/login: Got data, length: 1000
2019.06.02 18:18:35.194 5: HttpUtils response header:
HTTP/1.1 200 OK
Server: nginx/1.15.6
Date: Sun, 02 Jun 2019 16:18:35 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 1000
Connection: close
Vary: Accept-Encoding
Vary: X-HTTP-Method-Override, Accept-Encoding
X-DNS-Prefetch-Control: off
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=15724800; includeSubDomains
X-Download-Options: noopen
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Access-Control-Allow-Origin: *
ETag: W/"3e8-fmSH1ME/9h7tWF5rhN2yRf40EGE"
2019.06.02 18:18:35.194 4: tinggio01: Read callback: request type was auth01 retry 0,
Body: {"token":"0815-4711","id":"1234567-1234-1234-1234-123456789","first_name":"Vorname","last_name":"Nachname","email":"meine@mail.adresse","is_verified":true,"google_id":null}
2019.06.02 18:18:35.196 5: tinggio01: JSON Flatter called : prefix , ref is HASH(0x4422520)
2019.06.02 18:18:35.196 5: tinggio01: JSON Flatter sets is_verified to 1
2019.06.02 18:18:35.197 5: tinggio01: JSON Flatter sets token to 0815-4711
2019.06.02 18:18:35.197 5: tinggio01: JSON Flatter sets id to 1234567-1234-1234-1234-123456789
2019.06.02 18:18:35.197 5: tinggio01: JSON Flatter sets email to meine@mail.adresse
2019.06.02 18:18:35.198 5: tinggio01: JSON Flatter sets first_name to Vorname
2019.06.02 18:18:35.198 5: tinggio01: JSON Flatter sets last_name to Nachname
2019.06.02 18:18:35.198 4: tinggio01: extracted JSON values to internal
2019.06.02 18:18:35.198 5: tinggio01: ExtractSid called, context sid, num 01
2019.06.02 18:18:35.925 5: tinggio01: HandleSendQueue called, qlen = 1
2019.06.02 18:18:35.926 4: tinggio01: HandleSendQueue sends request type get1 to URL https://api.tingg.io/accounts/auth/login, No Data, No Header
timeout 2
2019.06.02 18:18:35.927 5: HttpUtils url=https://api.tingg.io/accounts/auth/login
2019.06.02 18:18:35.945 4: IP: api.tingg.io -> 52.57.247.24
2019.06.02 18:18:36.030 5: HttpUtils request header:
GET /accounts/auth/login HTTP/1.0
Host: api.tingg.io
User-Agent: fhem
Accept-Encoding: gzip,deflate
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

2019.06.02 18:18:36.058 4: https://api.tingg.io/accounts/auth/login: HTTP response code 404
2019.06.02 18:18:36.059 5: HttpUtils https://api.tingg.io/accounts/auth/login: Got data, length: 23
2019.06.02 18:18:36.059 5: HttpUtils response header:
HTTP/1.1 404 Not Found
Server: nginx/1.15.6
Date: Sun, 02 Jun 2019 16:18:36 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 23
Connection: close
X-DNS-Prefetch-Control: off
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=15724800; includeSubDomains
X-Download-Options: noopen
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Access-Control-Allow-Origin: *
ETag: W/"17-SuRA/yvUWUo8rK6x7dKURLeBo+0"
Vary: Accept-Encoding
2019.06.02 18:18:36.060 4: tinggio01: Read callback: request type was get1 retry 1,
Body: {"message":"Not Found"}
2019.06.02 18:18:36.061 5: tinggio01: JSON Flatter called : prefix , ref is HASH(0x435a638)
2019.06.02 18:18:36.061 5: tinggio01: JSON Flatter sets message to Not Found
2019.06.02 18:18:36.061 4: tinggio01: extracted JSON values to internal
2019.06.02 18:18:36.062 5: tinggio01: ExtractSid called, context get, num 1
2019.06.02 18:18:36.063 5: tinggio01: CheckAuth is checking buffer with ReAuthRegex .*Not Found.*
2019.06.02 18:18:36.063 4: tinggio01: CheckAuth decided new authentication required
2019.06.02 18:18:36.063 4: tinggio01: Authentication still required but no retries left - did last authentication fail?
2019.06.02 18:18:36.064 5: tinggio01: ExtractReading for context get, num 1 - no individual parse definition
2019.06.02 18:18:36.065 5: tinggio01: Read sets reading message to value Not Found of JSON message
2019.06.02 18:18:36.065 5: tinggio01: Read starts parsing response to get1 with defined readings:
2019.06.02 18:18:36.066 4: tinggio01: Read response to get1 matched Reading(s) message
2019.06.02 18:18:36.073 5: tinggio01: HandleSendQueue called, qlen = 0





amenomade

#3
Das geht so:
- rufe die Seite, die im Def definiert ist (per GET) => ergibt 404 => auth process da reAuthRegex "not found"
- POST login data auf der login URL => OK, antwort ist ein token, der vermutlich bei nächste Request benutzt werden muss, in einem HEader oder in einem Cookie
- rufe die Seite, die im Def definiert ist (per GET) => ergibt immer noch 404. Das ist aber normal, das ist eine POST/login URL.

Wie ich in der erste Antwort gesagt habe, musst Du in der DEF die Seite aufrufen, wo Du die Daten auslesen möchtest, und das ist bestimmt nicht die Login URL
Dann hättest du:
- GET meine Daten => Oops nicht authentifiziert => auth process
- POST login data auf der login URL
- GET meine Daten mit gültiger Anmeldung => Daten sind da
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

thm12345

Danke für die ausführliche Beschreibung. Jetzt wird mir langsam schon einiges verständlicher. Es ist so ähnlich wie du es beschreibst. Ich bekomme über die Login-Seite einen Token per JSON. Diesen muss ich dann an die URL der eigentlichen Seite als Parameter anhängen. Wo bzw. in welchen Variablen werden die Werte aus dem Step 2 abgelegt / zugänglich gemacht, so dass ich sie über die URL im Step 3 verwenden kann?

amenomade

Das Token kannst Du mit sid01IdRegex extrahieren, dann in der "get" Url mit $sid benutzen.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

thm12345

Nach einigem Hin- und Herprobieren habe ich es geschafft :-). Anstelle sid01IdRegex musste ich dann sid01IdJSON verwenden.


amenomade

Für diejenige, die evtl es brauchen werden, kannst Du jetzt bitte ein vollständiges "list" von deinem DOIF hier posten? (natürlich anonymisiert)
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

thm12345

Hier sind meine aktuellen Einstellungen:
define tinggio01 HTTPMOD https://api.tingg.io/v1/data?thing_id=63ef1c5d-8a42-42fc-b8d6-e646bef8bd4a&limit=3 300
attr tinggio01 disable 0
attr tinggio01 enableControlSet 1
attr tinggio01 get1CheckAllReadings 1
attr tinggio01 get1Name Holen
attr tinggio01 getHeader1 accept: application/json
attr tinggio01 getHeader2 Authorization: Bearer $sid
attr tinggio01 reAuthRegex .*401.*
attr tinggio01 reading1JSON data_02_payload_value
attr tinggio01 reading1Name Temperatur
attr tinggio01 reading2JSON data_01_payload_value
attr tinggio01 reading2Name Luftdruck
attr tinggio01 reading3JSON data_03_payload_value
attr tinggio01 reading3Name Helligkeit
attr tinggio01 requestHeader.* User-Agent: curl/7.52.1
attr tinggio01 room X.xx Test
attr tinggio01 sid1Data {"email" :"meine@mail.adresse" ,"password" :"DasistmeinPasswort"}
attr tinggio01 sid1Header1 Content-Type: application/json
attr tinggio01 sid1Header2 accept: application/json
attr tinggio01 sid1IdJSON token
attr tinggio01 sid1URL https://api.tingg.io/accounts/auth/login
attr tinggio01 stateFormat {sprintf("%.1f Grad / %1.f Bar / %1.f Lux", ReadingsVal($name,"Temperatur",0),ReadingsVal($name,"Luftdruck",0),ReadingsVal($name,"Helligkeit",0))}
attr tinggio01 verbose 5


Jetzt stehe ich leider vor dem nächsten Problem :-). Beim "eindampfen/optimieren" der Settings musste ich feststellen, das es nur mit dem Get-Button funktioniert. In diesem Fall werden die beiden Header , incl. $sid, angefordert. Wenn die Daten automatisch abgefordert werden, werden die Header nicht mit gesandt? Wo ist da der Unterschied zwischen dem Button und dem automatischen Aufruf?

2019.06.06 08:51:06.407 4: tinggio01: ExtractSid set sid to eyJh...kzNA-
2019.06.06 08:51:07.060 5: tinggio01: HandleSendQueue called, qlen = 1
2019.06.06 08:51:07.061 4: tinggio01: HandleSendQueue sends request type update to URL https://api.tingg.io/v1/data?thing_id=63ef1c5d-8a42-42fc-b8d6-e646bef8bd4a&limit=3, No Data,
header: User-Agent: curl/7.52.1
timeout 2
2019.06.06 08:51:07.062 5: HttpUtils url=https://api.tingg.io/v1/data?thing_id=63ef1c5d-8a42-42fc-b8d6-e646bef8bd4a&limit=3
2019.06.06 08:51:07.066 4: IP: api.tingg.io -> 35.157.112.29
2019.06.06 08:51:07.153 5: HttpUtils request header:
GET /v1/data?thing_id=63ef1c5d-8a42-42fc-b8d6-e646bef8bd4a&limit=3 HTTP/1.0
Host: api.tingg.io
Accept-Encoding: gzip,deflate
User-Agent: curl/7.52.1

2019.06.06 08:51:07.182 4: https://api.tingg.io/v1/data?thing_id=63ef1c5d-8a42-42fc-b8d6-e646bef8bd4a&limit=3: HTTP response code 401
2019.06.06 08:51:07.183 5: HttpUtils https://api.tingg.io/v1/data?thing_id=63ef1c5d-8a42-42fc-b8d6-e646bef8bd4a&limit=3: Got data, length: 0
2019.06.06 08:51:07.184 5: HttpUtils response header:
HTTP/1.1 401 Unauthorized
Server: nginx/1.15.6
Date: Thu, 06 Jun 2019 06:51:07 GMT
Content-Type: application/json; charset=utf-8
Connection: close
X-DNS-Prefetch-Control: off
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=15724800; includeSubDomains
X-Download-Options: noopen
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Access-Control-Allow-Origin: *
Vary: Accept-Encoding
2019.06.06 08:51:07.184 4: tinggio01: Read callback: request type was update retry 1, body empty
2019.06.06 08:51:07.185 5: tinggio01: ExtractSid called, context reading, num
2019.06.06 08:51:07.187 5: tinggio01: CheckAuth is checking buffer with ReAuthRegex .*401.*
2019.06.06 08:51:07.187 4: tinggio01: CheckAuth decided new authentication required
2019.06.06 08:51:07.188 4: tinggio01: Authentication still required but no retries left - did last authentication fail?
2019.06.06 08:51:07.189 5: tinggio01: UpdateReadingList created list of reading.* nums to parse during getUpdate as 1 2 3
2019.06.06 08:51:07.190 5: tinggio01: Read starts parsing response to update with defined readings: 1,2,3
2019.06.06 08:51:07.191 5: tinggio01: ExtractReading Temperatur with json data_02_payload_value ...
2019.06.06 08:51:07.191 5: tinggio01: ExtractReading Temperatur did not match
2019.06.06 08:51:07.192 5: tinggio01: ExtractReading Luftdruck with json data_01_payload_value ...
2019.06.06 08:51:07.192 5: tinggio01: ExtractReading Luftdruck did not match
2019.06.06 08:51:07.193 5: tinggio01: ExtractReading Helligkeit with json data_03_payload_value ...
2019.06.06 08:51:07.194 5: tinggio01: ExtractReading Helligkeit did not match
2019.06.06 08:51:07.195 3: tinggio01: Read response to update didn't match any Reading
2019.06.06 08:51:07.196 5: tinggio01: HandleSendQueue called, qlen = 0

thm12345

Ich habe es selbst gefunden :-), jetzt funktioniert es auch mit der Automatik... Hier der Code:

define tinggio01 HTTPMOD https://api.tingg.io/v1/data?thing_id=63ef1c5d-8a42-42fc-b8d6-e646bef8bd4a&limit=3 30
setuuid tinggio01 5cf8bddb-f33f-dc5c-c64b-43e6e3de82118b7c
attr tinggio01 userattr get1CheckAllReadings:0,1 get1Name reading1JSON reading1Name reading2JSON reading2Name reading3JSON reading3Name requestHeader1 requestHeader2 requestHeader3 sid1Data sid1Header1 sid1Header2 sid1IdJSON sid1URL
attr tinggio01 disable 0
attr tinggio01 enableControlSet 1
attr tinggio01 get1CheckAllReadings 1
attr tinggio01 room X.xx Test
attr tinggio01 get1Name Holen
attr tinggio01 reAuthRegex .*401.*
attr tinggio01 requestHeader1 User-Agent: curl/7.52.1
attr tinggio01 requestHeader2 accept: application/json
attr tinggio01 requestHeader3 Authorization: Bearer $sid
attr tinggio01 sid1Data {"email" :"meine@mail.adresse" ,"password" :"DasistmeinPasswort"}
attr tinggio01 sid1Header1 Content-Type: application/json
attr tinggio01 sid1Header2 accept: application/json
attr tinggio01 sid1IdJSON token
attr tinggio01 sid1URL https://api.tingg.io/accounts/auth/login
attr tinggio01 reading1JSON data_02_payload_value
attr tinggio01 reading1Name Temperatur
attr tinggio01 reading2JSON data_01_payload_value
attr tinggio01 reading2Name Luftdruck
attr tinggio01 reading3JSON data_03_payload_value
attr tinggio01 reading3Name Helligkeit
attr tinggio01 stateFormat {sprintf("%.1f Grad / %1.f Bar / %1.f Lux", ReadingsVal($name,"Temperatur",0),ReadingsVal($name,"Luftdruck",0),ReadingsVal($name,"Helligkeit",0))}
attr tinggio01 verbose 5