diff --git a/fhem/CHANGED b/fhem/CHANGED index 3504d36aa..301875e8a 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -22,6 +22,8 @@ - bugfix: CUL_WS rain sensor corr1 fix - feature: FHEMWEB stylesheet attribute repaced with stylesheetPrefix - feature: notify attribute forwardReturnValue + - change: move JsonList from contrib to main-modules + - change: JsonList output optimized and more structured - 2011-07-08 (5.1) diff --git a/fhem/contrib/JsonList/99_JsonList.pm b/fhem/FHEM/99_JsonList.pm similarity index 61% rename from fhem/contrib/JsonList/99_JsonList.pm rename to fhem/FHEM/99_JsonList.pm index 56212593a..9ee24a040 100644 --- a/fhem/contrib/JsonList/99_JsonList.pm +++ b/fhem/FHEM/99_JsonList.pm @@ -1,4 +1,5 @@ ################################################################ +# $Id$ # # Copyright notice # @@ -133,11 +134,11 @@ CommandJsonList($$) my $q = ""; - # Open JSON object + # open JSON object $str = "{\n"; - $str .= sprintf("%*s\"ResultSet\": {\n", $lev, " "); - # Open JSON array - $str .= sprintf("%*s\"Results\": [\n", $lev+2, " "); + $str .= sprintf("%*s\"ResultSet\": \"%s\",\n", $lev, " ","full"); + # open JSON array + $str .= sprintf("%*s\"Results\": [\n", $lev, " "); delete($modules{""}) if(defined($modules{""})); @dc = keys(%defs); @@ -151,18 +152,9 @@ CommandJsonList($$) my $t = $p->{TYPE}; $t = $q if($q ne ""); - $str .= sprintf("} ") if($t eq $lt); - $str .= sprintf("},\n") if($t eq $lt); - - if($t ne $lt) { - $str .= sprintf("} ") if($lt); - $str .= sprintf("}\n") if($lt); - $str .= sprintf("%*s]\n", $lev+6, " ") if($lt); - $str .= sprintf("%*s},\n", $lev+4, " ") if($lt); - #$str .= sprintf("%*s{\n", $lev+4, " "); - $str .= sprintf("%*s\{ \"%s_LIST\": [\n", $lev+4, " ", $t); - } - $lt = $t; + #$str .= sprintf("} ") if($t eq $lt); + #$str .= sprintf("},\n") if($t eq $lt); + #$str .= sprintf("%*s},\n", $lev+6, " ") if($t eq $lt); my $a1 = JsonEscape($p->{STATE}); my $a2 = JsonEscape(getAllSets($d)); @@ -176,35 +168,39 @@ CommandJsonList($$) push @attrs, $k3; } + # close device object + $str .= sprintf("%*s},\n", $lev+6, " ") if($t eq $lt); + + if($t ne $lt) { + # close device opject + $str .= sprintf("%*s}\n", $lev+6, " ") if($lt && $t ne $lt); + #$str .= sprintf("}\n") if($lt); + + # close devices array + $str .= sprintf("%*s]\n", $lev+4, " ") if($lt); + + # close list object + $str .= sprintf("%*s},\n", $lev+2, " ") if($lt); + + #$str .= sprintf("%*s{\n", $lev+4, " "); + # open list object + $str .= sprintf("%*s\{\n", $lev+2, " "); + $str .= sprintf("%*s\"%s\": \"%s\",\n", $lev+4, " ", "list", $t); + + # open devices array + $str .= sprintf("%*s\"%s\": [\n", $lev+4, " ", "devices"); + } + + $lt = $t; + #$str .= sprintf("%*s{\n", $lev+8, " "); - $str .= sprintf("%*s{ \"%s\": { ", $lev+8, " ", $t); - $str .= sprintf("\"name\": \"%s\", ", $d); - $str .= sprintf("\"state\": \"%s\", ", $a1); - $str .= sprintf("\"sets\": [ "); - $ac = @sets; - $cc = 0; - foreach my $set (@sets) { - $str .= sprintf("{ \"VAL\": \"%s\" }", $set); - $cc++; - #$str .= ",\n" if($cc != $ac); - $str .= ", " if($cc != $ac); - #$str .= "\n" if($cc == $ac); - } - $str .= sprintf(" ], "); - $str .= sprintf("\"attrs\": [ "); - $ac = @attrs; - $cc = 0; - foreach my $attr (@attrs) { - $str .= sprintf("{ \"VAL\": \"%s\" }", $attr); - $cc++; - #$str .= ",\n" if($cc != $ac); - $str .= "," if($cc != $ac); - #$str .= "\n" if($cc == $ac); - } - $str .= sprintf(" ], "); + # open device object + $str .= sprintf("%*s{\n", $lev+6, " "); - $str .= sprintf("\"INT\": { "); + #$str .= sprintf("%*s\"name\": \"%s\",\n", $lev+8, " ", $d); + #$str .= sprintf("%*s\"state\": \"%s\",\n", $lev+8, " ", $a1); + #$str .= sprintf("\"INT\": { "); @ac = keys(%{$p}); $ac = 0; foreach my $k (sort @ac) { @@ -215,62 +211,107 @@ CommandJsonList($$) foreach my $c (sort keys %{$p}) { next if(ref($p->{$c})); - $str .= sprintf("\"%s\": \"%s\"", + $str .= sprintf("%*s\"%s\": \"%s\",\n", $lev+8, " ", JsonEscape($c), JsonEscape($p->{$c})); $cc++; #$str .= ",\n" if($cc != $ac || ($cc == $ac && $p->{IODev})); - $str .= ", " if($cc != $ac || ($cc == $ac && $p->{IODev})); + #$str .= ",\n" if($cc != $ac || ($cc == $ac && $p->{IODev})); #$str .= "\n" if($cc == $ac && !$p->{IODev}); } - $str .= sprintf("\"IODev\": \"%s\" ", + $str .= sprintf("%*s\"IODev\": \"%s\",\n", $lev+8, " ", $p->{IODev}{NAME}) if($p->{IODev}); - $str .= sprintf(" }, "); + #$str .= sprintf(" }, "); - $str .= sprintf("\"ATTR\": { "); @ac = keys(%{$attr{$d}}); $ac = @ac; $cc = 0; - foreach my $c (sort keys %{$attr{$d}}) { - $str .= sprintf("\"%s\": \"%s\"", - JsonEscape($c), JsonEscape($attr{$d}{$c})); - $cc++; - #$str .= ",\n" if($cc != $ac); - $str .= ", " if($cc != $ac); - #$str .= "\n" if($cc == $ac); + if($ac != 0) { + $str .= sprintf("%*s\"ATTR\": {\n", $lev+8, " "); + foreach my $c (sort keys %{$attr{$d}}) { + $str .= sprintf("%*s\"%s\": \"%s\"", $lev+10, " ", + JsonEscape($c), JsonEscape($attr{$d}{$c})); + $cc++; + #$str .= ",\n" if($cc != $ac); + $str .= ",\n" if($cc != $ac); + #$str .= "\n" if($cc == $ac); + } + $str .= "\n"; + #$str .= sprintf("%*s]\n", $lev+8, " ") if(!$p->{READINGS}); + #$str .= sprintf("%*s],\n", $lev+8, " ") if($p->{READINGS}); + $str .= sprintf("%*s},\n", $lev+8, " "); + } else { + $str .= sprintf("%*s\"ATTR\": {},\n", $lev+8, " "); } - $str .= sprintf(" }, ") if($p->{READINGS}); - $str .= sprintf(" } ") if(!$p->{READINGS}); + #$str .= sprintf("%*s],\n", $lev+8, " ") if($p->{READINGS}); + #$str .= sprintf("%*s]\n", $lev+8, " ") if(!$p->{READINGS}); my $r = $p->{READINGS}; if($r) { - $str .= sprintf("\"STATE\": { "); + $str .= sprintf("%*s\"READINGS\": [\n", $lev+8, " "); @ac = keys(%{$r}); $ac = @ac; $cc = 0; foreach my $c (sort keys %{$r}) { - $str .= - sprintf("\"%s\": \"%s\", \"measured\": \"%s\"", - JsonEscape($c), JsonEscape($r->{$c}{VAL}), $r->{$c}{TIME}); - $cc++; - #$str .= ",\n" if($cc != $ac); - $str .= ", " if($cc != $ac); - #$str .= "\n" if($cc == $ac); + $str .= sprintf("%*s{\n", $lev+10, " "); + $str .= sprintf("%*s\"%s\": \"%s\",\n", $lev+12, " ", JsonEscape($c), JsonEscape($r->{$c}{VAL})); + $str .= sprintf("%*s\"measured\": \"%s\"\n", $lev+12, " ", $r->{$c}{TIME}); + $cc++; + #$str .= ",\n" if($cc != $ac); + $str .= sprintf("%*s},\n", $lev+10, " ") if($cc != $ac); + $str .= sprintf("%*s}\n", $lev+10, " ") if($cc == $ac); } - $str .= sprintf(" } "); + $str .= sprintf("%*s]\n", $lev+8, " "); + } else { + $str .= sprintf("%*s\"READINGS\": []\n", $lev+8, " "); } + +if($cc gt $ac) { + # corresponding set parameters + $str .= sprintf("%*s\"sets\": [\n", $lev+6, " "); + + $ac = @sets; + $cc = 0; + foreach my $set (@sets) { + $str .= sprintf("%*s\"%s\"", $lev+8, " ", $set); + $cc++; + #$str .= ",\n" if($cc != $ac); + $str .= ",\n" if($cc != $ac); + #$str .= "\n" if($cc == $ac); + } + $str .= sprintf("\n%*s],\n", $lev+6, " "); + + # corresponding attributes + $str .= sprintf("%*s\"attrs\": [\n", $lev+6, " "); + $ac = @attrs; + $cc = 0; + foreach my $attr (@attrs) { + $str .= sprintf("%*s\"%s\"", $lev+8, " ", $attr); + $cc++; + #$str .= ",\n" if($cc != $ac); + $str .= ",\n" if($cc != $ac); + $str .= "\n" if($cc == $ac); + } +} + $tc++; $tr = $tc if($q eq ""); $tr++ if($q ne "" && $p->{TYPE} eq $t); - $str .= sprintf("} ") if(($tc == $dc) || (!$lt)); - $str .= sprintf("}\n") if(($tc == $dc) || (!$lt)); - $str .= sprintf("%*s]\n", $lev+6, " ") if(($tc == $dc) || (!$lt)); + #$str .= sprintf("} ") if(($tc == $dc) || (!$lt)); + #$str .= sprintf("+++}\n") if(($tc == $dc) || (!$lt)); + $str .= sprintf("%*s}\n", $lev+6, " ") if(($tc == $dc) || (!$lt)); } - $str .= sprintf("%*s}\n", $lev+4, " ") if($lt); - $str .= sprintf("%*s],\n", $lev+2, " "); - $str .= sprintf("%*s\"totalResultsAvailable\": %s,\n", $lev+2, " ",$tc); - $str .= sprintf("%*s\"totalResultsReturned\": %s\n", $lev+2, " ",$tr); - $str .= sprintf("%*s}\n", $lev, " "); - $str .= "}"; + $str .= sprintf("%*s]\n", $lev+4, " ") if($lt); + $str .= sprintf("%*s}\n", $lev+2, " ") if($lt); + + # close JSON array + $str .= sprintf("%*s],\n", $lev, " "); + + # return number of results + $str .= sprintf("%*s\"totalResultsReturned\": %s\n", $lev, " ",$tr); + + # close JSON object + $str .= "}\n"; + } else { if($param eq "ROOMS") { my @rooms; @@ -287,24 +328,23 @@ CommandJsonList($$) # Open JSON object $str .= "{\n"; - $str .= sprintf("%*s\"%s\": {\n", $lev, " ", "ResultSet"); + $str .= sprintf("%*s\"%s\": \"%s\",\n", $lev, " ", "ResultSet", "rooms"); # Open JSON array - $str .= sprintf("%*s\"%s\": [", $lev+2, " ", "Results"); + $str .= sprintf("%*s\"%s\": [", $lev, " ", "Results"); for (my $i=0; $i<@rooms; $i++) { - $str .= " }," if($i <= $#rooms && $i > 0); - $str .= sprintf("\n%*s{ \"NAME\": \"%s\"", $lev+4, " ", $rooms[$i]); + $str .= "," if($i <= $#rooms && $i > 0); + $str .= sprintf("\n%*s\"%s\"", $lev+2, " ", $rooms[$i]); $c++; } - $str .= " }\n"; + $str .= "\n"; # Close JSON array - $str .= sprintf("%*s],\n", $lev+2, " "); + $str .= sprintf("%*s],\n", $lev, " "); # Result summary - $str .= sprintf("%*s\"%s\": %s,\n", $lev+2, " ", "totalResultsAvailable", $c); - $str .= sprintf("%*s\"%s\": %s\n", $lev+2, " ", "totalResultsReturned", $c); + #$str .= sprintf("%*s\"%s\": %s,\n", $lev, " ", "totalResultsAvailable", $c); + $str .= sprintf("%*s\"%s\": %s\n", $lev, " ", "totalResultsReturned", $c); # Close JSON object - $str .= sprintf("%*s}\n", $lev, " "); $str .= "}"; } else { @@ -328,9 +368,9 @@ CommandJsonList($$) # Open JSON object $str .= "{\n"; - $str .= sprintf("%*s\"%s\": {\n", $lev, " ", "ResultSet"); + $str .= sprintf("%*s\"%s\": \"%s\",\n", $lev, " ", "ResultSet", "devices#$listDev"); # Open JSON array - $str .= sprintf("%*s\"%s\": [", $lev+2, " ", "Results"); + $str .= sprintf("%*s\"%s\": [", $lev, " ", "Results"); # Sort first by type then by name for my $d (sort { my $x = $modules{$defs{$a}{TYPE}}{ORDER} cmp @@ -338,23 +378,22 @@ CommandJsonList($$) $x = ($a cmp $b) if($x == 0); $x; } keys %defs) { if($defs{$d}{TYPE} eq $param) { my $t = $defs{$d}{TYPE}; - $str .= " }," if($d ne $ld && $lt ne ""); - $str .= sprintf("\n%*s{ \"NAME\": \"%s\", \"STATE\": \"%s\"", - $lev+4, " ", $d, $defs{$d}{STATE}); + $str .= sprintf("\n%*s},",$lev+2, " ") if($d ne $ld && $lt ne ""); + $str .= sprintf("\n%*s{",$lev+2, " "); + $str .= sprintf("\n%*s\"name\": \"%s\",",$lev+4, " ", $d); + $str .= sprintf("\n%*s\"state\": \"%s\"",$lev+4, " ", $defs{$d}{STATE}); $lt = $t; $ld = $d; $c++; } } - $str .= " }\n"; + $str .= sprintf("\n%*s}\n",$lev+2, " "); # Close JSON array - $str .= sprintf("%*s],\n", $lev+2, " "); + $str .= sprintf("%*s],\n", $lev, " "); # Result summary - $str .= sprintf("%*s\"%s\": %s,\n", $lev+2, " ", "totalResultsAvailable", $c); - $str .= sprintf("%*s\"%s\": %s\n", $lev+2, " ", "totalResultsReturned", $c); + $str .= sprintf("%*s\"%s\": %s\n", $lev, " ", "totalResultsReturned", $c); # Close JSON object - $str .= sprintf("%*s}\n", $lev, " "); $str .= "}"; } else { diff --git a/fhem/HISTORY b/fhem/HISTORY index e9405efcc..08be3adb5 100644 --- a/fhem/HISTORY +++ b/fhem/HISTORY @@ -480,4 +480,8 @@ - Introducing 00_TUL.pm and 10_EIB.pm modules for connecting FHEM on EIB. - Thu Aug 04 2011 (Boris) - - enabled logging for 59_Weather.pm \ No newline at end of file + - enabled logging for 59_Weather.pm + +- Thu Dec 01 2011 (Martin F.) + - Move JsonList from contrib to main modules. Jsonlist output is optimized + and now be more structured. diff --git a/fhem/contrib/JsonList/README.JsonList b/fhem/contrib/JsonList/README.JsonList deleted file mode 100644 index 44fda37fc..000000000 --- a/fhem/contrib/JsonList/README.JsonList +++ /dev/null @@ -1,109 +0,0 @@ -JsonList.pm - Copyright (c)2008 Martin Fischer - -Description: - The module JsonList.pm extends FHEM to support a JSON output - similar to FHEM's xmllist. - -Installation: - Copy the script 99_JsonList.pm to FHEM modules directory, e.g. - 'cp 99_JsonList.pm /usr/share/fhem/FHEM' - and restart FHEM. - - Keep your commandref.html up-to-date: - copy the patchfile commandref.html.patch to your directory with - the original commandref.html and type - 'patch < commandref.html.patch' - You can remove the patchfile after this step. - -Usage: - jsonlist [||ROOMS] - - Returns an JSON tree of all definitions, all notify settings and - all at entries if no parameter is given. - - If specifying , then a detailed status for will - be displayed. - - If specifying , then a list with the status for the - defined devices will be displayed, e.g.: - - If specifying ROOMS, then a list with the defined rooms will be - displayed, e.g.: - - Example: - fhem> jsonlist - { - "ResultSet": { - "Results": [ - { "_internal__LIST": [ - { "_internal_": { - "name": "global", - "state": "", - "sets": [ { "VAL": "null" } ], - "attrs": [ { "VAL": "room" },{ "VAL": "comment" }, - [...] - ], - "totalResultsAvailable": 86, - "totalResultsReturned": 86 - } - } - - Example for : - fhem> jsonlist lamp1 - { - "ResultSet": { - "Results": { - "ATTRIBUTES": { - "comment": "Light", - "room": "Livingroom" - }, - "BTN": "f0", - [...] - "NAME": "lamp1", - "NR": "26", - "READINGS": { - "state": { - "TIME": "2008-12-11 18:11:21", - "VAL": "toggle" - } - }, - "STATE": "on", - "TYPE": "FS20", - "XMIT": "0b0b" - } - } - } - - Example for : - fhem> jsonlist HMS - { - "ResultSet": { - "Results": [ - { "NAME": "smokeDetector01", "STATE": "smoke_detect: off" }, - { "NAME": "smokeDetector02", "STATE": "smoke_detect: off" }, - { "NAME": "smokeDetector03", "STATE": "smoke_detect: off" } - ], - "totalResultsAvailable": 3, - "totalResultsReturned": 3 - } - } - - Example for ROOMS: - fhem> jsonlist ROOMS - { - "ResultSet": { - "Results": [ - { "NAME": "Bathroom" }, - { "NAME": "Office" }, - { "NAME": "Diningroom" }, - { "NAME": "Garden" }, - { "NAME": "House" }, - { "NAME": "Bedroom" }, - { "NAME": "Garage" }, - { "NAME": "Livingroom" }, - { "NAME": "hidden" } - ], - "totalResultsAvailable": 9, - "totalResultsReturned": 9 - } - } diff --git a/fhem/contrib/JsonList/commandref.html.patch b/fhem/contrib/JsonList/commandref.html.patch deleted file mode 100644 index 9f1e10fbc..000000000 --- a/fhem/contrib/JsonList/commandref.html.patch +++ /dev/null @@ -1,108 +0,0 @@ ---- commandref.html-orig 2008-12-11 19:37:59.000000000 +0100 -+++ commandref.html 2008-12-11 19:15:02.000000000 +0100 -@@ -27,6 +27,7 @@ - ?,help   - include   - inform   -+ jsonlist   - list   - modify   - quit   -@@ -434,6 +435,97 @@ -
- - -+ -+

