Drayton Wiser Heating - port from ST?

metadata {
definition (name: "Drayton Wiser Room", namespace: "colc1705", author: "Colin Chapman", ocfDeviceType: "oic.d.thermostat", mnmn: "SmartThings", vid: "SmartThings-smartthings-Z-Wave_Thermostat") {
capability "Sensor"
capability "Actuator"
capability "Relative Humidity Measurement"
capability "Refresh"
capability "Thermostat"
capability "Temperature Measurement"
capability "Thermostat Heating Setpoint"
capability "Thermostat Operating State"
capability "Health Check"

    attribute "boost", "string"
    attribute "demand", "number"
    
    command "heatingSetpointDown" //"spDown"
    command "heatingSetpointUp" //"spUp"
    command "test"
    command "boostOn"
    command "boostOff"
   
   
    
}

    
    main(["thermostatMulti"])
    details(["thermostatMulti","mode","boost","demand"])
}

def updated() {
logEvent("updated()")

}

def parse(String description) {
logEvent("parse()")
}

def test() {
logEvent("test()")
logEvent("debugging on? " + parent.showDebugInfo())
//parent.test(device.deviceNetworkId)
}

def heatingSetpointUp() {
logEvent("heatingSetpointUp()")
def currentSP = device.currentState("heatingSetpoint").getDoubleValue()
def newSP = currentSP + 0.5
logEvent("Current setting: " + currentSP)
sendEvent(name: "heatingSetpoint", value: newSP, unit: "C", state: "heat")
sendEvent(name: "thermostatSetpoint", value: newSP, unit: "C", state: "heat")
parent.setPoint(device.deviceNetworkId, newSP)

}

def heatingSetpointDown() {
logEvent("heatingSetpointDown()")
def currentSP = device.currentState("heatingSetpoint").getDoubleValue()
def newSP = currentSP - 0.5
logEvent("Current setting: " + currentSP)
sendEvent(name: "heatingSetpoint", value: newSP, unit: "C", state: "heat")
sendEvent(name: "thermostatSetpoint", value: newSP, unit: "C", state: "heat")
parent.setPoint(device.deviceNetworkId, newSP)
}

def setHeatingSetpoint(setpoint) {
logEvent("setHeatingSetpoint($setpoint)")
sendEvent(name: "heatingSetpoint", value: setpoint, unit: "C", state: "heat")
sendEvent(name: "thermostatSetpoint", value: setpoint, unit: "C", state: "heat")
parent.setPoint(device.deviceNetworkId, setpoint)
}

def setTemp(temp, setPoint) {
logEvent(device.name + " is " + temp + "°C")
sendEvent(name: "temperature", value: temp, unit: "°C", state: "heat")
sendEvent(name: "heatingSetpoint", value: setPoint, unit: "C", state: "heat")
sendEvent(name: "thermostatSetpoint", value: setPoint, unit: "C", state: "heat")
}

def setHumidity(humidity) {
logEvent("setHumidity($humidity)")
sendEvent(name: "humidity", value: humidity, unit: "%")

}

def setMode(mode) {
logEvent("setMode($mode)")
sendEvent(name: "mode", value: mode)
}

def setBoost(boost) {
logEvent("setBoost($boost)")
sendEvent(name: "boost", value: boost)
}

def autoMode() {
logEvent("autoMode()")
parent.setRoomManualMode(device.deviceNetworkId, false)
}

def manualMode() {
logEvent("manualMode()")
parent.setRoomManualMode(device.deviceNetworkId, true)
}

def boostOn() {
logEvent("boostOn()")
def currentTemp = device.currentState("temperature").getDoubleValue()
currentTemp = 0.5*(Math.round(currentTemp/0.5))
def setPoint = currentTemp + 2
parent.setRoomBoost(device.deviceNetworkId,30,setPoint)
}

def boostOff() {
logEvent("boostOff()")
parent.setRoomBoost(device.deviceNetworkId,0,0)
}

def setOutputState(outputState) {
logEvent("setOutputState($outputState)")
sendEvent(name: "outputState", value: outputState)
}

def setDemand(demand) {
logEvent("setDemand($demand)")
sendEvent(name: "demand", value: demand)
}

def logEvent(event) {
if (parent.showDebugInfo()) {
log.debug event
} else {
//log.debug "Logging disabled"
}
}

metadata {
definition (name: "Drayton Wiser TRV", namespace: "colc1705", author: "Colin Chapman", ocfDeviceType: "oic.d.thermostat", mnmn: "SmartThings", vid: "SmartThings-smartthings-Z-Wave_Thermostat") {
capability "Thermostat"
capability "Temperature Measurement"
capability "Relative Humidity Measurement"
capability "Sensor"
capability "Battery"
capability "Refresh"
capability "Health Check"

    attribute "boost", "string"
    attribute "demand", "number"
    attribute "windowState", "string"
    attribute "battery", "string"
    
    command "heatingSetpointup" //"spDown"
    command "heatingSetpointDown" //"spUp"
    command "test"
    command "boostOn"
    command "boostOff"
    
    
}


    
    main(["thermostatMulti"])
    details(["thermostatMulti","mode","boost","demand","windowState"])
}

def updated() {
logEvent("updated()")

}

def parse(String description) {
logEvent("parse()")

}

def test() {
logEvent("test()")
parent.test(device.deviceNetworkId)
}

