Drayton Wiser Thermostat Binding

(ultraviolet) #101

…and a quick screenshot of data pulled into HABPanel. No hot water data yet of course…

(Andrew Schofield) #102

Cool! Can you post that as the raw JSON please? If you’re comfortable posting it, the whole of /data/domain/ would be helpful (for checking things like schedule mapping etc), PM is fine if you don’t want to post or publicly.

Edit: I’ve just pushed an update that correctly updates the domain data whenever your push an update (like changing a setpoint etc). This should prevent the weirdness where PaperUI changes the value back and forth.

(Sajid) #103

Hi Guys,

I am trying to get some graphs that will show me how often my boiler kicks in and at what %, so far I managed to get something like this:

The main issue I have is that the controller stops “reporting” to our binding?

"HeatingChannel": [
            "id": 1,
            "Name": "Channel-1",
            "RoomIds": [
            "PercentageDemand": 0,
            "DemandOnOffOutput": "Off",
            "HeatingRelayState": "Off",
            "IsSmartValvePreventingDemand": true

Why it is being reported as a NaN, is there any way to fix this?


(Andrew Schofield) #104

It’s less than ideal at the moment, but when you first load PaperUI it will show NaNs for a number of items. If you leave PaperUI open it should never get into this state unless something goes wrong.

I’m hoping to spend a bit more time working on the binding this evening which might include a fix for this.

Are you sure the boiler is definitely “on” when the graph is showing “off”.

Out of interest, what persistence and charting are you using for those graphs.

Also, if you enclose your API responses in ```json here``` it formats nicely on the forum

(Sajid) #105

Thanks for the formatting tip :slight_smile:

I am sure the boiler is ON, but in the graph is showing as OFF because of the “NaN”, and I am also checking PaperUI (even if I keep it open for longer periods of time at some point it changes to “NAN” without any apparent reason).

Is there anything I can do to help troubleshoot the issue so you can have a better understanding on what is broken?


(Andrew Schofield) #106

Hmm, that is interesting. I wonder if anything is being dumped to the logs that would explain it? I’ve not seen the values switch back to NaN unless I restart openHAB, although at the moment I’m running it permanently through eclipse whilst I’m developing the new binding.

(Andrew Schofield) #107

So I’ve just added readonly support for the hot water relay state on the controller. As far as I can tell it should work, but I’ve no way of testing it myself.

@ultraviolet would you mind getting a bunch of /data/domain/ responses after you do various things to your hot water system (auto to manual, boosting etc) so I can see what the possible values for some of the fields are?
Also, are you able to install a packet sniffer on your phone? I can probably guess what messages are sent to the hot water channel based on what I now already, but it would be useful to check exactly what the app sends which you change various states.

@jimmyss04 I’m afraid I haven’t made any progress on the missing value issue, except to note that if PaperUI is updating correctly it should display “-” rather than NaN for missing values, so it does look like something odd is going on in your case.

(ultraviolet) #108

I’ll have a look at the hot water this weekend. I can’t get packet sniffer on iphone as far as I know but I should be able to set up my computer as a proxy I think and capture that way.

Also I was thinking we should add Lqi as well as signal strength. Could be useful for debugging connection issues.

(Sajid) #109

It seems that the exception below started the issue:

java.lang.NullPointerException: null
        at org.openhab.binding.draytonwiser.internal.discovery.DraytonWiserDiscoveryService.onControllerAdded(DraytonWiserDiscoveryService.java:85) [202:org.openhab.binding.draytonwiser:]
        at org.openhab.binding.draytonwiser.internal.discovery.DraytonWiserDiscoveryService.startScan(DraytonWiserDiscoveryService.java:66) [202:org.openhab.binding.draytonwiser:]
        at org.eclipse.smarthome.config.discovery.AbstractDiscoveryService.startScan(AbstractDiscoveryService.java:222) [104:org.eclipse.smarthome.config.discovery:0.10.0.b1]
        at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.startScan(DiscoveryServiceRegistryImpl.java:409) [104:org.eclipse.smarthome.config.discovery:0.10.0.b1]
        at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.startScans(DiscoveryServiceRegistryImpl.java:385) [104:org.eclipse.smarthome.config.discovery:0.10.0.b1]
        at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.startScan(DiscoveryServiceRegistryImpl.java:241) [104:org.eclipse.smarthome.config.discovery:0.10.0.b1]
        at org.eclipse.smarthome.io.rest.core.internal.discovery.DiscoveryResource.scan(DiscoveryResource.java:97) [126:org.eclipse.smarthome.io.rest.core:0.10.0.b1]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) [15:com.eclipsesource.jaxrs.publisher:]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [85:org.eclipse.jetty.security:9.3.22.v20171030]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.Server.handle(Server.java:534) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [79:org.eclipse.jetty.io:9.3.22.v20171030]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [79:org.eclipse.jetty.io:9.3.22.v20171030]
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [79:org.eclipse.jetty.io:9.3.22.v20171030]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [90:org.eclipse.jetty.util:9.3.22.v20171030]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [90:org.eclipse.jetty.util:9.3.22.v20171030]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [90:org.eclipse.jetty.util:9.3.22.v20171030]

And after few minutes and many times until I restarted openhab2 I was getting the exception below:

2018-01-31 22:00:13.879 [ERROR] [ome.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: For input string: "REFRESH"
java.lang.NumberFormatException: For input string: "REFRESH"
        at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043) ~[?:?]
        at sun.misc.FloatingDecimal.parseFloat(FloatingDecimal.java:122) ~[?:?]
        at java.lang.Float.parseFloat(Float.java:451) ~[?:?]
        at org.openhab.binding.draytonwiser.handler.RoomHandler.handleCommand(RoomHandler.java:54) ~[?:?]
        at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.channelLinked(BaseThingHandler.java:243) ~[?:?]
        at org.eclipse.smarthome.core.thing.link.ThingLinkManager.lambda$0(ThingLinkManager.java:290) ~[?:?]
        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) [?:?]

