SmartThings Community

Secure SIR321 with Temp Probe - Beta


(Antony Pugh) #21

Where are you seeing the HTTP Error?

this is the code I am using successfully.


  • Horstmann Secure SIR-321
  • Author: Mike Baird
  • Date: 2017-08-15
  • Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.

metadata {

definition (name: “Secure SIR321”, namespace: “m1cs”, author: “Mike Baird”) {
capability “Actuator”
capability “Configuration”
capability “Switch”
capability “Polling”
capability “Refresh”
capability “Sensor”
capability “Thermostat Schedule”
capability “Temperature Measurement”

  fingerprint mfr: "0059", prod: "0010", deviceJoinName: "Immersion Heater"		


// simulator metadata
simulator {
status “on”: “command: 2503, payload: FF”
status “off”: “command: 2503, payload: 00”

  // reply messages
  reply "2001FF,delay 100,2502": "command: 2503, payload: FF"
  reply "200100,delay 100,2502": "command: 2503, payload: 00"


//tile definitions
tiles(scale: 2) {
multiAttributeTile(name:“switch”, type: “lighting”, width: 6, height: 4, canChangeIcon: true){
tileAttribute (“device.switch”, key: “PRIMARY_CONTROL”) {
attributeState “on”, label: ‘Heating’, action: “”, icon: “st.Bath.bath13”, backgroundColor: “#79b821”, nextState:“off”
attributeState “off”, label: ‘{name}', action: "switch.on", icon: "st.Bath.bath13", backgroundColor: "#ffffff", nextState:"on" } tileAttribute("device.temperature", key: "SECONDARY_CONTROL") { attributeState("default", label:'{currentValue}’, unit:“C”, icon: “st.Weather.weather2”)

  standardTile("refresh", "device.switch", width: 2, height: 2, inactiveLabel: false, decoration: "flat") 
  	state "default", label:'Refresh', action:"refresh.refresh", icon:"st.secondary.refresh"
    standardTile("configure", "device.configuration", width: 2, height: 2, inactiveLabel: false, decoration: "flat") 
  	state "default", label:'Configure', action:"configuration.configure", icon:"st.secondary.refresh"

  main "switch"


def parse(String description) {
log.debug “parse description: $description”

def result

def cmd = zwave.parse(description, [0x20:1, 0x25:1, 0x86:1, 0x70:1, 0x72:2, 0x31:1])
if (cmd) {
result = createEvent(zwaveEvent(cmd))

log.debug “Parse returned ${result?.descriptionText}”

return result

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicReport cmd) {
[name: “switch”, value: cmd.value ? “on” : “off”, type: “digital”]

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd) {
[name: “switch”, value: cmd.value ? “on” : “off”, type: “physical”]

def zwaveEvent(physicalgraph.zwave.commands.switchbinaryv1.SwitchBinaryReport cmd) {
[name: “switch”, value: cmd.value ? “on” : “off”, type: “digital”]

def zwaveEvent(physicalgraph.zwave.commands.hailv1.Hail cmd) {
[name: “hail”, value: “hail”, descriptionText: “Switch button was pressed”, displayed: false]

def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) {
if (state.manufacturer != cmd.manufacturerName) {
updateDataValue(“manufacturer”, cmd.manufacturerName)

def zwaveEvent(physicalgraph.zwave.commands.configurationv1.ConfigurationReport cmd)
log.debug “configuration: $cmd”
def map = [:]
map.value = cmd.scaledConfigurationValue
map.displayed = false
switch (cmd.parameterNumber) {
case 1: = “failSafeTimer”
case 2: = “tempScale”
case 3: = “tempReportInterval”
case 4: = “deltaConfigTempReport”
case 5: = “tempCutOff”
return [:]
return map


def zwaveEvent(physicalgraph.zwave.commands.sensormultilevelv1.SensorMultilevelReport cmd)
def result =
def map = [:]
map.value = cmd.scaledSensorValue.toString()
map.unit = cmd.scale == 0.5 ? “F” : “C” = “temperature”

def zwaveEvent(physicalgraph.zwave.Command cmd) {
debug.log “$cmd”
// Handles all Z-Wave commands we aren’t interested in

def on() {
zwave.basicV1.basicSet(value: 0xFF).format(),
zwave.configurationV1.configurationSet(scaledConfigurationValue: 60, parameterNumber: 3, size: 2).format() //poll interval reduced to 1 minute

def off() {
zwave.basicV1.basicSet(value: 0x00).format(),
zwave.configurationV1.configurationSet(scaledConfigurationValue: 300, parameterNumber: 3, size: 2).format() //poll interval increaced to 5 minutes

def poll() {

def refresh() {
zwave.configurationV1.configurationGet(parameterNumber: 1).format(),
zwave.configurationV1.configurationGet(parameterNumber: 2).format(),
zwave.configurationV1.configurationGet(parameterNumber: 3).format(),
zwave.configurationV1.configurationGet(parameterNumber: 4).format(),
zwave.configurationV1.configurationGet(parameterNumber: 5).format()
], 3000)

def updated() {
log.debug “updated… calling configure.”

def configure() {
log.debug “configure”
def cmds =
cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: 0, parameterNumber: 1, size: 1).format() //disable failsafe timer
cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: 0, parameterNumber: 2, size: 2).format() //Set Temp Scale to C
cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: 300, parameterNumber: 3, size: 2).format() //poll interval in seconds
cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: 10, parameterNumber: 4, size: 2).format() //poll interval in degrees
cmds << zwave.configurationV1.configurationSet(scaledConfigurationValue: 800, parameterNumber: 5, size: 2).format() //degree failsafe in 0.1 degrees (800 = 80 C)
cmds << zwave.associationV1.associationSet(groupingIdentifier:2, nodeId:[zwaveHubNodeId]).format()
delayBetween(cmds, 2500)


Hi there

That’s great. Thanks very much.

To answer your first question in the IDE if I go to My Devices, choose the device and make a change then the webpage blanks. I then hit [F5] to refresh and the thing throws an HTTP error.

As for the code that you posted, thanks again. Copy Paste results in an error which seems to be a UNICODE issue around the quotes. Do you know of a magic way to get the code copied across?

(Eamonn Clarke) #23

Hey guys can u help?got myself a sir321 i cant copy and paste any of the code within the threads here as it comes up as an error within the "create device handler"box, so i have gone to git hub and used @Ross_McCarthy dth, the device handler is created fine, i then go to the sir321 which has been added via the smarthings app as a “zwave switch” use edit and then change the “type” to the new device handler “sir321 immersion controller” i press update and it says update and refreshes and says updated but it doesnt update it remains as a zwave switch type, to be sure i changed the type to a few other different zwave types just to see if it changes the type and it does,its seems it just wont accept the new device handler type,for the moment i have it working as on off switch with the zwave sw type,any advice would be appreciated very much,

(Antony Pugh) #24

You need the one I posted. But it needs redoing so it works. I might try posting it to git hub instead.

Can’t do it for a couple of weeks though.

(Eamonn Clarke) #25

Hey there,
Thanks very much for your reply, no worries at atall I can wait for that no problem I have no idea of coding so I wouldn’t know where to begin.thanks again

(Eamonn Clarke) #26

Any joy bro? no pressure just wondering if it’s still on the cards thanks

(Jason Wallace) #27

Yeah. I’m in the same boat.

Would be great to be able to set the immersion to run for 60 minutes rather than plain on/off

(Antony Pugh) #28

Sorry I have been out of the country and forgot. I’ll do it tomorrow. I might fit hub it for you.

(Eamonn Clarke) #29

Thanks a mill mate git hub be top notch,
Thanks again :ok_hand:

(Antony Pugh) #30

behold81/ STCustomDH

Try this repo. if this works let me know Ill update the first page.

(Eamonn Clarke) #31

Just seeing this thanks m8 ill let you know