(Gelöst) JSON Senden in Post Request

Begonnen von Esjay, 09 September 2020, 21:22:53

Vorheriges Thema - Nächstes Thema

amenomade

#15
Wirklich ein Rätsel...

EDIT: wobei curl ein anderes Content-Type: (application/x-www-form-urlencoded) sendet.
EDIT2: Andere Container oder Elemente, die den Port 8090 evtl irgendwie 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

Esjay

Das einzige was den Port nutzt ist der Webserver, allerdings müsste ja dann die Anfrage aus dem RestClient im Firefox Addon ebenfalls einen Fehler zur Folge haben.
Zumindest so wie ich das verstehe.
Der klappt ja wie gezeigt ohne Probleme.


amenomade

Zitat von: Esjay am 09 September 2020, 23:41:59
Das einzige was den Port nutzt ist der Webserver, allerdings müsste ja dann die Anfrage aus dem RestClient im Firefox Addon ebenfalls einen Fehler zur Folge haben.
Zumindest so wie ich das verstehe.
Der klappt ja wie gezeigt ohne Probleme.

Sehe ich auch irgendwie so. Und bei curl auch. Aber ich kann es mir nicht anders erklären, als ein Routing Problem o.ä.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Otto123

aber ihr macht doch den curl Test von FHEM aus mit dem user fhem? Was anderes macht doch FHEM auch nicht?!

Das man den Json encoden muss?
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Esjay

Zitat von: Otto123 am 09 September 2020, 23:56:02
aber ihr macht doch den curl Test von FHEM aus mit dem user fhem? Was anderes macht doch FHEM auch nicht?!

Das ist korrekt.

ZitatDas man den Json encoden muss?

Das verstehe ich nicht so wirklich.
Der Json darf meiner Meinung nach nicht aufgelöst werden..Er muss direkt so ankommen wie er ist..Ich bin in das Thema heute erst eingestiegen, daher weiß ich natürlich nicht, ob ich das ganz durchdrungen habe.

Otto123

ZitatEDIT: wobei curl ein anderes Content-Type: (application/x-www-form-urlencoded) sendet.
Aber vielleicht macht das HTTPMOD von sich aus...
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Otto123

#21
Mach das mal versuchsweise:
attr MyDevice set01Data %7B%22command%22%3A%22componentstate%22%2C%22componentstate%22%3A%7B%22component%22%3A%22LEDDEVICE%22%2C%22state%22%3Afalse%7D%7D

Hab ich so erzeugt:
{use URI::Escape;;return uri_escape(q({"command":"componentstate","componentstate":{"component":"LEDDEVICE","state":false}}))}
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

amenomade

@Otto: Ja, aber er hat explizit setHeader1 Content-Type: application/json gesetzt.
@Otto2: Ja, kann man versuchen.

@Esjay: funktionniert bei dir folgendes HTTPMOD?
defmod test8090 HTTPMOD http://insuvcld.vvdncloud.com:8090/ 0
attr test8090 extractAllJSON 1

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

Otto123