I will keep an eye on this, however I am happy to see that I can monitor how my boiler is kicking in and out.

I have seen these errors in the logs:

2018-02-01 08:08:28.995 [WARN ] [org.eclipse.jetty.http.HttpParser   ] - parse exception: java.lang.NumberFormatException: !hex 44 in CHUNK_SIZE for HttpReceiverOverHTTP@1abecda(rsp=CONTENT,failure=null)[HttpParser{s=CHUNK_SIZE,3072 of 0}]
2018-02-01 08:48:58.319 [WARN ] [org.eclipse.jetty.http.HttpParser   ] - parse exception: java.lang.NumberFormatException: !hex 44 in CHUNKED_CONTENT for HttpReceiverOverHTTP@fb26ed(rsp=CONTENT,failure=null)[HttpParser{s=CHUNKED_CONTENT,4608 of 0}]

I think now PaperUI won’t update properly, do you have any of these?

I am wondering if I should reset Paper UI config and recreate everything, and then start from a fresh point.


(Andrew Schofield) #110

I’ve pushed another update to git, which should now have a guard around the first error you pointed out. The second one is a bit weird as it seems to be trying to process the refresh message as a request to change the setpoint, so I’ve explicitly told it not to do that.
I’m hoping that this will now fix the issues you’re seeing.

(Sajid) #111

Thanks Andrew, so to update my current binding is just to replace the existing jar file, right?

Last time I downloaded from here, but on github I can only see the code, can’t find the button to download the compiled jar file, please could you help?


(Andrew Schofield) #112

Yes. The jar from the top of the pull request on github should be built from the latest commit.

(Sajid) #113

Hi Andrew, I tried to check github but wasn’t able to find the link to the jar file, is there any chance you can help out please?


(Andrew Schofield) #114

Hey, yeah the PR on github is here: https://github.com/openhab/openhab2-addons/pull/3168 The link to the JAR file is in the first post. That link will always point to the most recent build based on the commits in the PR.

