Drayton Wiser Thermostat Binding

I seem to be getting somewhere slowly but not quite fully understanding

I have added a .things file and .items which now appear in the UI. I thought I could have done this via the browser then link them successfully (but what I have done to get this working goes against the readme example provided by Andrew which I just can’t get to work). I seem to be duplicating titles and headers across 3 different files to get it to work so not sure if i am doing this right (probably not).

I can see actual temperature now and added target temp. I can step up half a degree (have to refresh page every time to see this) but it doesn’t actually do anything with the controller.

If I close the browser down and back in its back to 0C

I also have a message saying SSE subscription failed. Running in fallback mode. What’s that all about?

Cheers

ok, I have something productive to share now. I have given up with sitemaps for the moment and am playing about with paperui and the data that’s coming through to that.

I have made my home.items file and populated it with as much channels as I can.

However I have a few queries.

Set Points don’t work. When I set any temperature it reverts back. On looking at the log there is a java exception (below)

Is there currently any way to set up schedules?

This is a fantastic project and would be happy to assist any testing that needs to be done.

2018-12-26 17:14:05.562 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.draytonwiser.handler.RoomHandler@92f23b': For input string: "15 °C"
java.lang.NumberFormatException: For input string: "15 °C"
	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:65) ~[?:?]
	at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]
	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [102:org.eclipse.smarthome.core:0.10.0.oh240]
	at com.sun.proxy.$Proxy122.handleCommand(Unknown Source) [198:org.openhab.binding.draytonwiser:2.4.0.201811252103]
	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]
	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]
	at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
	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) [?:?]

Still struggling with this one. Anyone with any thoughts?

It’s still throwing the java exception when trying to change the set point no matter what I tweak.

Also, is there any future thoughts on integrating scheduling?

The secret key can only be obtained by putting the heathub into setup mode (or use a packet sniffer):

Enable setup mode on the HeatHub. Connect a machine temporarily to the WiserHeat_XXXXX network and browse to http://192.168.8.1/secret to obtain the secret.

If you try and get hold of the secret when the heathub is in normal mode, it will return a 401.

Yeah, so it looks like I’ve broken the setpoint functionality whilst trying to cleanup the code for the pull request. Unit of measure seem to end of sending different values to the binding, so I’ll need to fix that.

At the moment there is very low level access to the scheduling. Basically you have to send the raw json to the masterSchedule channel of a room. You can also get the current schedule by reading this channel.
This is likely to go away in the near future, as apparently this isn’t normally allowed in openhab bindings, as everything should be more abstracted.

Hi Andrew,

Thank you (and for all the great work have put into this). I look forward to the set point fix!

Would there be a workaround to the scheduling that can be easily put into a sitemap? - I am hoping to be totally self-suffient with this, being able to control the system in-house with no reliance in their app or the ‘cloud’

I’ve just pushed a fix for the setpoint issue. The build is running on jenkins now, and I’ll try and update the link in the PR to point to the new version when it finishes (it has to target 2.5.0 now, so the old link will stop working).

I’ve also updated the readme with some better examples of .items and .things files.

Edit: Download link updated in PR.

Perfect. Just updated it and all is good.

With regards to the scheduling, I can see the json data but is there a way to work with it (edit and send back from a sitemap) or is this view only?

John

Currently, you can send back the edited JSON to the same channel. I managed to get it working via a rule that fired when I pressed a button (like a heating “scene”). Unfortunately, my RaspberryPI broke, and I didn’t take a copy of the rules/sitemap I used :frowning:

ah, interesting.

Pity about the Pi. If you have any pointers on how you did it let me know and I can have a play about.

Cheers

This will probably help get you started if you wanted to use a “scene based” schedule:

Just use sendCommand(“json”) to send json to the room channel on the draytonwiser binding.

It’ll probably need some trial and error, and might end up with you accidentally wiping your current schedules though.

It’s not a full blown schedule configuration, but it my case I had it set up for things like “Working from home” -> turned the heating up in the office during the working day, otherwise turn the heating off, “Have Guests” -> altered the schedule of the spare room which would otherwise be kept cool etc.

1 Like

I am working on this just now making up my own timeclocks, all going well for the trv’s etc however I am trying to set up a similar schedule arrangement for the hot water side but I can’t see a item in the binding for hot water masterschedule. Is there one available but hidden?

Hello.

I have installed this binding and set everything up through Paper UI.