Wie schon gesagt, ich habe keine wirkliche Ahnung von HTTPMOD  :-[
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

amenomade

Zitat von: Otto123 am 10 September 2020, 00:28:56
Wie schon gesagt, ich habe keine wirkliche Ahnung von HTTPMOD  :-[
HTTPMOD macht grundsätzlich nichts anderes als HttpUtils_NonBlockingGet
Wenn man aber per Attribut explizit ein Header setzt, wird es auch benutzt ;)
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Esjay

Guten Morgen,
ich habs gestern nicht mehr geschafft..Wurde einfach zu spät, und ich musste mich zum Schlafen zwingen.

Zitat von: Otto123 am 10 September 2020, 00:24:41
Mach das mal versuchsweise:
attr MyDevice set01Data %7B%22command%22%3A%22componentstate%22%2C%22componentstate%22%3A%7B%22component%22%3A%22LEDDEVICE%22%2C%22state%22%3Afalse%7D%7D

Hab ich so erzeugt:
{use URI::Escape;;return uri_escape(q({"command":"componentstate","componentstate":{"component":"LEDDEVICE","state":false}}))}

Das läuft ins leere:

2020.09.10 08:18:21 1:  Logfile gelöscht
2020.09.10 08:18:24 5:  MyDevice: UpdateHintList called
2020.09.10 08:18:24 5:  MyDevice: UpdateHintList: setlist = interval reread:noArg stop:noArg start:noArg clearCookies:noArg upgradeAttributes:noArg storeKeyValue LEDDevice
2020.09.10 08:18:24 5:  MyDevice: UpdateHintList: getlist =
2020.09.10 08:18:30 5:  MyDevice: set called with LEDDevice
2020.09.10 08:18:30 5:  MyDevice: set found option LEDDevice in attribute set01Name
2020.09.10 08:18:30 4:  MyDevice: set will now set LEDDevice ->
2020.09.10 08:18:30 5:  MyDevice: AddToQueue adds type set01 to URL http://192.168.178.76:8090/json-rpc, data %7B%22command%22%3A%22componentstate%22%2C%22componentstate%22%3A%7B%22component%22%3A%22LEDDEVICE%22%2C%22state%22%3Afalse%7D%7D, no headers, retry 0, initial queue len: 0
2020.09.10 08:18:30 5:  MyDevice: HandleSendQueue called, qlen = 1
2020.09.10 08:18:30 5:  MyDevice: HandleSendQueue - call with HTTP METHOD: POST
2020.09.10 08:18:30 4:  MyDevice: HandleSendQueue sends set01 with timeout 2 to http://192.168.178.76:8090/json-rpc,
data: %7B%22command%22%3A%22componentstate%22%2C%22componentstate%22%3A%7B%22component%22%3A%22LEDDEVICE%22%2C%22state%22%3Afalse%7D%7D, No Header
2020.09.10 08:18:30 5:  HttpUtils url=http://192.168.178.76:8090/json-rpc
2020.09.10 08:18:30 4:  IP: 192.168.178.76 -> 192.168.178.76
2020.09.10 08:18:32 3:  MyDevice: Read callback: Error: connect to http://192.168.178.76:8090 timed out
2020.09.10 08:18:32 4:  MyDevice: Read callback: request type was set01 retry 0, no headers, no body
2020.09.10 08:18:32 5:  MyDevice: Read callback: body empty
2020.09.10 08:18:32 4:  MyDevice: Read found no charset header (bodyDecode was set to auto)
2020.09.10 08:18:32 5:  MyDevice: GetCookies is looking for Cookies
2020.09.10 08:18:32 5:  MyDevice: ExtractSid called, context set, num 01
2020.09.10 08:18:32 4:  MyDevice: no header to look for redirects
2020.09.10 08:18:32 5:  MyDevice: CheckAuth decided no authentication required



Zitat von: amenomade am 10 September 2020, 00:26:59
@Otto: Ja, aber er hat explizit setHeader1 Content-Type: application/json gesetzt.
@Otto2: Ja, kann man versuchen.

@Esjay: funktionniert bei dir folgendes HTTPMOD?
defmod test8090 HTTPMOD http://insuvcld.vvdncloud.com:8090/ 0
attr test8090 extractAllJSON 1

dann set test8090 reread

Dieser funktioniert soweit:

2020.09.10 08:16:19 5:  test8090: set called with reread
2020.09.10 08:16:19 5:  test8090: GetUpdate called (reread)
2020.09.10 08:16:19 5:  test8090: AddToQueue adds type update to URL http://insuvcld.vvdncloud.com:8090/, no data, no headers, retry 0, initial queue len: 0
2020.09.10 08:16:19 5:  test8090: HandleSendQueue called, qlen = 1
2020.09.10 08:16:19 4:  test8090: HandleSendQueue sends update with timeout 2 to http://insuvcld.vvdncloud.com:8090/, No Data, No Header
2020.09.10 08:16:19 5:  HttpUtils url=http://insuvcld.vvdncloud.com:8090/
2020.09.10 08:16:19 4:  IP: insuvcld.vvdncloud.com -> 52.249.189.74
2020.09.10 08:16:20 5:  HttpUtils request header:
GET / HTTP/1.0
Host: insuvcld.vvdncloud.com:8090
User-Agent: fhem
Accept-Encoding: gzip,deflate

2020.09.10 08:16:20 4:  http://insuvcld.vvdncloud.com:8090/: HTTP response code 200
2020.09.10 08:16:20 5:  HttpUtils http://insuvcld.vvdncloud.com:8090/: Got data, length: 1230
2020.09.10 08:16:20 5:  HttpUtils response header:
HTTP/1.1 200
Content-Type: application/hal+json;charset=UTF-8
Date: Thu, 10 Sep 2020 06:16:20 GMT
Connection: close
2020.09.10 08:16:20 4:  test8090: Read callback: request type was update retry 0,
header: HTTP/1.1 200
Content-Type: application/hal+json;charset=UTF-8
Date: Thu, 10 Sep 2020 06:16:20 GMT
Connection: close, body length 1230
2020.09.10 08:16:20 5:  test8090: Read callback: body
{
  "_links" : {
    "modeEventses" : {
      "href" : "http://insuvcld.vvdncloud.com:8090/modeEventses{?page,size,sort}",
      "templated" : true
    },
    "cameraModeses" : {
      "href" : "http://insuvcld.vvdncloud.com:8090/cameraModeses{?page,size,sort}",
      "templated" : true
    },
    "deviceDatas" : {
      "href" : "http://insuvcld.vvdncloud.com:8090/deviceDatas{?page,size,sort}",
      "templated" : true
    },
    "recordedVideos" : {
      "href" : "http://insuvcld.vvdncloud.com:8090/recordedVideos{?page,size,sort}",
      "templated" : true
    },
    "deviceUsers" : {
      "href" : "http://insuvcld.vvdncloud.com:8090/deviceUsers{?page,size,sort}",
      "templated" : true
    },
    "devices" : {
      "href" : "http://insuvcld.vvdncloud.com:8090/devices{?page,size,sort}",
      "templated" : true
    },
    "cameraSettingDetailses" : {
      "href" : "http://insuvcld.vvdncloud.com:8090/cameraSettingDetailses{?page,size,sort}",
      "templated" : true
    },
    "cameraSettingses" : {
      "href" : "http://insuvcld.vvdncloud.com:8090/cameraSettingses{?page,size,sort}",
      "templated" : true
    },
    "profile" : {
      "href" : "http://insuvcld.vvdncloud.com:8090/profile"
    }
  }
}
2020.09.10 08:16:20 4:  test8090: Read found charset header and set decoding to UTF-8 (bodyDecode was set to auto)
2020.09.10 08:16:20 4:  test8090: Read is decoding the buffer as UTF-8
2020.09.10 08:16:20 5:  test8090: JSON Flatter called : prefix , ref is HASH(0x55b100338b88)
2020.09.10 08:16:20 5:  test8090: JSON Flatter doing recursion because value is a HASH
2020.09.10 08:16:20 5:  test8090: JSON Flatter called : prefix _links_, ref is HASH(0x55b100909650)
2020.09.10 08:16:20 5:  test8090: JSON Flatter doing recursion because value is a HASH
2020.09.10 08:16:20 5:  test8090: JSON Flatter called : prefix _links_deviceDatas_, ref is HASH(0x55b0fed4bce8)
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_deviceDatas_templated to 1
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_deviceDatas_href to http://insuvcld.vvdncloud.com:8090/deviceDatas{?page,size,sort}
2020.09.10 08:16:20 5:  test8090: JSON Flatter doing recursion because value is a HASH
2020.09.10 08:16:20 5:  test8090: JSON Flatter called : prefix _links_modeEventses_, ref is HASH(0x55b0ff74a640)
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_modeEventses_href to http://insuvcld.vvdncloud.com:8090/modeEventses{?page,size,sort}
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_modeEventses_templated to 1
2020.09.10 08:16:20 5:  test8090: JSON Flatter doing recursion because value is a HASH
2020.09.10 08:16:20 5:  test8090: JSON Flatter called : prefix _links_cameraSettingDetailses_, ref is HASH(0x55b0fe0266f0)
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_cameraSettingDetailses_href to http://insuvcld.vvdncloud.com:8090/cameraSettingDetailses{?page,size,sort}
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_cameraSettingDetailses_templated to 1
2020.09.10 08:16:20 5:  test8090: JSON Flatter doing recursion because value is a HASH
2020.09.10 08:16:20 5:  test8090: JSON Flatter called : prefix _links_cameraModeses_, ref is HASH(0x55b0fea0ef30)
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_cameraModeses_href to http://insuvcld.vvdncloud.com:8090/cameraModeses{?page,size,sort}
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_cameraModeses_templated to 1
2020.09.10 08:16:20 5:  test8090: JSON Flatter doing recursion because value is a HASH
2020.09.10 08:16:20 5:  test8090: JSON Flatter called : prefix _links_profile_, ref is HASH(0x55b0fe398558)
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_profile_href to http://insuvcld.vvdncloud.com:8090/profile
2020.09.10 08:16:20 5:  test8090: JSON Flatter doing recursion because value is a HASH
2020.09.10 08:16:20 5:  test8090: JSON Flatter called : prefix _links_deviceUsers_, ref is HASH(0x55b0fddde7e0)
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_deviceUsers_href to http://insuvcld.vvdncloud.com:8090/deviceUsers{?page,size,sort}
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_deviceUsers_templated to 1
2020.09.10 08:16:20 5:  test8090: JSON Flatter doing recursion because value is a HASH
2020.09.10 08:16:20 5:  test8090: JSON Flatter called : prefix _links_devices_, ref is HASH(0x55b0fef3bf70)
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_devices_href to http://insuvcld.vvdncloud.com:8090/devices{?page,size,sort}
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_devices_templated to 1
2020.09.10 08:16:20 5:  test8090: JSON Flatter doing recursion because value is a HASH
2020.09.10 08:16:20 5:  test8090: JSON Flatter called : prefix _links_recordedVideos_, ref is HASH(0x55b0fe564020)
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_recordedVideos_href to http://insuvcld.vvdncloud.com:8090/recordedVideos{?page,size,sort}
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_recordedVideos_templated to 1
2020.09.10 08:16:20 5:  test8090: JSON Flatter doing recursion because value is a HASH
2020.09.10 08:16:20 5:  test8090: JSON Flatter called : prefix _links_cameraSettingses_, ref is HASH(0x55b0fe5977d0)
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_cameraSettingses_href to http://insuvcld.vvdncloud.com:8090/cameraSettingses{?page,size,sort}
2020.09.10 08:16:20 5:  test8090: JSON Flatter sets _links_cameraSettingses_templated to 1
2020.09.10 08:16:20 4:  test8090: extracted JSON values to internal
2020.09.10 08:16:20 5:  test8090: GetCookies is looking for Cookies
2020.09.10 08:16:20 5:  test8090: ExtractSid called, context reading, num
2020.09.10 08:16:20 4:  test8090: checking for redirects, code=200, ignore=0
2020.09.10 08:16:20 4:  test8090: no redirects to handle
2020.09.10 08:16:20 5:  test8090: CheckAuth decided no authentication required
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_modeEventses_href to value http://insuvcld.vvdncloud.com:8090/modeEventses{?page,size,sort} of JSON _links_modeEventses_href
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_deviceDatas_href to value http://insuvcld.vvdncloud.com:8090/deviceDatas{?page,size,sort} of JSON _links_deviceDatas_href
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_cameraModeses_templated to value 1 of JSON _links_cameraModeses_templated
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_cameraSettingDetailses_templated to value 1 of JSON _links_cameraSettingDetailses_templated
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_cameraSettingDetailses_href to value http://insuvcld.vvdncloud.com:8090/cameraSettingDetailses{?page,size,sort} of JSON _links_cameraSettingDetailses_href
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_cameraSettingses_href to value http://insuvcld.vvdncloud.com:8090/cameraSettingses{?page,size,sort} of JSON _links_cameraSettingses_href
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_profile_href to value http://insuvcld.vvdncloud.com:8090/profile of JSON _links_profile_href
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_recordedVideos_href to value http://insuvcld.vvdncloud.com:8090/recordedVideos{?page,size,sort} of JSON _links_recordedVideos_href
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_deviceUsers_templated to value 1 of JSON _links_deviceUsers_templated
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_devices_href to value http://insuvcld.vvdncloud.com:8090/devices{?page,size,sort} of JSON _links_devices_href
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_deviceUsers_href to value http://insuvcld.vvdncloud.com:8090/deviceUsers{?page,size,sort} of JSON _links_deviceUsers_href
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_modeEventses_templated to value 1 of JSON _links_modeEventses_templated
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_devices_templated to value 1 of JSON _links_devices_templated
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_cameraModeses_href to value http://insuvcld.vvdncloud.com:8090/cameraModeses{?page,size,sort} of JSON _links_cameraModeses_href
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_cameraSettingses_templated to value 1 of JSON _links_cameraSettingses_templated
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_deviceDatas_templated to value 1 of JSON _links_deviceDatas_templated
2020.09.10 08:16:20 5:  test8090: Read sets reading _links_recordedVideos_templated to value 1 of JSON _links_recordedVideos_templated
2020.09.10 08:16:20 5:  test8090: UpdateReadingList created list of reading.* nums to parse during getUpdate as
2020.09.10 08:16:20 5:  test8090: Read starts parsing response to update with defined readings:
2020.09.10 08:16:20 4:  test8090: Read response matched 17, unmatch 0 Reading(s)
2020.09.10 08:16:20 5:  test8090: Read response to update matched _links_modeEventses_href _links_deviceDatas_href _links_cameraModeses_templated _links_cameraSettingDetailses_templated _links_cameraSettingDetailses_href _links_cameraSettingses_href _links_profile_href _links_recordedVideos_href _links_deviceUsers_templated _links_devices_href _links_deviceUsers_href _links_modeEventses_templated _links_devices_templated _links_cameraModeses_href _links_cameraSettingses_templated _links_deviceDatas_templated _links_recordedVideos_templated
2020.09.10 08:16:20 5:  test8090: HandleSendQueue called, qlen = 0


Wolltest du schauen ob der Port doch irgendwie belegt ist?

Grüße

amenomade

Zitat von: Esjay am 10 September 2020, 08:20:41


Wolltest du schauen ob der Port doch irgendwie belegt ist?

Grüße
Also... ob die Antwort irgendwie geblockt oder gefangen wird. Aber der Test hat eigentlich wenig Sinn, da die Request von innen kommt. Ich weiss nur nicht mehr, wo genau zu suchen. In einem normalen Host hätte ich noch ein "sudo netstat -tulnp |grep 8090" vorgeschlagen.
Läuft dieser Webserver 192.168.178.76:8090 im gleichen Container wie Fhem?

Ich sehe nur noch die Möglichkeit, den Traffic mit tcpdump o.ä zu sniffen...
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Esjay

Nee, das Hyperion läuft auf einem separaten Pi.
Habe da auch schon alles an Authentifizierung abgeschaltet, um sicherzugehen, dass dort nichts dazwischen haut. Aber selbst wenn da eine Authentifizierung fehlt, müsste er es in der Response anmeckern.

Ich danke dir auf jeden Fall schonmal für deinen langen Atem.

Im Hyperion Forum habe ich den Hinweis gefunden, dass dort jemand über Node-red geht.
Da ich Node-Red <-->Fhem schon in einem anderen Projekt im Einsatz habe, werde ich wohl diesen Ansatz parallel verfolgen.

Nächste Möglichkeit wäre vll über eine sub zu gehen.

https://forum.fhem.de/index.php?topic=88104.0

Oder jemandem fällt noch irgendetwas ein.

Grüße

Esjay

So habs geschafft.
Hinweis auf die Http Version hat den Durchbruch gebracht.

Lösung:
defmod MyDevice HTTPMOD none 0
attr MyDevice userattr set01Data set01Name set01TextArg:0,1 set01URL setHeader1
attr MyDevice DbLogExclude .*
attr MyDevice httpVersion 1.1
attr MyDevice set01Data {"command":"componentstate","componentstate":{"component":"LEDDEVICE","state":$val}}
attr MyDevice set01Name LEDDevice
attr MyDevice set01TextArg 1
attr MyDevice set01URL http://192.168.178.76:8090/json-rpc
attr MyDevice setHeader1 Content-Type: application/json
attr MyDevice showBody 1
attr MyDevice showError 1
attr MyDevice verbose 5


2020.09.10 12:57:57 1:  Logfile gelöscht
2020.09.10 12:58:07 5:  MyDevice: set called with LEDDevice false
2020.09.10 12:58:07 5:  MyDevice: set found option LEDDevice in attribute set01Name
2020.09.10 12:58:07 4:  MyDevice: set will now set LEDDevice -> false
2020.09.10 12:58:07 5:  MyDevice: AddToQueue adds type set01 to URL http://192.168.178.76:8090/json-rpc, data {"command":"componentstate","componentstate":{"component":"LEDDEVICE","state":$val}}, header Content-Type: application/json, retry 0, initial queue len: 0
2020.09.10 12:58:07 5:  MyDevice: HandleSendQueue called, qlen = 1
2020.09.10 12:58:07 4:  MyDevice: HandleSendQueue sends set01 with timeout 2 to http://192.168.178.76:8090/json-rpc,
data: {"command":"componentstate","componentstate":{"component":"LEDDEVICE","state":false}},
header: Content-Type: application/json
2020.09.10 12:58:07 5:  HttpUtils url=http://192.168.178.76:8090/json-rpc
2020.09.10 12:58:07 4:  IP: 192.168.178.76 -> 192.168.178.76
2020.09.10 12:58:08 5:  HttpUtils request header:
POST /json-rpc HTTP/1.1
Host: 192.168.178.76:8090
User-Agent: fhem
Accept-Encoding: gzip,deflate
Connection: Close
Content-Type: application/json
Content-Length: 85

2020.09.10 12:58:08 4:  http://192.168.178.76:8090/json-rpc: HTTP response code 200
2020.09.10 12:58:08 5:  HttpUtils http://192.168.178.76:8090/json-rpc: Got data, length: 71
2020.09.10 12:58:08 5:  HttpUtils response header:
HTTP/1.1 200 OK.
Content-Type: application/json
Server: Hyperion Webserver
Date: Thu, 10 Sep 2020 10:58:08 UTC
Content-Length: 71
2020.09.10 12:58:08 4:  MyDevice: Read callback: request type was set01 retry 0,
header: HTTP/1.1 200 OK.
Content-Type: application/json
Server: Hyperion Webserver
Date: Thu, 10 Sep 2020 10:58:08 UTC
Content-Length: 71, body length 71
2020.09.10 12:58:08 5:  MyDevice: Read callback: body
{
    "command": "componentstate",
    "success": true,
    "tan": 0
}

2020.09.10 12:58:08 4:  MyDevice: Read found no charset header (bodyDecode was set to auto)
2020.09.10 12:58:08 5:  MyDevice: GetCookies is looking for Cookies
2020.09.10 12:58:08 5:  MyDevice: ExtractSid called, context set, num 01
2020.09.10 12:58:08 4:  MyDevice: checking for redirects, code=200, ignore=0
2020.09.10 12:58:08 4:  MyDevice: no redirects to handle
2020.09.10 12:58:08 5:  MyDevice: CheckAuth decided no authentication required