Edit: @Rob_Pope would you mind putting the PR link in the OP so people can find it without trawling through the whole thread?

(Rob Pope) #115

Done :slight_smile:

(Sajid) #116

I am still facing a weird issue where openhab (binding) stops updating, until I restart openhab service…

I can see that most of the times when this happens I have this error in the logs:
2018-02-01 17:12:59.139 [WARN ] [org.eclipse.jetty.http.HttpParser ] - parse exception: java.lang.NumberFormatException: !hex 111 in CHUNKED_CONTENT for HttpReceiverOverHTTP@1fd019e(rsp=CONTENT,failure=null)[HttpParser{s=CHUNKED_CONTENT,8704 of 0}]
2018-02-01 17:42:37.824 [WARN ] [org.eclipse.jetty.http.HttpParser ] - parse exception: java.lang.NumberFormatException: !hex 44 in CHUNK_SIZE for HttpReceiverOverHTTP@ab1414(rsp=CONTENT,failure=null)[HttpParser{s=CHUNK_SIZE,4608 of 0}]

I am seriously considering reseting all the configuration in openhab, and not sure if I should use the files to do the config or do it from paperUI as before, any advise?


(Andrew Schofield) #117

That almost looks like the http response is invalid and it then just bombs out entirely. Are there any associated line numbers in the logs, or do you literally just get that error message?

I’m going to try and set up some persistence and logging so I can see if this happens to me as well.

(Sajid) #118

Yes that is the whole error messages.

I don’t remember the source (I didn’t write this script), but you can use it to setup persistance and graphs:

# Create InfluxDB and Grafana 4.4.3 (latest)
source /etc/os-release
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
test $VERSION_ID = "8" && echo "deb https://repos.influxdata.com/debian jessie stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
test $VERSION_ID = "9" && echo "deb https://repos.influxdata.com/debian jessie stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
curl https://bintray.com/user/downloadSubjectPublicKey?username=bintray | sudo apt-key add -
[[ $OPSYS == *"BIAN"* ]] && [[ $(uname -m) == *"armv6"* ]] && echo "deb https://dl.bintray.com/fg2it/deb-rpi-1b jessie main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
[[ $OPSYS == *"BIAN"* ]] && [[ $(uname -m) == *"armv7l"* ]] && echo "deb https://dl.bintray.com/fg2it/deb jessie main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt-get -y $AQUIET remove --purge grafana grafana-data
sudo apt-get -y $AQUIET autoremove
sudo apt-get -y update && sudo apt-get install -y apt-transport-https curl influxdb grafana
sudo systemctl daemon-reload
sudo systemctl enable influxdb
sudo systemctl start influxdb
sudo systemctl enable grafana-server
sudo systemctl start grafana-server

EDIT: Just found the source:

If you need any help, let me know.


(Andrew Schofield) #119

Yep, got influxdb running, and grafana, although it’s currently running on Windows, so that was more painful :frowning: .
I’ve set up the latest jar of the binding against production openHAB 2.2.0 (as I couldn’t work out how to get persistence to work in eclipse), so this should closely match your setup I believe.

I’ve linked the heat demands, and temperatures up, so now I just need to leave it a while and see if/when it breaks.

A few assumptions I’ve made about your setup:

  • You’re requesting influxdb updates “every change” rather than “every update”
  • You’re using fill(previous) in grafana so that if the value doesn’t change, it isn’t plotted as null

Edit: In completely unrelated news, I pulled apart the android app the other day (Xamarin, so decompiles to C#), so I can now easily look at what the app sends when it requests certain things of the controller. Interestingly it can request the controller to go into “SoftAP” mode (i.e. setup mode), I’m going to test this to see if this allows access to the secret over the “normal” connection, or whether you still need to connect to

(Sajid) #120

Yes, it is quiet close to my setup I would say, and yes I am updating “every change” instead of “every update”, do you think I should do different?

It is really nice that you were able to decompile the current app, just one side note, the support team told me they were going to release an update of the app very soon.

If you can see the code, can you share the API paths available?