[OBSOLETE] - Hive (Connect) V3.2c (British Gas Hive)

UPDATE 07/12/2020: Hive have disabled username and password authentication for the Hive API. You now have to externally generate the Hive tokens and paste them into the smart app code. I know this isn’t easy process for non coders, but I have updated the step by step instructions as much as I can to walk people through the process. If you have any issues, you can discuss them with the community on this thread. I will try to help out if I have a spare moment.

The latest version of the unofficial Hive / SmartThings integration. This now utilises the new BeeKeeper API which stopped compatibility with some Hive devices and SmartThings. Now with added Hive Colour Bulb support!

In order to clean up the device types I had to refactor filenames and app names. This means that refreshing from Github in the SmartThings IDE may not work so you might have to manually copy from GitHub and paste over the old code. If you have time, i would recommend to uninstall the v2.0 devices and reinstall from the alyc100 repo via the SmartThings IDE.

NOTE: This smart app requires the Hive Hub to function.

Original Author - @Alyc100

Noteworthy Contributors
@iBeech - Hive Bulb support / Hive Active Plug support
@bibbleq - Hive TRV support

Donations
This integration is provided completely free of charge and is open source. If however you really feel like it, you can make a donation here

Latest Versions

SmartApp

Device Handlers

Screenshots

image

Supported Devices
The Hive (Connect) app currently supports the following Hive devices:

  • Hive Active Heating (all versions)

  • Hive Active Hot Water (all versions)

  • Hive Dimmable Bulb

  • Hive Cool to Warm White Bulb

  • Hive Colour Changing Bulb

  • Hive Active Plug

  • Hive TRV

Installation Guide
To install the Hive (Connect) app:

  1. Add the Hive (Connect) app from GitHub as a new ‘My SmartApps’, select create from code option and paste. Save and Publish.

  2. Add the Hive Heating device type from GitHub as a new ‘My Device Handlers’, select create from code option and paste. Save and Publish.

  3. Add the Hive Hot Water device type from GitHub as a new ‘My Device Handlers’, select create from code option and paste. Save and Publish.

  4. Add the Hive Bulb device type from GitHub as a new ‘My Device Handlers’, select create from code option and paste. Save and Publish.

  5. Add the Hive Tuneable Bulb device type from GitHub as a new ‘My Device Handlers’, select create from code option and paste. Save and Publish.

  6. Add the Hive Active Colour Light device type from GitHub as a new ‘My Device Handlers’, select create from code option and paste. Save and Publish.

  7. Add the Hive Active Plug device type from GitHub as a new ‘My Device Handlers’, select create from code option and paste. Save and Publish.

  8. Add the Hive TRV device type from GitHub as a new ‘My Device Handlers’, select create from code option and paste. Save and Publish.

  9. Add the Hive (Connect) app within the ST app from the Add SmartApp page in the SmartApp section and locating the Hive (Connect) app under the ‘Custom’ section which should be at the bottom of the list.

NEW: GENERATE HIVE TOKENS EXTERNALLY
First you need to generate tokens for your Hive account. Make sure 2 factor authentication is DISABLED in your Hive account.

  1. You need a computer where you can run node.js.

  2. Install node.js if you haven’t already. Node.js

  3. Check nodejs is installed. In a terminal (or Command Line) run
    node -v
    you should see a version number appear which means it’s installed.

  4. Run ‘npm init’ and keep pressing ENTER to create a package.json file. You should type YES when prompted 'Is this OK? (yes) ’ to complete.

  5. Run ‘npm install amazon-user-pool-srp-client --save

  6. Run 'npm install axios --save

  7. Download index.js from Dropbox - index.js - Simplify your life and replace the index.js already present in ‘node_modules/amazon-user-pool-srp-client’ with downloaded one. On OS X, my node-modules folder was located in my Home directory.

  8. Edit the index.js and add your Hive user email and password at your end of the file and save. It should be obvious which lines you need to edit to do this.

  9. Set the environment for the index.js script:

OS X/UNIX/Linux - In the amazon-user-pool-srp-client directory run
export CognitoUserPoolUsers=eu-west-1_SamNfoWtf CognitoUserPoolClientWeb=3rl4i0ajrmtdm8sbre54p9dvd9’.

Windows Powershell - In the amazon-user-pool-srp-client directory run
$env:CognitoUserPoolUsers = ‘eu-west-1_SamNfoWtf’ and then
$env:CognitoUserPoolClientWeb = ‘3rl4i0ajrmtdm8sbre54p9dvd9’

  1. Run ‘node index.js > HiveTokens.json’ to generate your token file.

NOTE: If you get an error running step 19 below that looks like TypeError: Cannot read property ‘split’ of undefined, it might be that the environment variables were not set properly in step 18. Try hardcoding the values in index.js described here → [OBSOLETE] - Hive (Connect) V3.2c (British Gas Hive) - #377 by Alyc100 and redo step 19.

Now you need to paste the token values into the Hive(Connect) app.

  1. Open the HiveTokens.json file in a text editor.

  2. Edit the Hive(Connect) smart app in the Smartthings IDE

  3. In the Smartthings Hive code at line 105, you should see

