Drayton Wiser Thermostat Binding


(Andrew Schofield) #304

Are both your lounge TRVs called the same thing?

Even in the log above, the temperature is still flipping back and forth pretty rapidly:

2019-02-18 10:19:39.647 [vent.ItemStateChangedEvent] - LoungeTRV_Temperature changed from 22.1 °C to 22.2 °C
2019-02-18 10:20:39.852 [vent.ItemStateChangedEvent] - LoungeTRV_Temperature changed from 22.2 °C to 22.1 °C
2019-02-18 10:20:40.029 [vent.ItemStateChangedEvent] - LoungeTRV_Temperature changed from 22.1 °C to 22.2 °C
2019-02-18 10:21:40.174 [vent.ItemStateChangedEvent] - LoungeTRV_Temperature changed from 22.2 °C to 22.1 °C
2019-02-18 10:21:40.309 [vent.ItemStateChangedEvent] - LoungeTRV_Temperature changed from 22.1 °C to 22.2 °C

(Nigel Head) #305

Yes, they are. I guess as a result of the Wiser app from where they were initially installed and setup?

I’ve gone back to the latest marketplace binding, removed one lounge TRV and searched again in the inbox. It was found again and added as a thing.

Now, in the ‘Things’ it is flipping between ‘online’ and ‘offline - communication_error’ ?

edit,
Had to remove it from the system as the log was scrolling by so fast!
Grabbed this after it was removed…

2019-02-18 14:19:34.238 [hingStatusInfoChangedEvent] - 'draytonwiser:itrv:WiserHeat02E833:086BD7FFFEE0FD65' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE

2019-02-18 14:19:34.248 [hingStatusInfoChangedEvent] - 'draytonwiser:itrv:WiserHeat02E833:086BD7FFFEE0FD65' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR)

2019-02-18 14:19:34.458 [vent.ItemStateChangedEvent] - LoungeTRV_Temperature changed from 20.6 °C to 21.2 °C

2019-02-18 14:19:34.471 [hingStatusInfoChangedEvent] - 'draytonwiser:itrv:WiserHeat02E833:086BD7FFFEE0FD65' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE

2019-02-18 14:19:34.475 [hingStatusInfoChangedEvent] - 'draytonwiser:itrv:WiserHeat02E833:086BD7FFFEE0FD65' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR)

2019-02-18 14:19:34.479 [vent.ItemStateChangedEvent] - LoungeTRV_Temperature changed from 21.2 °C to 20.6 °C

2019-02-18 14:19:34.483 [vent.ItemStateChangedEvent] - Bathroom_Temperature changed from 21.3 °C to 21.2 °C

2019-02-18 14:19:34.548 [vent.ItemStateChangedEvent] - BathroomTRV_Temperature changed from 21.3 °C to 21.2 °C

2019-02-18 14:19:34.583 [vent.ItemStateChangedEvent] - LoungeTRV_Temperature changed from 20.6 °C to 21.2 °C

2019-02-18 14:19:34.645 [vent.ItemStateChangedEvent] - LoungeTRV_Temperature changed from 21.2 °C to 20.6 °C

2019-02-18 14:19:34.676 [hingStatusInfoChangedEvent] - 'draytonwiser:itrv:WiserHeat02E833:086BD7FFFEE0FD65' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE

2019-02-18 14:19:34.681 [hingStatusInfoChangedEvent] - 'draytonwiser:itrv:WiserHeat02E833:086BD7FFFEE0FD65' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR)

(Andrew Schofield) #306

OK, this is probably a bug in the binding. It needs to cope better with discovery of multiple devices of the same type in the same room. Ideally it should have called them Lounge TRV, Lounge TRV 2 etc. I suspect that having 2 things with the same name is probably confusing openHAB.
You might be able to fix this yourself by manually renaming the thing in paperui though.


(Nigel Head) #307

Just tried that - discovered in inbox and before adding as thing, named it Lounge TRV2.
Result is as above - flipping between online and off line


(Andrew Schofield) #308

I wonder, when you run the discovery step, is it creating an item in the inbox that has the same serial number as the existing TRV? That could potentially explain it. It’s getting confused and trying to add the details of the 1st TRV as if it were the 2nd TRV.


(Nigel Head) #309

It is picking up the correct serial number and is different to the other Lounge TRV.

