Hive Motion & Contact Sensors

Hive Sensors in Samsung SmartThings

Installation

SmartThings Device Handlers for the British Gas Hive Sensors

  1. Add the Device Handlers to your My Device Handlers.
  2. Reset the device by removing the battery, waiting 10 seconds, reconnecting, and pressing the tamper button eight times. (If it’s discoverable LED will be flashing in bursts of two. If not, start again.)
  3. Search for new devices through the SmartThings app and the sensor will be discovered.

Apologies about the rubbish formatting. These were developed live in the online SmartThings IDE and it’s a little…special sometimes.

You can get my Device Handlers from here:

and here:

After much experimentation and hair pulling, I have come to some conclusions regarding the Hive sensors that I thought would be useful to anyone else thinking of using them. Here’re my findings:

Background

The Hive sensors are add-ons that go with the Hive Active Heating range from British Gas. This is an incredibly popular IoT thermostat and hot water control in the UK with more deployments afaik than Nest, as it’s actively pushed by one of the main utility providers. Their ecosystem revolves around their hub and their app, and they have been extremely closed minded in the past to external integration. It has taken many years for them to release an official external route in, which is an IFTTT channel, and even that is very limited. The equipment, however, is Zigbee, so I’d often wondered if I could make use of the sensors myself.

Motion Sensors

Accessibility
They are reachable through the standard Zigbee HA clusters, which surprised me. I’m not sure why but I was expecting them to be more proprietary. They provide the following server clusters:

  • 0x0000 - Basic
  • 0x0003 - Identity
  • 0x0500 - IAS Zone (Specifically attribute 0x0002 which is the IAS 16 bit bitmap)
  • 0x0001 - Power (Specifically useful is the attribute 0x0020 which is battery level)
  • 0x0020 - This is something manufacturer specific. I’ve ordered a USB Zigbee modem to try and MITM this and figure it out. Could be for firmware, or perhaps tuning
  • 0x0402 - Temperature measurement (Specifically attribute 0x0000)
  • 0x0406 - Occupancy sensing. (Attribute 0x0000 should give occupancy, but although this claims to support it never reports)

They will show up as endpoint 02 which is expected.

They ignore most attempts to send a rattr but reporting does have an effect. It seems to disregard minimum reporting times on most attributes, though does appear to honour maximum times.

It’s possible that it’s intentionally designed to have a serious amount of rate limiting to save battery. Thinking about the use case in the Hive app this would make sense as nothing in their needs true real-time.

Temperature Reporting
They will continually report their temperature, seemingly as fast as every 10 seconds if you want them to, however, that temperature they report is not read at the time of the message, it’s just the last reading which is cached. The actual time between readings seems to be about 10-15 minutes, sometimes longer. This is bizarre because if you are powering up to send a message then the mW required to also read the sensor is a tiny fraction of the total mW in use. Also the temperature it does report seems to be off by several degrees when it’s warm and up to 10 degrees when it’s cold.

Motion Reporting
If the sensor believes and reports that it is in a state of “inactive” then it will send you a report saying “active” when it detects motion in a reasonably timely fashion, usually less than a second. However going the other way back to “inactive” can sometimes take up to 5 minutes. No good for things like light control or monitoring.

Tamper Switch
This bit at least it seems to report insanely quickly, for both tamper true and false.

Battery Reporting
The battery reading is as regular as it should be and seems accurate, at least compared to my multimeter.

Contact Sensor

In complete opposite to the motion sensor, the contact sensor is great.

Accessibility
Standard Zigbee HA clusters, supporting the same as the motion sensors above except for 0x0406 (occupancy).

All the same findings as the motion sensors, except for importantly the 0x0500 cluster (IAS) reports in close to real-time.

Temperature Reporting
According to the Hive REST API, and the discover simple announcement, these support temperature, however, I can’t get it to report over Zigbee at all.

Battery Reporting
The battery reading is again as regular as it should be and seems accurate, at least compared to my multimeter.

Tamper Switch
Like the motion sensors, this reports immediately on the 0x0500 cluster.

Contact Sensor
On the contact sensors, 0x0500 0x0002 reports almost immediately (lass than half a second). It has some rate limiting, I assume to prevent a partially open door from draining the battery, but it resets soon enough and is exactly what you need really.

Conclusion

The motion sensors are rubbish. :smiley: They basically lie about their state making them little use for any real-time applications. The contact sensors on the other hand work great, are much smaller and more aesthetically pleasing than the Samsung ones, and I’d recommend their use.

2 Likes

Great work, thank you!

For some reason I can’t get my contact sensor to report Battery information at all, any idea what could be causing it?

Which version of the sensor do you have? Can you link a picture?

I bought in in October, not sure how to tell what version it is exactly -

This is a screenshot from smartthings -

Ok. Got new version of motion sensor set up. Reports battery and temperature but does not report any motion detection. It does however report motion if paired with the hive hub…

connecting the latest hive and contact sensors with these device handlers:
1- contact sensors only show open/close state. no temp/battery readings
2- motion sensor- doesnt work. recognises no motion/temp/battery readings.
OP are you able to update the code please?
anyone else cabn help?
cheers

I’ve the same problem.
Contact Sensors only picking up contact, no battery or temp reporting.

Would love to see full compatibility if possible

glad i’m not the only one! new to all this. by the looks of it, the op has probably stopped supporting this dt. i’ve got several hive motion sensors gathering dust :frowning: is there a way to request support from other members to help us?

It’s polling motion in the live logging section, so it’s definitely sending the commands. I just don’t know how to edit the code to make it register the motion as active

OK I got a sort of temporary working motion sensor now. I used this device handler

The motion sensor now reports a motion when it first picks up a motion, but it won’t check in again for 30 seconds, so what I’ve done is change line 77 of the code from

if (value == "active") {
	def timeout = 2

to

if (value == "active") {
	def timeout = 30

That way the sensor shows “MOTION” for 30 seconds when it first picks up motion and if it picks up motion again after this 30 second period, it will stay on. If not, it reverts back to “NO MOTION”.

1 Like

FYI, if you go to the device settings, you can change the motion timeout in there rather than editing any code :slight_smile:

anyone getting battery readings for the door sensors. only open/close is being reported.

anyone make any progress with the contact sensors ? battery / tamper and temp?

Hi Simon, thanks for the work.

I’ve just bought the new Hive Motion sensor. Followed your instructions, smartthings finds and links giving it a smartthing icon. However it just says please wait. I manually updated the ‘type’ (in the web device list) to your device handler ‘hive motion sensor’. Please wait, went and not its just in a constant ‘motion’ state.

Any help would be appreciated.

Hi I have both a contact sensor and a motion sensor not tried the motion sensor yet but the contact sensor is connected but not changing status to closed it just says open all the time.
Any help please?

My hive motion sensor is stuck on motion. No temperature or battery reporting either. :frowning:
It worked for a while and stopped. I’ve reset the whole hub and started over, no joy.
Is there a way I can see what communications the motion sensor is sending/receiving?

Mine both seam to be working fine now

@frazhd2 What did you do to get this working? I am trying to get the motion sensor working - used the Orvibo device handler and changed the value from 2 to 30 as suggested above. No luck so far.

Hi, I have tried everyting to get the montion sensor to work and it seems to me the device handlers just dont work. Shame as the other Hive intergration with eh stat and bulbs works really nicely. Going to try contact sensors shortly so will see.