hm-rega terminates with uncaught exception
I just tried to install ioBroker an get an uncaught exception when hm-rega requests state values:
2014-12-11 09:14:12.888 - info: hm-rega.0 got 19 programs 2014-12-11 09:14:13.096 - info: hm-rega.0 added/updated 19 programs 2014-12-11 09:14:13.098 - info: hm-rega.0 deleted 0 programs 2014-12-11 09:14:13.107 - info: hm-rega.0 got 28 variables 2014-12-11 09:14:13.906 - info: hm-rega.0 added/updated 28 variables 2014-12-11 09:14:13.908 - info: hm-rega.0 deleted 0 variables 2014-12-11 09:14:13.911 - info: hm-rega.0 request state values 2014-12-11 09:14:16.366 - error: uncaught exception: Unexpected token
2014-12-11 09:14:16.388 - error: SyntaxError: Unexpected token
at Object.parse (native) at /opt/iobroker/adapter/hm-rega/hm-rega.js:479:21 at /opt/iobroker/adapter/hm-rega/lib/rega.js:193:17 at /opt/iobroker/adapter/hm-rega/lib/rega.js:240:29 at Parser.<anonymous> (/opt/iobroker/adapter/hm-rega/node_modules/xml2js/lib/xml2js.js:384:20) at Parser.EventEmitter.emit (events.js:95:17) at Object.onclosetag (/opt/iobroker/adapter/hm-rega/node_modules/xml2js/lib/xml2js.js:348:26) at emit (/opt/iobroker/adapter/hm-rega/node_modules/xml2js/node_modules/sax/lib/sax.js:615:33) at emitNode (/opt/iobroker/adapter/hm-rega/node_modules/xml2js/node_modules/sax/lib/sax.js:620:3) at closeTag (/opt/iobroker/adapter/hm-rega/node_modules/xml2js/node_modules/sax/lib/sax.js:861:5) at Object.write (/opt/iobroker/adapter/hm-rega/node_modules/xml2js/node_modules/sax/lib/sax.js:1294:29)2014-12-11 09:14:16.713 - error: controller instance system.adapter.hm-rega.0 terminated with code 6 (uncaught exception) 2014-12-11 09:14:16.714 - info: controller Restart adapter system.adapter.hm-rega.0 because enabled
Debug output of hm-rega:
"BidCos-RF.KEQ0888775:0.STICKY_UNREACH":false, "BidCos-RF.KEQ0888775:0.CONFIG_PENDING":false, "BidCos-RF.KEQ0888775:0.LOWBAT":false, "BidCos-RF.KEQ0888775:0.RSSI_DEVICE":1, "BidCos-RF.KEQ0888775:0.RSSI_PEER":1, "BidCos-RF.KEQ0888775:1.PRESS_SHORT":false, "BidCos-RF.KEQ0888775:1.PRESS_LONG":false, "BidCos-RF.KEQ0888775:2.PRESS_SHORT":false, "BidCos-RF.KEQ0888775:2.PRESS_LONG":false, "BidCos-RF.KEQ0888775:3.PRESS_SHORT":false, "BidCos-RF.KEQ0888775:3.PRESS_LONG":false, "BidCos-RF.KEQ0888775:4.PRESS_SHORT":false, "BidCos-RF.KEQ0888775:4.PRESS_LONG":false} 2014-12-11 09:30:11.431 - error: uncaught exception: Unexpected token
2014-12-11 09:30:11.451 - error: SyntaxError: Unexpected token
at Object.parse (native) at /opt/iobroker/adapter/hm-rega/hm-rega.js:479:21 at /opt/iobroker/adapter/hm-rega/lib/rega.js:193:17 at /opt/iobroker/adapter/hm-rega/lib/rega.js:240:29 at Parser.<anonymous> (/opt/iobroker/adapter/hm-rega/node_modules/xml2js/lib/xml2js.js:384:20) at Parser.EventEmitter.emit (events.js:95:17) at Object.onclosetag (/opt/iobroker/adapter/hm-rega/node_modules/xml2js/lib/xml2js.js:348:26) at emit (/opt/iobroker/adapter/hm-rega/node_modules/xml2js/node_modules/sax/lib/sax.js:615:33) at emitNode (/opt/iobroker/adapter/hm-rega/node_modules/xml2js/node_modules/sax/lib/sax.js:620:3) at closeTag (/opt/iobroker/adapter/hm-rega/node_modules/xml2js/node_modules/sax/lib/sax.js:861:5) at Object.write (/opt/iobroker/adapter/hm-rega/node_modules/xml2js/node_modules/sax/lib/sax.js:1294:29)2014-12-11 09:30:11.776 - error: controller instance system.adapter.hm-rega.0 terminated with code 6 (uncaught exception)
hm-rega Version 0.1.12 hm-rpc Version 0.2.9
I try to catch the errors in a new version. Can you check now?
With new version I saw there was a CUxD Variable containing XML Data. I have a weather scipt running which does somethin like this:
dom.GetObject("CUxD.CUX2801001:1.CMD_SETS").State("wget -q -O - '"#url#"'"); dom.GetObject("CUxD.CUX2801001:1.CMD_QUERY_RET").State(1); string wetter_xml = dom.GetObject("CUxD.CUX2801001:1.CMD_RETS").State();
Full script: http://homematic-forum.de/forum/viewtopic.php?f=31&t=17209
I removed the script and everything works fine. These are the first lines of the output:
"CUxD.CUX2801001:1.CMD_EXEC":"", "CUxD.CUX2801001:1.CMD_SETS":"wget -q -O - 'http://api.wunderground.com/api/92976bxxx13353/conditions/lang:DL/q/Germany/Hamm.xml'", "CUxD.CUX2801001:1.CMD_SETL":"", "CUxD.CUX2801001:1.CMD_RETS":" response version 0.1 /version termsofService http://www.wunderground.com/weather/api/d/terms.html /termsofService features feature conditions /feature /features current_observation image url http://icons.wxug.com/graphics/wu2/logo_130x80.png /url title Weather Underground /title link http://www.wunderground.com /link /image display_location ...
Can you add following line into your script just after:
!hier ist die Abfrage mit CUxD
dom.GetObject("CUxD.CUX2801001:1.CMD_SETS").State("wget -q -O - '"#url#"'");
dom.GetObject("CUxD.CUX2801001:1.CMD_QUERY_RET").State(1);
string wetter_xml = dom.GetObject("CUxD.CUX2801001:1.CMD_RETS").State();
dom.GetObject("CUxD.CUX2801001:1.CMD_RETS").State("");
?
There are new lines in the state, that make the problem.
Tried that, but it doesn't seem to fix the error. Also tried single quotes, but same result.
Is this issue still actual?