It was alright in the version from a couple of days ago - any chance I can grab a copy of that so I can re-instate my things?! as the 2.5 snapshot I have is from a week or so ago and doesn’t detect my things.

edit,
Found a local copy of 2.5 snapshot from 3 days ago and added it in via addons and uninstalled the marketplace version.
Discovered the 2nd Lounge TRV, but now have same problem of online/offline and this in the log

2019-02-18 15:14:02.324 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler HeatHubHandler tried updating the thing status although the handler was already disposed.
2019-02-18 15:14:02.387 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler HeatHubHandler tried updating the thing status although the handler was already disposed.
2019-02-18 15:14:02.452 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler HeatHubHandler tried updating the thing status although the handler was already disposed.
2019-02-18 15:14:02.516 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler HeatHubHandler tried updating the thing status although the handler was already disposed.
2019-02-18 15:14:02.585 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler HeatHubHandler tried updating the thing status although the handler was already disposed.
2019-02-18 15:14:02.656 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler HeatHubHandler tried updating the thing status although the handler was already disposed.
2019-02-18 15:14:02.722 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler HeatHubHandler tried updating the thing status although the handler was already disposed.

(Andrew Schofield) #310

I’ve seen those error messages occasionally in my log too, and they are potentially related. Leave it with me and I’ll see if I can fix both in one go.

Edit: You can download the previous version (14th Feb) of the binding here: https://drive.google.com/drive/folders/1XqyqneZfUI258OSI4vBtVVtwngBpveKs?usp=sharing
(currently it is the only file in that folder).


(Nigel Head) #311

Thanks for the google drive version.
Deleted all old versions in OH and added the google drive version.
New TRV turned up in the inbox, named it Lounge - TRV2 added it and then in things linked all the items as xxx_TRV2.

All is calm now :wink:

Nigel


(Fraser Howell) #312

@andrew-schofield. I’ve just uninstalled and reinstalled the binding from the market place and everything is working like a charm now. Away mode is changing without any errors.

I have all my Things declared in .thing files so I’ve not had any issues with auto discovery.

One quirk I had was I called my Heathub “draytonwiser:heathub:Heathub” originally but I constantly had a Heathub pop up in my inbox called “draytonwiser:heathub:WiserHeat”. No matter how many times I ignored it or deleted it it would come back some time later. In the end I changed the name in my .things file to match and it hasn’t returned.

I’m guessing that the binding was seeing it a a different hub based on the serial number.

Thanks again for all your hard work on getting this working.


(Fraser Howell) #313

@andrew-schofield, guess I spoke too soon.

Since upgrading the binding I can see in the log that my connection to the hub is dropping out.