jsonlist

-+
    -+ jsonlist [<devspec>|<typespec>|ROOMS] -+

    -+ Returns an JSON tree of all definitions, all notify settings and all at -+ entries if no parameter is given. -+

    -+ Example: -+
      fhem> jsonlist
    -+  {
    -+    "ResultSet": {
    -+      "Results": [
    -+        { "_internal__LIST": [
    -+            { "_internal_": {
    -+              "name": "global",
    -+              "state": "",
    -+              "sets": [ { "VAL": "null" } ],
    -+              "attrs": [ { "VAL": "room" },{ "VAL": "comment" },
    -+        [...]
    -+      ],
    -+      "totalResultsAvailable": 86,
    -+      "totalResultsReturned": 86
    -+    }
    -+  }
    -+  
    -+ If specifying <devspec>, then a detailed status for -+ <devspec> will be displayed, e.g.: -+
      fhem> jsonlist lamp1
    -+  {
    -+    "ResultSet": {
    -+      "Results": {
    -+        "ATTRIBUTES": {
    -+          "comment": "Light",
    -+          "room": "Livingroom"
    -+        },
    -+        "BTN": "f0",
    -+        [...]
    -+        "NAME": "lamp1",
    -+        "NR": "26",
    -+        "READINGS": {
    -+          "state": {
    -+            "TIME": "2008-12-11 18:11:21",
    -+            "VAL": "toggle"
    -+          }
    -+        },
    -+        "STATE": "on",
    -+        "TYPE": "FS20",
    -+        "XMIT": "0b0b"
    -+      }
    -+    }
    -+  }
    -+  
    -+ If specifying <typespec>, then a list with the status for -+ the defined <typespec> devices will be displayed, e.g.: -+
      fhem> jsonlist HMS
    -+  {
    -+    "ResultSet": {
    -+      "Results": [
    -+        { "NAME": "smokeDetector01", "STATE": "smoke_detect: off" },
    -+        { "NAME": "smokeDetector02", "STATE": "smoke_detect: off" },
    -+        { "NAME": "smokeDetector03", "STATE": "smoke_detect: off" }
    -+      ],
    -+      "totalResultsAvailable": 3,
    -+      "totalResultsReturned": 3
    -+    }
    -+  }
    -+  
    -+ If specifying ROOMS, then a list with the defined rooms -+ will be displayed, e.g.: -+
      fhem> jsonlist ROOMS
    -+  {
    -+    "ResultSet": {
    -+      "Results": [
    -+        { "NAME": "Bathroom" },
    -+        { "NAME": "Office" },
    -+        { "NAME": "Diningroom" },
    -+        { "NAME": "Garden" },
    -+        { "NAME": "House" },
    -+        { "NAME": "Bedroom" },
    -+        { "NAME": "Garage" },
    -+        { "NAME": "Livingroom" },
    -+        { "NAME": "hidden" }
    -+      ],
    -+      "totalResultsAvailable": 9,
    -+      "totalResultsReturned": 9
    -+    }
    -+  }
    -+  
    -+
-+ - -

list

-
    diff --git a/fhem/contrib/README b/fhem/contrib/README index dc897d9e0..c5a4ea699 100755 --- a/fhem/contrib/README +++ b/fhem/contrib/README @@ -39,9 +39,6 @@ STefan's "presence simulator" for holidays - garden.pl Garden irrigation regulator with weather dependency (KS300 temp + rain) -- JsonList - 99_JsonList.pm adds a jsonlist command, which is list in JSON format. - See JsonList/README.JsonList for more. By Martin. - fhem-speech Martins instructions on how to make FHEM talk using the MBROLA speech synthesizer diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html index b3edb6f60..413568e92 100644 --- a/fhem/docs/commandref.html +++ b/fhem/docs/commandref.html @@ -39,6 +39,7 @@ ?,help   include   inform   + jsonlist   list   modify   quit   @@ -535,6 +536,155 @@ A line ending with \ will be concatenated with the next one, so long lines
+ +

jsonlist

+
    + jsonlist [<devspec>|<typespec>|ROOMS] +

    + Returns an JSON tree of all definitions, all notify settings and all at + entries if no parameter is given. +

    + Example: +
      fhem> jsonlist
    +  {
    +    "ResultSet": "full",
    +    "Results": [
    +      {
    +        "list": "Global",
    +        "devices": [
    +          {
    +            "DEF": "",
    +            "NAME": "global",
    +            "NR": "1",
    +            "STATE": "",
    +            "TYPE": "Global",
    +            "currentlogfile": "/var/log/fhem/fhem-2011-12.log",
    +            "logfile": "/var/log/fhem/fhem-%Y-%m.log",
    +            "ATTR": {
    +              "configfile": "/etc/fhem/fhem.conf",
    +              "logfile": "/var/log/fhem/fhem-%Y-%m.log",
    +              "modpath": "/usr/share/fhem",
    +              "pidfilename": "/var/run/fhem.pid",
    +              "port": "7072 global",
    +              "room": "Server",
    +              "statefile": "/var/cache/fhem/fhem.save",
    +              "verbose": "4",
    +              "version": "=VERS= from =DATE= ($Id: fhem.pl,v 1.150 2011-08-16 18:06:38 rudolfkoenig Exp $)"
    +            },
    +            "READINGS": []
    +          }
    +        ]
    +      },
    +      {
    +      "list": "CM11",
    +        "devices": [
    +          {
    +            "DEF": "/dev/cm11",
    +            "DeviceName": "/dev/cm11",
    +            "FD": "14",
    +            "NAME": "CM11",
    +            "NR": "19",
    +            "PARTIAL": "null",
    +            "STATE": "Initialized",
    +            "TYPE": "CM11",
    +            "ATTR": {
    +              "model": "CM11"
    +            },
    +            "READINGS": []
    +          }
    +        ]
    +      },
    +      {
    +              [...placeholder for more entrys...]
    +      },
    +    ],
    +    "totalResultsReturned": 235
    +  }
    +  
    + If specifying <devspec>, then a detailed status for + <devspec> will be displayed, e.g.: +
      fhem> jsonlist lamp1
    +  {
    +    "ResultSet": {
    +      "Results": {
    +        "ATTRIBUTES": {
    +          "alias": "Lamp on Sideboard",
    +          "model": "fs20st",
    +          "room": "Livingroom"
    +        },
    +        "BTN": "01",
    +        "CHANGED": "ARRAY",
    +        "CHANGETIME": "ARRAY",
    +        "CODE": {
    +          "1": "0b0b 01",
    +          "2": "0b0b 0f",
    +          "3": "0b0b f0",
    +          "4": "0b0b ff"
    +        },
    +        "DEF": "12341234 1112 lm 1144 fg 4411 gm 4444",
    +        "IODev": "CUN868",
    +        "NAME": "lamp1",
    +        "NR": "155",
    +        "READINGS": {
    +          "state": {
    +            "TIME": "2011-12-01 16:23:01",
    +            "VAL": "on"
    +          }
    +        },
    +        "STATE": "on",
    +        "TYPE": "FS20",
    +        "XMIT": "0b0b"
    +      }
    +    }
    +  }
    +  
    + If specifying <typespec>, then a list with the status for + the defined <typespec> devices will be displayed, e.g.: +
      fhem> jsonlist HMS
    +  {
    +    "ResultSet": "devices#HMS",
    +    "Results": [
    +      {
    +        "name": "KG.ga.WD.01",
    +        "state": "Water Detect: off"
    +      },
    +      {
    +        "name": "KG.hz.GD.01",
    +        "state": "Gas Detect: off"
    +      },
    +      {
    +        "name": "KG.k1.TF.01",
    +        "state": "T: 16.6  H: 51.2  Bat: ok"
    +      },
    +      {
    +        "name": "NN.xx.RM.xx",
    +        "state": "smoke_detect: off"
    +      }
    +    ],
    +    "totalResultsReturned": 4
    +  }
    +  
    + If specifying ROOMS, then a list with the defined rooms + will be displayed, e.g.: +
      fhem> jsonlist ROOMS
    +  {
    +    "ResultSet": "rooms",
    +    "Results": [
    +      "Bathroom",
    +      "Bedroom",
    +      "Children",
    +      "Diningroom",
    +      "Garden",
    +      "House",
    +      "Livingroom",
    +      "Office",
    +      "hidden"
    +    ],
    +    "totalResultsReturned": 15
    +  }
    +  
    +
+

updatefhem