diff --git a/fhem/CHANGED b/fhem/CHANGED
index 15ee43c00..a2e1c412a 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,6 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- SVN
+ - feature: jsonlist2 added, jsonlist is deprecated.
- change: renamed 98_configDB to 98_configDBwrap
- feature: DbLog: Added new function : ReadingsVal/ReadingsTimestamp
- feature: Text2Speech: added new attribute TTS_VolumeAdjust
diff --git a/fhem/FHEM/98_JsonList.pm b/fhem/FHEM/98_JsonList.pm
index 5a75e0f56..eb8e56bd6 100644
--- a/fhem/FHEM/98_JsonList.pm
+++ b/fhem/FHEM/98_JsonList.pm
@@ -406,6 +406,9 @@ CommandJsonList($$)
JsonList
+ Note: this command is deprecated, use jsonlist2 instead.
+
jsonlist [<devspec>|<typespec>|ROOMS]
Returns an JSON tree of all definitions, all notify settings and all at
diff --git a/fhem/FHEM/98_JsonList2.pm b/fhem/FHEM/98_JsonList2.pm
new file mode 100644
index 000000000..cbfdfc595
--- /dev/null
+++ b/fhem/FHEM/98_JsonList2.pm
@@ -0,0 +1,163 @@
+################################################################
+# $Id: 98_JsonList2.pm 4128 2013-10-29 06:51:24Z rudolfkoenig $
+################################################################
+
+package main;
+use strict;
+use warnings;
+use POSIX;
+
+sub CommandJsonList2($$);
+
+#####################################
+sub
+JsonList2_Initialize($$)
+{
+ my %lhash = ( Fn=>"CommandJsonList2",
+ Hlp=>"[],list definitions as JSON" );
+ $cmds{jsonlist2} = \%lhash;
+}
+
+
+#####################################
+sub
+JsonList2_Escape($)
+{
+ my $a = shift;
+ return "null" if(!defined($a));
+ my %esc = (
+ "\n" => '\n',
+ "\r" => '\r',
+ "\t" => '\t',
+ "\f" => '\f',
+ "\b" => '\b',
+ "\"" => '\"',
+ "\\" => '\\\\',
+ "\'" => '\\\'',
+ );
+ $a =~ s/([\x22\x5c\n\r\t\f\b])/$esc{$1}/eg;
+ return $a;
+}
+
+sub
+JsonList2_dumpHash($$$$$)
+{
+ my ($name, $h, $isReading, $si, $next) = @_;
+ my $ret = "";
+
+ $ret .= " \"$name\": {\n";
+ my @arr = grep { $si || $_ !~ m/^\./ } sort keys %{$h};
+ @arr = grep { !ref($h->{$_}) } @arr if(!$isReading);
+
+ for(my $i2=0; $i2 < @arr; $i2++) {
+ my $k = $arr[$i2];
+ $ret .= " \"".JsonList2_Escape($k)."\": ";
+ if($isReading) {
+ $ret .= "{ \"Value\":\"".JsonList2_Escape($h->{$k}{VAL})."\",";
+ $ret .= " \"Time\":\"".JsonList2_Escape($h->{$k}{TIME})."\" }";
+ } else {
+ $ret .= "\"".JsonList2_Escape($h->{$k})."\"";
+ }
+ $ret .= "," if($i2 < int(@arr)-1);
+ $ret .= "\n";
+ }
+ $ret .= " }".($next ? ",":"")."\n";
+ return $ret;
+}
+
+#####################################
+sub
+CommandJsonList2($$)
+{
+ my ($cl, $param) = @_;
+ my @d;
+ my $ret;
+ my $cnt=0;
+ my $si = AttrVal("global", "showInternalValues", 0);
+
+ if($param) {
+ @d = devspec2array($param);
+
+ } else {
+ @d = keys %defs;
+ $param="";
+
+ }
+
+ $ret = "{\n";
+ $ret .= " \"Arg\":\"".JsonList2_Escape($param)."\",\n",
+ $ret .= " \"Results\": [\n";
+
+ for(my $i1 = 0; $i1 < int(@d); $i1++) {
+ my $d = $d[$i1];
+ next if(IsIgnored($d));
+ $cnt++;
+
+ my $h = $defs{$d};
+ my $n = $h->{NAME};
+ next if(!$h || !$n);
+
+ $ret .= " {\n";
+ $ret .= " \"Name\":\"".JsonList2_Escape($n)."\",\n";
+ $ret .= " \"PossibleSets\":\"".JsonList2_Escape(getAllSets($n))."\",\n";
+ $ret .= " \"PossibleAttrs\":\"".JsonList2_Escape(getAllAttr($n))."\",\n";
+
+ $ret .= JsonList2_dumpHash("Internals", $h, 0, $si, 1);
+ $ret .= JsonList2_dumpHash("Readings", $h->{READINGS}, 1, $si, 1);
+ $ret .= JsonList2_dumpHash("Attributes",$attr{$d}, 0, $si, 0);
+
+ $ret .= " }";
+ $ret .= "," if($i1 < int(@d)-1);
+ $ret .= "\n";
+ }
+
+ $ret .= " ],\n";
+ $ret .= " \"totalResultsReturned\":$cnt\n";
+ $ret .= "}\n";
+ return $ret;
+}
+
+1;
+
+=pod
+
+=begin html
+
+
+JsonList2
+
+ jsonlist [<devspec>]
+
+ This is a command, to be issued on the command line (FHEMWEB or telnet
+ interface). Can also be called via HTTP by
+
+ http://fhemhost:8083/fhem?cmd=jsonlist2&XHR=1
+
+ Returns an JSON tree of the internal values, readings and attributes of the
+ requested definitions.
+ Note: the old command jsonlist (without the 2 as suffix) is deprecated
+ and will be removed in the future
+
+
+=end html
+
+=begin html_DE
+
+
+JsonList2
+
+ jsonlist [<devspec>]
+
+ Dieses Befehl sollte in der FHEMWEB oder telnet Eingabezeile ausgeführt
+ werden, kann aber auch direkt über HTTP abgerufen werden über
+
+ http://fhemhost:8083/fhem?cmd=jsonlist2&XHR=1
+
+ Es liefert die JSON Darstellung der internen Variablen, Readings und
+ Attribute zurück.
+ Achtung: die alte Version dieses Befehls (jsonlist, ohne 2 am Ende) is
+ überholt, und wird in der Zukunft entfernt.
+
+
+=end html_DE
+=cut
diff --git a/fhem/docs/commandref_frame.html b/fhem/docs/commandref_frame.html
index 9e117ddcf..d466ff5ca 100644
--- a/fhem/docs/commandref_frame.html
+++ b/fhem/docs/commandref_frame.html
@@ -51,6 +51,7 @@
include
inform
JsonList
+ JsonList2
list
modify
notice
diff --git a/fhem/docs/commandref_frame_DE.html b/fhem/docs/commandref_frame_DE.html
index f9699a981..a4ed84067 100644
--- a/fhem/docs/commandref_frame_DE.html
+++ b/fhem/docs/commandref_frame_DE.html
@@ -49,6 +49,7 @@
include
inform
JsonList
+ JsonList2
list
modify
notice