HS1HT Zigbee temperature sensor

zigbee
temperature
humidity

#1

Hello, I have an HS1HT Zigbee temperature and humidity sensor. The hub finds it as Thing but whatever device type I select manually I don’t get any readings.
Could someone point me to an existing integration or a device type I could use as template?

Do Zigbee devices have UK specific frequencies like Z-Wave?


(Tim Slagle) #2

Zigbee is pretty world wide.

Can you post a link to the device you have?


#3

Thanks for looking.
http://www.heimantech.com/products_detail/&productId=152.html


(Tim Slagle) #4

I’ve never seen this device before. It’s very likely a custom device will need to be created.


(John Rucker) #5

Looks like a cool product but I couldn’t find any documentation for it. The first thing we are going to need to know is what ZigBee cluster(s) it is using and the endpoint. This may be in the device documentation but if not you can get it from the hub’s log when the device joins SmartThings. If you can find this information I will be happy to point you in the right direction.


(Tolik) #6

Just out of curiosity how much was it?


#7

It is retailed around $35 USD. Z-Wave version also exists for a bit more. I contacted the manufacturer two weeks ago but no reply yet.

Any hint for a device type I could use as template? How do I get the device signature?


(Michael) #8

I would start by resetting it and removing it from your ST hub and then try to re-pair it again but while pairing it watch the Live Logging “All” section and you should see the device description in the join event, it will be a line with a bunch of hex codes (0x##). Once you copy that line you will have the basics needed to start working on the code. You will need to read up on how to write zigbee device handlers (A good starting point is the link below which is part of the developer guide). I have to say that $35 USD sounds pretty expensive considering you can get a multi sensor for the same price that reports temp/humidity as well as other things like motion or contact status.

http://docs.smartthings.com/en/latest/device-type-developers-guide/zigbee-primer.html


#9

Thank you for the tip on logging.

Here in the UK the multi sensor price is £29.99, roughly $40 USD so on 10 sensors the difference is $50USD. However I can get 10 HS1HT sensors for less than $35 and with free shipping, in total I could save about $100 USD.

Also I couldn’t find any reference about having humidity sensor in multi sensor and in fact I don’t have it in my version. I removed and readded my ST multi sensor to make sure I have the latest smart app but still no humidity.


(Michael) #10

Yeah, the humidity I was referring to is on my Fibaro motion multi-sensor which is about $50 USD unless you get it on sale. For what you need these may work perfectly but I figured I was going to have motion sensors anyway so those could provide the temp/humidity data as well instead of having even more devices for that data.

I would try to help you get a device handler working for it but not having one to play with will make that difficult. If you can get the description at join and paste it we should be able to help you get started with at least getting the device to pair with your device handler, creating the code to make the device actually work will be a bit more difficult.


#11

Thank you again.

This is the log during join:
b1b045a8-984e-480f-9fda-ab52c18e5490 20:31:47: trace NON-HUE EVENT desc: 02 0104 0302 00 05 0000 0003 0405 0001 0009 01 0019
b1b045a8-984e-480f-9fda-ab52c18e5490 20:31:47: trace Location: desc: 02 0104 0302 00 05 0000 0003 0405 0001 0009 01 0019
b1b045a8-984e-480f-9fda-ab52c18e5490 20:31:47: trace NON-HUE EVENT desc: 01 0104 0302 00 05 0000 0003 0402 0001 0009 01 0019
b1b045a8-984e-480f-9fda-ab52c18e5490 20:31:47: trace Location: desc: 01 0104 0302 00 05 0000 0003 0402 0001 0009 01 0019
b1b045a8-984e-480f-9fda-ab52c18e5490 20:31:44: trace NON-HUE EVENT ep_cnt:2, ep:01 02
b1b045a8-984e-480f-9fda-ab52c18e5490 20:31:44: trace Location: ep_cnt:2, ep:01 02
b1b045a8-984e-480f-9fda-ab52c18e5490 20:31:41: trace NON-HUE EVENT Thing added
b1b045a8-984e-480f-9fda-ab52c18e5490 20:31:41: trace Location: Thing added
b1b045a8-984e-480f-9fda-ab52c18e5490 20:31:41: trace NON-HUE EVENT join
b1b045a8-984e-480f-9fda-ab52c18e5490 20:31:41: trace Location: join
b1b045a8-984e-480f-9fda-ab52c18e5490 20:31:14: trace NON-HUE EVENT zwStatus:include search:Z-Wave include search started
b1b045a8-984e-480f-9fda-ab52c18e5490 20:31:14: trace Location: zwStatus:include search:Z-Wave include search started

I addedcapability “Configuration” and these to configure method :
“zdo bind 0x${device.deviceNetworkId} 01 0xFF 0x0402 {${device.zigbeeId}} {}”
“zdo bind 0x${device.deviceNetworkId} 02 0xFF 0x0405 {${device.zigbeeId}} {}”

I tried various endpoints like 1, 0x01 but didn’t make any difference, parse is not called.
I call configure from refresh and both are called because I have the relevant log entries in log.

Also tried the hub’s Zigbee ID instead of {${device.zigbeeId}}, made no difference.

I also tried different combinations of these in refresh:
"st rattr 0x${device.deviceNetworkId} 1 0x0402 0x0000"
"st rattr 0x${device.deviceNetworkId} 2 0x0405 0x0000"
zigbee.readAttribute(0x0402, 0x0000)
zigbee.readAttribute(0x0405, 0x0000)

Do you know what Zigbee version SmartThings has?


(Michael) #12

I am not sure of the zigbee version ST is using as I have not looked into that. I can tell you that based on the logs you provided I would create a fingerprint as shown below.

fingerprint profileId: "0104", deviceId: "0302", inClusters: "0000, 0001, 0003, 0009, 0405", outClusters: "0019"

I think where I would start is by creating a new device type using an existing device type as a template (this is an option in the IDE when creating device types). When selecting a template I would suggest starting with the one titled “Temperature Sensor” and then change the fingerprint in that template to match above. After making that edit and also modifying the line with the definition as shown below to use your name for “author”, your ST username for “namespace”, and give the device type a name that reflects the device it is for (“HS1HT Temperature Sensor” would probably work) I would save the device type and then publish it to your hub.

definition (name: "Temperature Sensor", namespace: "smartthings", author: "SmartThings") {

Once that is done you should be able to reset your sensor and re-pair it and it should pair with your new device type. It may work right away with that code since it appears to be zigbee code and has temperature and humidity parsing code. The only thing I see missing from it is the configure section where it would actually bind to the appropriate clusters so it will receive updates, if you get the device type paired we can work more to get the rest working.


#13

Hello, this is exactly what I tried except I didn’t have my username as author, however changing that didn’t make any difference.

Then I realized that the NON-HUE EVENT text in log entries possibly mean that the device is connecting to my Hue hub. And so it was. I can’t explain why because the Hue hub isn’t in discovery mode.
But after I removed all my Hue devices from ST including the hub the HS1HT was recognized by ST. Unfortunately parse was called only once with this message:
catchall: 0104 0405 02 01 0100 00 262A 00 00 0000 01 01 00000021D71C

The device seems to report regularly because there’s a control light on it what lights up regularly.
I moved it to change temperature at least 10 degrees Celsius but didn’t help either.

But even after a few removals and readds I could never get another log entry from parse.

Weirdly parse isn’t called from simulator either. Configure and refresh are but parse isn’t.

So I’m giving up now.

I’m happy to send you the device if you want to experiment with it, you only have to pay for shipping.


(Michael) #14

Sorry to hear you want to give up on it. I don’t really have a use for the temperature sensor so might be best to put it up on eBay or something.

Were you able to get it to pair successfully and use the device type you created? If so then it shouldn’t be too hard to get the rest working. If you can get it paired and give the device a name you should be able to leave the Live Logging in the IDE running for a couple of hours and capture the traffic coming in from the device and we would just need to code for the messages you get. My bet is you are not getting the messages you need because the proper clusters are not being initialized in the configure section, something else we can fix fairly easily, we just need to find out what the temp and humidity clusters are and add an initialize for each one in the configure section.


#15

Yes I have the device type linked to device, however I had a message logged only once, the one in previous post. Whatever I did I couldn’t get any other message in log. I had the Hue hub switched off just in case.
Weird thing is that parse wasn’t called (at least the log entry written from there didn’t show up in log) even when I sent messages from simulator. Is there a chance that some other method is called?

I tried zdo bind and zigbee.configureReporting in configure:

def configure() {
log.debug “configure: binding device.deviceNetworkId ${device.deviceNetworkId} device.zigbeeId ${device.zigbeeId}”

//"zdo bind 0x${device.deviceNetworkId} 01 0xFF 0x0402 {${device.zigbeeId}} {}"
//"zdo bind 0x${device.deviceNetworkId} 02 0xFF 0x0405 {${device.zigbeeId}} {}"
zigbee.configureReporting(0x0402, 0x0000, 0x29, 1, 5, 0x0001)
zigbee.configureReporting(0x0405, 0x0000, 0x29, 1, 5, 0x0001)

}

And this is parse:

def parse(String description) {
    log.debug "HS1HT parse description $description"
}

#16

The device uses two endpoints, could this be the related?


(Michael) #17

I suppose anything is possible, if you are not connecting to the proper endpoint you may not be getting the messages. I personally use the zdo bind commands in my device type and they seem to work. The commands I use for my device type are below, of course these are for a button controller rather than a temp/humidity sensor. You may want to try to setup the configure to bind to both endpoints or the opposite endpoint you are using now and see if you get more messages.

// Bind the outgoing on/off cluster from remote to hub, so the hub receives messages when On/Off buttons pushed
"zdo bind 0x${device.deviceNetworkId} 0x01 0x01 0x0006 {${device.zigbeeId}} {}",

// Bind the outgoing level cluster from remote to hub, so the hub receives messages when Dim Up/Down buttons pushed
"zdo bind 0x${device.deviceNetworkId} 0x01 0x01 0x0008 {${device.zigbeeId}} {}",
    
// Bind the incoming battery info cluster from remote to hub, so the hub receives battery updates
"zdo bind 0x${device.deviceNetworkId} 0x01 0x01 0x0001 {${device.zigbeeId}} {}",

(Karl Kaiser) #18

Did anyone manage to get this sensor going? I have one of these sensors and the package list the following URL: http://linksprite.com/wiki

You can find some more details of the sensor’s profiles in their Git repository :


(Karl Kaiser) #19

I got a bit further. I am able to discover the sensor and temp and battery work. I am now trying to get humidity going.

Was able to bind it:

    "zcl global send-me-a-report 0x0405 0 0x21 300 3600 {6400}", "delay 200",
    "send 0x${device.deviceNetworkId} 1 1", "delay 1500",
    
    "zdo bind 0x${device.deviceNetworkId} 1 1 0x0405 {${device.zigbeeId}} {}", "delay 1000", // Bind Humidity

and now I believe I see a response from the sensor.

10:40:28 PM: debug refresh temperature, humidity, and battery
10:27:31 PM: debug Parse returned [name:temperature, value:78.7, unit:F, descriptionText:Karl Temperature is 78.7°F]
10:27:31 PM: debug TEMP 77.701996°
10:27:31 PM: debug Parse description catchall: 0104 0402 01 01 0100 00 03A9 00 00 0000 01 01 00000029EB09
10:27:31 PM: debug Parse returned [name:battery, value:88, descriptionText:Karl Battery is 88%]
10:27:31 PM: debug Battery
10:27:31 PM: debug Desc Map: [raw:03A90100010A200000201D, dni:03A9, endpoint:01, cluster:0001, size:0A, attrId:0020, result:success, encoding:20, value:1d]
10:27:31 PM: debug description: read attr - raw: 03A90100010A200000201D, dni: 03A9, endpoint: 01, cluster: 0001, size: 0A, attrId: 0020, result: success, encoding: 20, value: 1d cluster: 0001, size: 0A, attrId: 0020, result: success, encoding: 20, value: 1d
10:27:29 PM: debug Parse returned [:]
10:27:29 PM: debug description: catchall: 0104 0405 01 01 0100 00 03A9 00 04 C2DF 0B 01 0084
10:27:26 PM: debug refresh temperature, humidity, and battery

However it looks like I need to work on the parsing of the catchall response. Any pointers appreciated how to best parse “catchall: 0104 0405 01 01 0100 00 03A9 00 04 C2DF 0B 01 0084”


#20

This is what I have. I didn’t update humidity to the spec you linked but temperature worked correct.