2019-02-18 18:23:59.132 [hingStatusInfoChangedEvent] - 'draytonwiser:heathub:WiserHeat02A4EA' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Heathub didn't repond in time
2019-02-18 18:23:59.142 [hingStatusInfoChangedEvent] - 'draytonwiser:boiler-controller:WiserHeat02A4EA:controller' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 18:23:59.149 [hingStatusInfoChangedEvent] - 'draytonwiser:room:WiserHeat02A4EA:livingroom' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 18:23:59.153 [hingStatusInfoChangedEvent] - 'draytonwiser:roomstat:WiserHeat02A4EA:livingroomstat' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 18:27:36.016 [hingStatusInfoChangedEvent] - 'draytonwiser:heathub:WiserHeat02A4EA' changed from OFFLINE (COMMUNICATION_ERROR): Heathub didn't repond in time to ONLINE
2019-02-18 18:27:36.021 [hingStatusInfoChangedEvent] - 'draytonwiser:boiler-controller:WiserHeat02A4EA:controller' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 18:27:36.026 [hingStatusInfoChangedEvent] - 'draytonwiser:room:WiserHeat02A4EA:livingroom' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 18:27:36.030 [hingStatusInfoChangedEvent] - 'draytonwiser:roomstat:WiserHeat02A4EA:livingroomstat' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 18:49:17.912 [hingStatusInfoChangedEvent] - 'draytonwiser:heathub:WiserHeat02A4EA' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Heathub didn't repond in time
2019-02-18 18:49:17.922 [hingStatusInfoChangedEvent] - 'draytonwiser:boiler-controller:WiserHeat02A4EA:controller' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 18:49:17.934 [hingStatusInfoChangedEvent] - 'draytonwiser:room:WiserHeat02A4EA:livingroom' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 18:49:17.939 [hingStatusInfoChangedEvent] - 'draytonwiser:roomstat:WiserHeat02A4EA:livingroomstat' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 18:53:58.698 [hingStatusInfoChangedEvent] - 'draytonwiser:heathub:WiserHeat02A4EA' changed from OFFLINE (COMMUNICATION_ERROR): Heathub didn't repond in time to ONLINE
2019-02-18 18:53:58.707 [hingStatusInfoChangedEvent] - 'draytonwiser:boiler-controller:WiserHeat02A4EA:controller' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 18:53:58.714 [hingStatusInfoChangedEvent] - 'draytonwiser:roomstat:WiserHeat02A4EA:livingroomstat' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 18:53:58.720 [hingStatusInfoChangedEvent] - 'draytonwiser:room:WiserHeat02A4EA:livingroom' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 18:57:32.240 [hingStatusInfoChangedEvent] - 'draytonwiser:heathub:WiserHeat02A4EA' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Heathub didn't repond in time
2019-02-18 18:57:32.249 [hingStatusInfoChangedEvent] - 'draytonwiser:boiler-controller:WiserHeat02A4EA:controller' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 18:57:32.256 [hingStatusInfoChangedEvent] - 'draytonwiser:room:WiserHeat02A4EA:livingroom' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 18:57:32.260 [hingStatusInfoChangedEvent] - 'draytonwiser:roomstat:WiserHeat02A4EA:livingroomstat' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 19:02:49.696 [hingStatusInfoChangedEvent] - 'draytonwiser:heathub:WiserHeat02A4EA' changed from OFFLINE (COMMUNICATION_ERROR): Heathub didn't repond in time to ONLINE
2019-02-18 19:02:49.712 [hingStatusInfoChangedEvent] - 'draytonwiser:boiler-controller:WiserHeat02A4EA:controller' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 19:02:49.716 [hingStatusInfoChangedEvent] - 'draytonwiser:roomstat:WiserHeat02A4EA:livingroomstat' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 19:02:49.722 [hingStatusInfoChangedEvent] - 'draytonwiser:room:WiserHeat02A4EA:livingroom' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 19:06:46.013 [hingStatusInfoChangedEvent] - 'draytonwiser:heathub:WiserHeat02A4EA' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Heathub didn't repond in time
2019-02-18 19:06:46.028 [hingStatusInfoChangedEvent] - 'draytonwiser:boiler-controller:WiserHeat02A4EA:controller' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 19:06:46.032 [hingStatusInfoChangedEvent] - 'draytonwiser:roomstat:WiserHeat02A4EA:livingroomstat' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 19:06:46.038 [hingStatusInfoChangedEvent] - 'draytonwiser:room:WiserHeat02A4EA:livingroom' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 19:09:09.622 [hingStatusInfoChangedEvent] - 'draytonwiser:heathub:WiserHeat02A4EA' changed from OFFLINE (COMMUNICATION_ERROR): Heathub didn't repond in time to ONLINE
2019-02-18 19:09:09.632 [hingStatusInfoChangedEvent] - 'draytonwiser:boiler-controller:WiserHeat02A4EA:controller' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 19:09:09.643 [hingStatusInfoChangedEvent] - 'draytonwiser:room:WiserHeat02A4EA:livingroom' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 19:09:09.649 [hingStatusInfoChangedEvent] - 'draytonwiser:roomstat:WiserHeat02A4EA:livingroomstat' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 19:31:08.575 [hingStatusInfoChangedEvent] - 'draytonwiser:heathub:WiserHeat02A4EA' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Heathub didn't repond in time
2019-02-18 19:31:08.587 [hingStatusInfoChangedEvent] - 'draytonwiser:boiler-controller:WiserHeat02A4EA:controller' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 19:31:08.593 [hingStatusInfoChangedEvent] - 'draytonwiser:room:WiserHeat02A4EA:livingroom' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 19:31:08.599 [hingStatusInfoChangedEvent] - 'draytonwiser:roomstat:WiserHeat02A4EA:livingroomstat' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2019-02-18 19:36:55.974 [hingStatusInfoChangedEvent] - 'draytonwiser:heathub:WiserHeat02A4EA' changed from OFFLINE (COMMUNICATION_ERROR): Heathub didn't repond in time to ONLINE
2019-02-18 19:36:55.988 [hingStatusInfoChangedEvent] - 'draytonwiser:boiler-controller:WiserHeat02A4EA:controller' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 19:36:55.996 [hingStatusInfoChangedEvent] - 'draytonwiser:room:WiserHeat02A4EA:livingroom' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2019-02-18 19:36:56.002 [hingStatusInfoChangedEvent] - 'draytonwiser:roomstat:WiserHeat02A4EA:livingroomstat' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE 

