NEWS
So eine Art XML Parser?
-
Hallo Zusammen,
ist es mit einfachen Boardmitteln möglich folgendes in ein json Format, oder so zu parsen, damit man es
erstens: als Datenpunkte nutzen kann
zweitens: in einer Tabelle in VIS darstellen kann
<cgi_result><result>0</result> <ioalarm>0</ioalarm> <motiondetectalarm>1</motiondetectalarm> <soundalarm>0</soundalarm> <record>0</record> <sdstate>0</sdstate> <sdfreespace>0k</sdfreespace> <sdtotalspace>0k</sdtotalspace> <ntpstate>1</ntpstate> <ddnsstate>0</ddnsstate> <upnpstate>1</upnpstate> <iswificonnected>1</iswificonnected> <wificonnectedap>QSH</wificonnectedap> <infraledstate>0</infraledstate></cgi_result>
Den String bekomme ich aus einem NodeRed Flow, der in einen Datenpunkt "String" geschrieben wird.
Danke und schöne Grüße
-
Japp gibt es:
Das Nodejs modul xml2js im Javascript Adapter eintragen.
Und hier ein Beispiel zur Nutzung: http://forum.iobroker.net/viewtopic.php?t=860#p6397