Benutzer 189756
Gast
Hallo
ich möchte vom Mediola Gateway die Status auslesen und daraus z.B. den Status des EVENT 03 in eine Variable schreiben.
ich stehe aber auf dem Schlauch. Mit diesem Script:
set theURL to "192.168.1.150/command?XC_FNC=Getstates"
set Status to do shell script "curl " & quoted form of theURL
tell application "JSON Helper"
set myRecord to read JSON fromStatus
return myRecord
end tell
erhalte ich folgendes:
tell current application
do shell script "curl '192.168.1.150/command?XC_FNC=Getstates'"
end tell
tell application "JSON Helper"
read JSON from "{XC_SUC}[{\"type\":\"FS20\",\"adr\":\"b6a301\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"46ea00\",\"state\":\"00:00\"},{\"type\":\"IT\",\"adr\":\"10\",\"state\":\"00:00\"},{\"type\":\"ONOFF\",\"adr\":\"20\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"50\",\"state\":\"on\"},{\"type\":\"FS20\",\"adr\":\"061704\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"4e2c29\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"4d1628\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"586b01\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"124400\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"000000\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"000100\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"000001\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"004080\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"010001\",\"state\":\"10:00\"},{\"type\":\"EVENT\",\"adr\":\"02\",\"state\":\"1\"},{\"type\":\"EVENT\",\"adr\":\"01\",\"state\":\"1\"},{\"type\":\"EVENT\",\"adr\":\"03\",\"state\":\"0\"},{\"type\":\"EVENT\",\"adr\":\"05\",\"state\":\"0\"},{\"type\":\"IT\",\"adr\":\"62e40080\",\"state\":\"00:00\"},{\"type\":\"ONOFF\",\"adr\":\"99\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"11\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"12\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"13\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"14\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"15\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"16\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"17\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"18\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"21\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"22\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"23\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"24\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"25\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"26\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"27\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"28\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"30\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"31\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"32\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"38\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"48\",\"state\":\"on\"},{\"type\":\"EVENT\",\"adr\":\"04\",\"state\":\"0\"},{\"type\":\"EVENT\",\"adr\":\"06\",\"state\":\"1\"},{\"type\":\"IT\",\"adr\":\"e5260080\",\"state\":\"06:00\"},{\"type\":\"STRING\",\"adr\":\"77\",\"state\":\"aabjbjbjbjbjbaj\"},{\"type\":\"EVENT\",\"adr\":\"07\",\"state\":\"0\"},{\"type\":\"EVENT\",\"adr\":\"0A\",\"state\":\"1\"},{\"type\":\"EVENT\",\"adr\":\"09\",\"state\":\"1\"},{\"type\":\"EVENT\",\"adr\":\"08\",\"state\":\"1\"},{\"type\":\"ONOFF\",\"adr\":\"60\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"61\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"62\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"63\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"64\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"29\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"98\",\"state\":\"off\"}]"
end tell
Ergebnis:
""
Warum ist das Ergebnis "", kann mir jemand weiterhelfen?
Danke sehr schon mal
Gruss
Peter
ich möchte vom Mediola Gateway die Status auslesen und daraus z.B. den Status des EVENT 03 in eine Variable schreiben.
ich stehe aber auf dem Schlauch. Mit diesem Script:
set theURL to "192.168.1.150/command?XC_FNC=Getstates"
set Status to do shell script "curl " & quoted form of theURL
tell application "JSON Helper"
set myRecord to read JSON fromStatus
return myRecord
end tell
erhalte ich folgendes:
tell current application
do shell script "curl '192.168.1.150/command?XC_FNC=Getstates'"
end tell
tell application "JSON Helper"
read JSON from "{XC_SUC}[{\"type\":\"FS20\",\"adr\":\"b6a301\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"46ea00\",\"state\":\"00:00\"},{\"type\":\"IT\",\"adr\":\"10\",\"state\":\"00:00\"},{\"type\":\"ONOFF\",\"adr\":\"20\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"50\",\"state\":\"on\"},{\"type\":\"FS20\",\"adr\":\"061704\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"4e2c29\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"4d1628\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"586b01\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"124400\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"000000\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"000100\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"000001\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"004080\",\"state\":\"00:00\"},{\"type\":\"FS20\",\"adr\":\"010001\",\"state\":\"10:00\"},{\"type\":\"EVENT\",\"adr\":\"02\",\"state\":\"1\"},{\"type\":\"EVENT\",\"adr\":\"01\",\"state\":\"1\"},{\"type\":\"EVENT\",\"adr\":\"03\",\"state\":\"0\"},{\"type\":\"EVENT\",\"adr\":\"05\",\"state\":\"0\"},{\"type\":\"IT\",\"adr\":\"62e40080\",\"state\":\"00:00\"},{\"type\":\"ONOFF\",\"adr\":\"99\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"11\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"12\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"13\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"14\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"15\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"16\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"17\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"18\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"21\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"22\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"23\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"24\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"25\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"26\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"27\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"28\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"30\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"31\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"32\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"38\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"48\",\"state\":\"on\"},{\"type\":\"EVENT\",\"adr\":\"04\",\"state\":\"0\"},{\"type\":\"EVENT\",\"adr\":\"06\",\"state\":\"1\"},{\"type\":\"IT\",\"adr\":\"e5260080\",\"state\":\"06:00\"},{\"type\":\"STRING\",\"adr\":\"77\",\"state\":\"aabjbjbjbjbjbaj\"},{\"type\":\"EVENT\",\"adr\":\"07\",\"state\":\"0\"},{\"type\":\"EVENT\",\"adr\":\"0A\",\"state\":\"1\"},{\"type\":\"EVENT\",\"adr\":\"09\",\"state\":\"1\"},{\"type\":\"EVENT\",\"adr\":\"08\",\"state\":\"1\"},{\"type\":\"ONOFF\",\"adr\":\"60\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"61\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"62\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"63\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"64\",\"state\":\"on\"},{\"type\":\"ONOFF\",\"adr\":\"29\",\"state\":\"off\"},{\"type\":\"ONOFF\",\"adr\":\"98\",\"state\":\"off\"}]"
end tell
Ergebnis:
""
Warum ist das Ergebnis "", kann mir jemand weiterhelfen?
Danke sehr schon mal
Gruss
Peter