I will downgrade to the version from your Google drive and see if the problem persists.


(Andrew Schofield) #314

OK, looks like my “fix” hasn’t fixed anything :frowning:


(AB) #315

Can anybody point me in the right direction for setting schedules from OpenHAB.

I’ve set everything up and all is working with my sitemaps etc but I’m struggling with anyway to implement schedule setting. My reason for wanting this is that I work shifts so find myself constantly having to alter schedules, it’s bad enough for one room but for 4 or 5. My old Netatmo used to have the facility to set numerous schedule plans for the week which you could set from a drop down menu i.e. Mornings, Afternoon or Nights.

I’ve read about setting triggers from Google calendar but haven’t gone down that route yet, I don’t know what the “trigger” would look like?


(Nicholas Brealey ) #316

I only installed OpenHAB a couple of weeks ago and have not really done much with it yet.

I may be totally wrong about how to go about this but I was thinking of trying the following as a simple way to add something to the Basic UI which would use the Wiser Heat app to create schdules and the OpenHAB Basic UI to switch between them:

  1. Add a couple of Selection or Switch elements to the sitemap to “Load Heating Schedule” or “Save Heating Schedule” with the choices corresponding to the different schedules (eg “Mornings”, “Afternoons”, “Nights”). Save current choice using the mapdb Persistence Service.

  2. Add rules which would trigger when the user changes the state of these items and loops through all the rooms (and hot water) and sets or gets the schedule string using the mapdb Persistence Service to save the schedule string. (See https://community.openhab.org/t/drayton-wiser-thermostat-binding/35640/184).


(AB) #317

Can somebody please help me configuring my persistence file for grafana and influx.

I’ve set up both grafana and influx and all seem working OK but I can’t get my head around how to get any data to come through.

Thanks in advance


(Fraser Howell) #318

This is my influxdb.persist file. Saves data from everything in the group ‘gHeating’ every time it changes or once an hour.

Strategies {
    everyMinute : "0 * * * * ?"
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"
}

Items {
    gHeating*   : strategy = everyChange, everyHour
}

(JP) #319

@andrew-schofield - love your work getting Wiser enabled on OpenHAB. I know that there were calls for more openness of the API…

Can I suggest you try using the suffix “?schema” on some of your RESTful GET calls? You may just see a JSON Schema of the expected result.

Drayton will probably turn that feature off in next firmware update when they see this post… @Drayton - please let guys tinker with this API - its got so much potential if you just let people be curious and explore their own hardware that they have bought.

Hope you can get this working - its been a while since I worked there…


(Nicholas Brealey ) #320

After many frustrations I seem to have managed to get the Basic UI switching between schedules created on the Wiser Heat app. The Heating Boilerplate Tutorial was very helpful but with a Drayton Wiser system I think it is better to use openHAB to change schedules rather than having every room in manual mode and using openHAB to change set point temperatures.

This is a simplified version of how I setup my system to switch between a schedule for when I am at work during the day and a shedule for when I am at home.

I created a heating.items file containing:

String Heating_Schedule            "Heating Schedule [%s]"
String Save_Heating_Schedule       "Save Heating Mode [%s]"

Group HS
String FF_LivingRoom_Schedule      "Living Room Heating Schedule [%s]" (HS) {channel="draytonwiser:room:deadbeef:livingroom:masterSchedule"}
String FF_Kitchen_Schedule         "Kitchen Heating Schedule [%s]"     (HS) {channel="draytonwiser:room:deadbeef:kitchen:masterSchedule"}

Group HS_Home
String FF_LivingRoom_Schedule_Home "Living Room Heating Schedule [%s]" (HS_Home) 
String FF_Kitchen_Schedule_Home    "Kitchen Heating Schedule [%s]"     (HS_Home) 

Group HS_Work
String FF_LivingRoom_Schedule_Work "Living Room Heating Schedule [%s]" (HS_Work) 
String FF_Kitchen_Schedule_Work    "Kitchen Heating Schedule [%s]"     (HS_Work) 

a heating.rules file containing:

val String prep_schedule_re = "s/\\{\"id\":\\d*,(.*),\"Type\":\"Heating\"\\}/\\{$1\\}/"
val String strip_home_re = "s/^(.*)_Home$/$1/"
val String strip_work_re = "s/^(.*)_Work$/$1/"

rule "Apply Heating Schedule"
when
    Item Heating_Schedule received command
then
    switch receivedCommand {
        case "HOME": {
		    HS_Home.members.forEach[ i | sendCommand(transform("REGEX", strip_home_re, i.name), i.state.toString) ]
			Save_Heating_Schedule.postUpdate("HOME")
			logInfo("heating.rules", "Applied Home heating schedule")
        }
        case "WORK": {
		    HS_Work.members.forEach[ i | sendCommand(transform("REGEX", strip_work_re, i.name), i.state.toString) ]
			Save_Heating_Schedule.postUpdate("WORK")
			logInfo("heating.rules", "Applied Work heating schedule")
        }
    }
end

rule "Save Heating Schedule"
when
    Item Save_Heating_Schedule received command
then
    switch receivedCommand {
        case "HOME": {
		    HS.members.forEach[ i | postUpdate(i.name+"_Home", transform("REGEX", prep_schedule_re, i.state.toString)) ]
			Heating_Schedule.postUpdate("HOME")
			logInfo("heating.rules", "Saved Home heating schedule")
        }
        case "WORK": {
		    HS.members.forEach[ i | postUpdate(i.name+"_Work", transform("REGEX", prep_schedule_re, i.state.toString)) ]
			Heating_Schedule.postUpdate("WORK")
			logInfo("heating.rules", "Saved Work heating schedule")
        }
    }
end

a mapdb.persist file containing:

Strategies {
    default = everyChange
}
Items {
    Heating_Schedule        : strategy = everyChange, restoreOnStartup
    HS*, HS_Home*, HS_Work* : strategy = everyChange, restoreOnStartup
}

and a home.sitemap file which included:

sitemap home label="Home" {
    Frame label="Choose Heating Schedule" icon="radiator" {
        Selection item=Heating_Schedule label="Heating Schedule []"
     		mappings=[
                HOME="Home",
                WORK="Work"
            ]
     }

// ...

    Frame label="Program Heating Schedule" icon="radiator" {
        Selection item=Save_Heating_Schedule label="Copy from Wiser Heat to []"
     		mappings=[
                HOME="Home",
                WORK="Work"
            ]
    }
}

Getting the rules working was the most frustrating thing. I tried to use a javascript transform to strip out the extra “id” and “Type” JSON items but could not get it to work and I had to resort to a regex transform.


(AB) #321

Looks interesting.

I’m having issues trying to get the rules to work as you said.

The error states Rule ‘Apply Heating Schedule’ : The name ‘strip_work_re’ cannot be resolved to an item or type; line 27, column 67, length 13

and

Rule ‘Save Heating Schedule’ : The name ‘prep_schedule_re’ cannot be resolved to an item or type; line 45, column 77, length 16

Thanks


(Nicholas Brealey ) #322

Do you have the RegEx Transformation installed?

There a few things I should have mentioned:

  1. You need to have the RegEx Transformation and Map Transformation installed (PaperUI -> Add-ons -> Transformations)

  2. You need to have MapDB Persistence installed (PaperUI -> Add-ons -> Persistence)

  3. You need to use the working version of the DraytonWiser Binding from https://community.openhab.org/t/drayton-wiser-thermostat-binding/35640/310

  4. I am using openHAB 2.5.0 Build #1557 (openHAB 2.5.0-SNAPSHOT version).


(AB) #323

Hi,

Thanks for you prompt reply.

Right something is happening!

It confused me at first because the wiser app doesn’t refresh the schedules unless I close and reopen the app however in Paper UI and the logs the schedule had changed!

Where are the schedules kept in openhab?

Thanks