After I added my Heat Huh three were three “Things” that came up on my Inbox.
Controller
Living Room
Living Room - Thermostat.

I added all them and I have linked channels to items and everything is working although the Controller is show a communication error.

Status: OFFLINE - COMMUNICATION_ERROR java.lang.NumberFormatException: Expected an int but was 3397440534 at line 1 column 444 path $.DhcpStatus.LeaseStartTime

and when I use the Away Mode Active channel to toggle the away mode it does change on the Heat Hub but I get the following error in my log file.

2019-01-28 19:51:23.174 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.draytonwiser.handler.ControllerHandler@4332be': java.lang.NumberFormatException: Expected an int but was 3397440534 at line 1 column 444 path $.DhcpStatus.LeaseStartTime
com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 3397440534 at line 1 column 444 path $.DhcpStatus.LeaseStartTime
	at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:245) ~[21:com.google.gson:2.7.0.v20170129-0911]
	at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:235) ~[21:com.google.gson:2.7.0.v20170129-0911]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129) ~[21:com.google.gson:2.7.0.v20170129-0911]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) ~[21:com.google.gson:2.7.0.v20170129-0911]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129) ~[21:com.google.gson:2.7.0.v20170129-0911]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) ~[21:com.google.gson:2.7.0.v20170129-0911]
	at com.google.gson.Gson.fromJson(Gson.java:887) ~[21:com.google.gson:2.7.0.v20170129-0911]
	at com.google.gson.Gson.fromJson(Gson.java:852) ~[21:com.google.gson:2.7.0.v20170129-0911]
	at com.google.gson.Gson.fromJson(Gson.java:801) ~[21:com.google.gson:2.7.0.v20170129-0911]
	at com.google.gson.Gson.fromJson(Gson.java:773) ~[21:com.google.gson:2.7.0.v20170129-0911]
	at org.openhab.binding.draytonwiser.handler.HeatHubHandler.getStation(HeatHubHandler.java:316) ~[?:?]
	at org.openhab.binding.draytonwiser.handler.ControllerHandler.updateControllerData(ControllerHandler.java:133) ~[?:?]
	at org.openhab.binding.draytonwiser.handler.ControllerHandler.setAwayMode(ControllerHandler.java:238) ~[?:?]
	at org.openhab.binding.draytonwiser.handler.ControllerHandler.handleCommand(ControllerHandler.java:74) ~[?:?]
	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.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]
	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [102:org.eclipse.smarthome.core:0.10.0.oh240]
	at com.sun.proxy.$Proxy140.handleCommand(Unknown Source) [209:org.openhab.binding.draytonwiser:2.5.0.201901032156]
	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]
	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]
	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.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
	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.lang.NumberFormatException: Expected an int but was 3397440534 at line 1 column 444 path $.DhcpStatus.LeaseStartTime
	at com.google.gson.stream.JsonReader.nextInt(JsonReader.java:1164) ~[?:?]
	at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:243) ~[?:?]
	... 32 more

Any ideas on what could be causing this?

I am not overly worried at the moment as it is working but just causing errors in the log.

Thanks.

Looks like a bug to me.

I’m trying to pull as much data from the heat hub as I can, and the dhcp lease is one of those properties. However it seems that I’m using the wrong data type in my data structure, (int instead of long most likely), so it is throwing a parsing exception.

This won’t affect the binding as this property isn’t exposed or used anywhere, but I’ll get it fixed regardless.

I set everything up through Paper UI and it is working great but everything else I have setup through thing files.

Can somebody please give me an example or point me to any documentation on how to setup the Hub, Controller, Room and Thermostat as I just cant seem to get it working at all.

Thanks.

Have you looked at the readme here: https://github.com/andrew-schofield/openhab2-addons/tree/draytonwiser/addons/binding/org.openhab.binding.draytonwiser#full-example

I’ve copied those examples from my own setup.

I knew I was being blind and not spotting some documentation.

All sorted now.

Thanks.

1 Like

Is it possible to see and set the heating schedule similar to ‘masterschedule’ with the heating side?

I still can’t see heating masterschedule as an option, maybe i’m missing it?

Thanks

No, currently the binding doesn’t have the masterSchedule item on the hotwater thing.

Thanks Andrew, is there any plans to add it in the future? - It would be handy during the summer months as I have a working timeclock solution managing the heating side quite well which would transfer across to the hot water.