def heatingSetpointUp() {
logEvent("heatingSetpointUp()")
def currentSP = device.currentState("heatingSetpoint").getDoubleValue()
def newSP = currentSP + 0.5
logEvent("Current setting: " + currentSP)
sendEvent(name: "heatingSetpoint", value: newSP, unit: "C", state: "heat")
sendEvene(name: "thermostatSetpoint", value: newSP, unit: "C", state: "heat")
parent.setPoint(device.deviceNetworkId, newSP)

}

def heatingSetpointDown() {
logEvent("heatingSetpointDown()")
def currentSP = device.currentState("heatingSetpoint").getDoubleValue()
def newSP = currentSP - 0.5
logEvent("Current setting: " + currentSP)
sendEvent(name: "heatingSetpoint", value: newSP, unit: "C", state: "heat")
sendEvent(name: "thermostatSetpoint", value: newSP, unit: "C", state: "heat")
parent.setPoint(device.deviceNetworkId, newSP)
}

def setHeatingSetpoint(setpoint) {
logEvent("setHeatingSetpoint($setpoint)")
sendEvent(name: "heatingSetpoint", value: setpoint, unit: "C", state: "heat")
sendEvent(name: "thermostatSetpoint", value: setpoint, unit: "C", state: "heat")
parent.setPoint(device.deviceNetworkId, setpoint)
}

def setTemp(temp, setPoint) {
logEvent(device.name + " is " + temp + "°C")
sendEvent(name: "temperature", value: temp, unit: "C", state: "heat")
sendEvent(name: "heatingSetpoint", value: setPoint, unit: "C", state: "heat")
sendEvent(name: "thermostatSetpoint", value: setpoint, unit: "C", state: "heat")
}

def setMode(mode) {
logEvent("setMode($mode)")
sendEvent(name: "mode", value: mode)
}
def setbatteryleval(battery) {
logEvent("setBatterylevel($battery)")
sendEvent(name: "batterylevel", value: battery, unit: "%")
}
def setBoost(boost) {
logEvent("setBoost($boost)")
sendEvent(name: "boost", value: boost)
}

def setWindowState(wState) {
logEvent("setWindowState($wState)")
sendEvent(name: "windowState", value: wState)
}

def autoMode() {
logEvent("autoMode()")
parent.setRoomManualMode(device.deviceNetworkId, false)
}

def manualMode() {
logEvent("manualMode()")
parent.setRoomManualMode(device.deviceNetworkId, true)
}

def boostOn() {
logEvent("boostOn()")
def currentTemp = device.currentState("temperature").getDoubleValue()
currentTemp = 0.5*(Math.round(currentTemp/0.5))
def setPoint = currentTemp + 2
parent.setRoomBoost(device.deviceNetworkId,30,setPoint)
}

def boostOff() {
logEvent("boostOff()")
parent.setRoomBoost(device.deviceNetworkId,0,0)
}
def setHumidity(humidity) {
logEvent("setHumidity($humidity)")
sendEvent(name: "humidity", value: humidity, unit: "%")
}

def setOutputState(outputState) {
logEvent("setOutputState($outputState)")
sendEvent(name: "outputState", value: outputState)
}

def setDemand(demand) {
logEvent("setDemand($demand)")
sendEvent(name: "demand", value: demand)
}

def logEvent(event) {
if (parent.showDebugInfo()) {
log.debug event
} else {
//log.debug "Logging disabled"
}
}

for anyone who wants it I have posted up the app and drivers for drayton wiser heating.
first is the app, second is the hub driver, third is the room stat driver and lastly the trv driver.
this is not my own work this was ported from smartthings, all I did was get it to work in Hubitat.

I have been using it for a few months and it works great. The only part not working is the hot water and battery reporting for the TRV's.

If anyone needs any help on how to install this then drop me a mail.
Mark.

Hi Mark,
thanks for posting that. It is working nicely from what I can see. do you get:
[error] org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_colc1705_Drayton_Wiser_Room_501.setWindowState() is applicable for argument types: () values: [] (setWindowState)?

I will need to look and see if I can learn what I was doing wrong now.
Neil

Hi neil,
not had any errors for the window state, all mine are showing as closed matching what I see in the wiser app.

Hi Mark,
thanks I will try and work out what is causing the error, it will need to wait until I get back from work .

Neil

Slightly off topic, but just wondering how you found the performance of the trvs?

I struggled with them for months before giving up. The reliability was horrendous.

(I use an alternative system now which has been 100%)

Hi, I have only been using the Drayton wiser TRV’s for about 3 months and so far they have been rock solid. My only criticism would be one TRV is slightly noisy and if it were in a bedroom it would disturb me.
What did you change to.

=)

I have been using Drayton wiser for well over a year and have to say they have been solid.
I had one try die after replacing batteries (not sure why) but since replacing it they have all been good.
I use them all over the house, 6 trv’S and one room stat.
I also like that you can create a room and have more then one device so in my living room I have 2 radiators and a room stat, I never touch the trvs in that room as all changes are made off the room stat on the wall.

That’s interesting, I had never heard of these wired thermal actuators before, just looked them up on Amazon.

To be fair I was using them via a 3rd party dht through smartthings at the time, without the wiser hub. The trv was about 30 quid, and due to that, I believed I could justify buying more to end up with 7 zone heating. I found it would work for a week maybe, then I'd realise a rad hadn't heated up when it should have, checked the logs and saw it had actually dropped off the network days before. Battery pulls were fairly frequent.

Wasn't willing to shell out for a dedicated wiser hub, so ended up returning them and taking a crack with the thermal actuators.

Never looked back.

Hi Neil,

Did you figure out the setWindowState error at all? I'm getting the same issue.