I have a Lutron Lighting system in my home which I openhab successfully connects to and controls…for a while. Then it just dies. I’m getting this in my openhab.log file. Does anyone have any advice on how to fix this.
2016-09-21 07:48:32.572 [ERROR] [scovery.LutronDeviceDiscoveryService] - Error scanning for devices
com.thoughtworks.xstream.io.StreamException: : ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
at com.thoughtworks.xstream.io.xml.StaxReader.pullNextEvent(StaxReader.java:73)[95:org.eclipse.smarthome.config.xml:0.9.0.b1]
at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148)[95:org.eclipse.smarthome.config.xml:0.9.0.b1]
at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:141)[95:org.eclipse.smarthome.config.xml:0.9.0.b1]
at com.thoughtworks.xstream.io.xml.AbstractPullReader.move(AbstractPullReader.java:118)[95:org.eclipse.smarthome.config.xml:0.9.0.b1]
at com.thoughtworks.xstream.io.xml.AbstractPullReader.moveDown(AbstractPullReader.java:103)[95:org.eclipse.smarthome.config.xml:0.9.0.b1]
at com.thoughtworks.xstream.io.xml.StaxReader.(StaxReader.java:45)[95:org.eclipse.smarthome.config.xml:0.9.0.b1]
at com.thoughtworks.xstream.io.xml.StaxDriver.createStaxReader(StaxDriver.java:173)[95:org.eclipse.smarthome.config.xml:0.9.0.b1]
at com.thoughtworks.xstream.io.xml.StaxDriver.createReader(StaxDriver.java:110)[95:org.eclipse.smarthome.config.xml:0.9.0.b1]
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1115)[95:org.eclipse.smarthome.config.xml:0.9.0.b1]
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1062)[95:org.eclipse.smarthome.config.xml:0.9.0.b1]
at org.eclipse.smarthome.config.xml.util.XmlDocumentReader.readFromXML(XmlDocumentReader.java:82)[95:org.eclipse.smarthome.config.xml:0.9.0.b1]
at org.openhab.binding.lutron.internal.discovery.LutronDeviceDiscoveryService.readDeviceDatabase(LutronDeviceDiscoveryService.java:84)[200:org.openhab.binding.lutron:2.0.0.b4]
at org.openhab.binding.lutron.internal.discovery.LutronDeviceDiscoveryService.access$0(LutronDeviceDiscoveryService.java:80)[200:org.openhab.binding.lutron:2.0.0.b4]
at org.openhab.binding.lutron.internal.discovery.LutronDeviceDiscoveryService$1.run(LutronDeviceDiscoveryService.java:67)[200:org.openhab.binding.lutron:2.0.0.b4]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_31]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_31]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_31]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_31]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_31]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_31]
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:601)[:1.8.0_31]
at com.thoughtworks.xstream.io.xml.StaxReader.pullNextEvent(StaxReader.java:58)[95:org.eclipse.smarthome.config.xml:0.9.0.b1]
… 20 more
2016-09-21 21:21:16.070 [ERROR] [nding.lutron.handler.IPBridgeHandler] - Communication error, will try to reconnect
java.io.IOException: Could not write to stream
at org.openhab.binding.lutron.internal.net.TelnetSession.writeLine(TelnetSession.java:218)[200:org.openhab.binding.lutron:2.0.0.b4]
at org.openhab.binding.lutron.handler.IPBridgeHandler.sendCommands(IPBridgeHandler.java:196)[200:org.openhab.binding.lutron:2.0.0.b4]
at org.openhab.binding.lutron.handler.IPBridgeHandler.access$2(IPBridgeHandler.java:188)[200:org.openhab.binding.lutron:2.0.0.b4]
at org.openhab.binding.lutron.handler.IPBridgeHandler$3.run(IPBridgeHandler.java:174)[200:org.openhab.binding.lutron:2.0.0.b4]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_31]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_31]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_31]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_31]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_31]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_31]
2016-09-21 21:21:16.084 [ERROR] [nding.lutron.handler.IPBridgeHandler] - Error disconnecting
java.net.SocketException: Socket closed
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:116)[:1.8.0_31]
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)[:1.8.0_31]
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)[:1.8.0_31]
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)[:1.8.0_31]
at java.io.FilterOutputStream.close(FilterOutputStream.java:158)[:1.8.0_31]
at org.apache.commons.net.telnet.TelnetClient._closeOutputStream(TelnetClient.java:86)[177:org.apache.commons.net:3.2.0]
at org.apache.commons.net.telnet.TelnetOutputStream.close(TelnetOutputStream.java:155)[177:org.apache.commons.net:3.2.0]
at org.apache.commons.net.telnet.TelnetClient.disconnect(TelnetClient.java:127)[177:org.apache.commons.net:3.2.0]
at org.openhab.binding.lutron.internal.net.TelnetSession.close(TelnetSession.java:116)[200:org.openhab.binding.lutron:2.0.0.b4]
at org.openhab.binding.lutron.handler.IPBridgeHandler.disconnect(IPBridgeHandler.java:233)[200:org.openhab.binding.lutron:2.0.0.b4]
at org.openhab.binding.lutron.handler.IPBridgeHandler.reconnect(IPBridgeHandler.java:243)[200:org.openhab.binding.lutron:2.0.0.b4]
at org.openhab.binding.lutron.handler.IPBridgeHandler.sendCommands(IPBridgeHandler.java:204)[200:org.openhab.binding.lutron:2.0.0.b4]
at org.openhab.binding.lutron.handler.IPBridgeHandler.access$2(IPBridgeHandler.java:188)[200:org.openhab.binding.lutron:2.0.0.b4]
at org.openhab.binding.lutron.handler.IPBridgeHandler$3.run(IPBridgeHandler.java:174)[200:org.openhab.binding.lutron:2.0.0.b4]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_31]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_31]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_31]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_31]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_31]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_31]
squishy:logs Michael$
Here’s the change I made to this file: LutronDeviceDiscoveryService.java
Note the getNoPrologURL method. The problem it gets around is that the xml
from Lutron
has a prolog that begins <?xml. The framework can’t handle that
apparently. I haven’t looked at this for months so I can’t help you much
other than that. You could give this to the author or submit a patch.
Maybe with the problem very concisely explained someone actively working in
the framework could integrate it for you too.
Hi. It’s been quite a while since this thread was started, but I wanted to add a quick note. Looking back at the original stack trace, it looks to me like this was actually two separate problems with the binding: one in LutronDeviceDiscoveryService that resulted in an XML parsing error while attempting periodic discovery, and one in IPBridgeHandler that caused the binding to stop working in some cases when communication with the bridge device had been interrupted. This second problem was fixed in the 2.4.0 code in PR #4056, and the fix is now available in 2.4.0 M6.
I haven’t run in to the LutronDeviceDiscoveryService XML parsing error myself, but I’m interested in trying to get your fix for that merged in to the code as well. Unfortunately, it looks like the post containing it was truncated right before the important bit!
This is an old thread, but I recently added my lutron devices, they work great (I had to manually add them). I cannot auto discover the things (I have switches, dimmers and remotes), and I have this entry in the log.
I want to know what I’m doing wrong…Any help?
13:38:44.500 [ERROR] [iscovery.LutronDeviceDiscoveryService] - Error scanning for devices
com.thoughtworks.xstream.io.StreamException: : Connection timed out (Connection timed out)
at com.thoughtworks.xstream.io.xml.StaxDriver.createReader(StaxDriver.java:126) ~[101:org.eclipse.smarthome.config.xml:0.11.0.oh250M1]
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1115) ~[101:org.eclipse.smarthome.config.xml:0.11.0.oh250M1]
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1062) ~[101:org.eclipse.smarthome.config.xml:0.11.0.oh250M1]
at org.eclipse.smarthome.config.xml.util.XmlDocumentReader.readFromXML(XmlDocumentReader.java:85) ~[101:org.eclipse.smarthome.config.xml:0.11.0.oh250M1]
at org.openhab.binding.lutron.internal.discovery.LutronDeviceDiscoveryService.readDeviceDatabase(LutronDeviceDiscoveryService.java:92) ~[218:org.openhab.binding.lutron:2.5.0.M1]
at org.openhab.binding.lutron.internal.discovery.LutronDeviceDiscoveryService.access$0(LutronDeviceDiscoveryService.java:88) ~[218:org.openhab.binding.lutron:2.5.0.M1]
at org.openhab.binding.lutron.internal.discovery.LutronDeviceDiscoveryService$1.run(LutronDeviceDiscoveryService.java:75) [218:org.openhab.binding.lutron:2.5.0.M1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.net.ConnectException: Connection timed out (Connection timed out)
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[?:?]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:?]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:?]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:?]
at java.net.Socket.connect(Socket.java:589) ~[?:?]
at java.net.Socket.connect(Socket.java:538) ~[?:?]
at sun.net.NetworkClient.doConnect(NetworkClient.java:180) ~[?:?]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463) ~[?:?]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558) ~[?:?]
at sun.net.www.http.HttpClient.(HttpClient.java:242) ~[?:?]
at sun.net.www.http.HttpClient.New(HttpClient.java:339) ~[?:?]
at sun.net.www.http.HttpClient.New(HttpClient.java:357) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1040) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1038) ~[?:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
at java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:782) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1037) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection.access$200(HttpURLConnection.java:91) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1484) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1482) ~[?:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
at java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:782) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1481) ~[?:?]
at java.net.URL.openStream(URL.java:1045) ~[?:?]
at com.thoughtworks.xstream.io.xml.StaxDriver.createReader(StaxDriver.java:109) ~[?:?]
… 13 more
Here’s the change I made to this file: LutronDeviceDiscoveryService.java
Note the getNoPrologURL method. The problem it gets around is that the xml from Lutron
has a prolog that begins <?xml. The framework can’t handle that apparently. I haven’t looked at this for months so I can’t help you much other than that. You could give this to the author or submit a patch. Maybe with the problem very concisely explained someone actively working in the framework could integrate it for you too.
Hi Algis. Which Lutron system do you have? Auto-discovery should currently work with Radio RA2 and (probably) HomeWorks QS systems with newer software versions. It will not currently work with Caseta or older HomeWorks QS software versions. Those still need to be configured manually. If you have a Caseta system, then that “Error scanning for devices”/"Connection timed out " error in your log is expected, and you can just ignore it.
I’m currently testing an update to the discovery code in the Lutron binding that will eliminate that error on Caseta systems, allow auto-discovery of Caseta bridge devices via mDNS (but not yet the attached devices), and allow auto-discovery of older HomeWorks QS systems, among other things. I’m hoping to get it in to 2.5.