def hiveTokenString = 'PASTE HiveToken.json content into here'

NOTE: Would have ideally had this in App Settings, but the tokens are too long Smartthings IDE doesn’t like them.

  1. Copy the contents of HiveTokens.js file and paste them into the ‘’ single quotes in line 105. It’s a very long string.

  2. Save and publish the code.

  3. Go into the SmartThings mobile app and go to SmartApps section.

  4. Open Hive(Connect) app

  5. Tap ‘Done’.

  6. This should refresh the new tokens. Open Hive(Connect) app again.

  7. Hopefully it should say ‘AUTHENTICATED’.

  8. You should be able to select your thermostats and hot water devices in the configuration screen.

  9. Once you have selected your devices, click Done on the top right.

  10. Your selected devices should automatically be configured and appear under ‘Things’ with the label [Thermostat Name] Hive Heating/Hot Water (may require SmartThings app restart).

11 Likes

completely new to SmartThings and I followed your installation, but it still doesn’t pick up my thermostat, any other troubleshooting?

Did you see an error message during the set up process?

No errors, immediately got the successful login message to add devices but none are available (though only have the thermostat)

Hiya, got a bit of a weird one.

I’ve got two simulated switches in ST - “Boost Heating” and "Boost Water"
I’ve set up the Automations in the Hive Smartapp to respond to these switches to boost heating and water respectively.

The water one works, and if someone hits the Water button in ActionTiles (or presses it in the ST app) then the water boosts.
The heating one doesn’t respond. But if I go into the Hive Smartapp in ST, head into Automations, choose Heating, and then just click “Save” then the heating instantly boosts - whether I do that 10 seconds, or 10 minutes later. It’s like the boost command got stuck somewhere until I nudged it by clicking “Save” - even though I didn’t change any settings. I guess it might also be polling for that switch when I hit Save, as it’s already On by then.

Any thoughts? I don’t know how long it’s been happening, because I’m dead stingy so haven’t had the heating on since March… but I have updated the SmartApp and Device Handlers to the latest versions, hence posting in this thread.

1 Like

How did you create the simulated switch for Hot Water Boost?
I want to try and create a 20 minutes hot water boost that can be activated by Google Assistant but having a bit of trouble figuring it out.

managed to figure it out…finally.
my home/things/hot water/ set boost 20 mins
create virtual switch in ST IDE
automation/smartapps/hive connect/hive automation/create a boost 20 configuration.
link to ifttt with assistant

I’m getting this as well now but with hot water boost. Seems to get stuck

@Alyc100 any chance you’d know what we’re doing wrong?

any reason to use this rather than connecting the bulbs directly to the Smartthings hub?

Nope. This will use the Cloud integration rather than the local ZIgbee connection.

ok thanks, managed to get a free hub and a few bulbs from British Gas. no thermostat yet.

trying to decide whether to use the hub or ditch it and just connect straight to smartthings.

Ha ha I’ve just done the same thing today claimed the free reward :slight_smile:
I didn’t know you could add the bulbs direct.

Is there Google Home integration with this please?
I can see my heating and hot water in my Things, and in Google Home Devices but cant find any voice commands that actually do anything, i.e.
boost my downstairs heating
what is the downstairs heating temperature?

Update:
Thanks to this great project (and a simulated switch) I now have google voice control for boosting my heating, and with my own boost defaults. Something I just could not do any other way. Awesome work folks.
Still cannot find any way to retrieve temperature from the hive hubs sadly, but suspect thats simply not fixable with Google Home not supporting sensors.

Great work though,
Thanks

Recently got Hive Multi Zone installed and was delighted to find this integration available. First time playing with the IDE and Smartapps so thanks for the great instructions and contributions folks have put in to make this possible, Alex i’ve made a small donation hopefully enough to buy a few drinks or put towards another Hive product :slight_smile:

1 Like

Thank you very much Markos!

1 Like

I’m completely new to the world of SmartThings and custom apps, I have tried following your instructions but I can’t see the connect app in the “My Apps” section of the SmartApps marketplace. In the my smartapps section of the web api I see:
Namespace / Name: alyc100 : Hive (Connect)
GitHub RepositorySmartThingsPublic (master) : SmartThingsPublic (master)
Status : Published

Have I done something wrong of does it take a while for it to show up in the smartphone app?

EDIT
For some reason when I went to the “My Hubs” bit and it was empty then it refreshed and was in there but the code had gone… Odd! It shows in my apps now tho :+1:

Anyone else find that ‘what is the temperature of X’ through Google Home only works for thermostats that are currently heating?

I find that if the thermostat is off, Google Home says ‘I’m afraid there was an error and I am unable to control your device’.
If the thermostat is on, it replies with ‘its currently 19.5 degrees’ , or it says current and target temperature.

Are you planning to have device handlers for Motion and Contact Sensors?

I am happy to write one if you can share documentation of new APIs. I have written few with Node-Red using old APIs.

Do you have a hive motion sensor ?
Just wondering if they report LUX