Hive(connect) problem

The hive connect app will do that. I’ve got a similar arrangement.
To be honest I was thinking of getting rid of Hive so I have less interfaces as it can be done directly from hubitat.

1 Like

I might be missing the point here, are you guys saying I should be able to take the code form GitHub and load straight into HE?

When I do that I receive:

unable to resolve class physicalgraph.exception.NotFoundException @ line 1012, column 7. unable to resolve class physicalgraph.exception.ConflictException @ line 1014, column 7.

Which is within this bit of code:

 //Remove devices if does not exist on the Hive platform
  getChildDevices().findAll { !selectors.contains("${it.deviceNetworkId}") }.each {
	log.info("Deleting ${it.deviceNetworkId}")
    try {
			deleteChildDevice(it.deviceNetworkId)
    } catch (physicalgraph.exception.NotFoundException e) {
    	log.info("Could not find ${it.deviceNetworkId}. Assuming manually deleted.")
    } catch (physicalgraph.exception.ConflictException ce) {
    	log.info("Device ${it.deviceNetworkId} in use. Please manually delete.")
    }
	}

Can anyone steer me?

Bit of searching in the forum's led me to this:

Change all references of physicalgraph to hubitat

Time for a tinker :slight_smile:

Which leads me to this:

app:68:2020-11-28 16:24:13.044 [error] groovy.lang.MissingMethodException: No signature of method: user_app_alyc100_Hive__Connect__98.findChildAppByName() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values: [Hive (Connect)] on line 167 (mainPage)

Would one of you that has it working mind posting the code for the app and the driver please?

1 Like

Baz, thanks for the help here. For anyone else struggling here's a consolidated list of steps to get it working:

  1. Import the Apps Code from the following location and save it: https://raw.githubusercontent.com/alyc100/SmartThingsPublic/master/smartapps/alyc100/hive-connect.src/hive-connect.groovy
  2. Import the driver from here: https://raw.githubusercontent.com/alyc100/SmartThingsPublic/master/devicetypes/alyc100/hive-heating.src/hive-heating.groovy and save it
  3. The App will flag an error when saving it so you have to change all references of physicalgraph to hubitat, I did this at lines: 1012 1014 the driver then saves successfully.
  4. Add the newly defined User App 'Hive Connect'
  5. Load the app, you are prompted for credentials (note that I don't have 2FA enabled in the Hive account)
  6. I get the message "You have successfully authenticated to Hive" - Great!
  7. The app then throws the error:
    Error: No signature of method: user_app_alyc100_Hive__Connect__132.findChildAppByName() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values: [Hive (Connect)]
  8. A Baz states I then make the changes referenced in his other post:
  9. In the App edit all references to 'app.namespace' and change it to "alyc100" ( I think the first one is on line 1030), make sure you post the alyc100 in quotes as above.
  10. In the App remove the line: def tmaApp = findChildAppByName( appName() )
  11. Then on the next line of code replace:
    if(tmaApp) {
    with
    if(childApps) {

@Baz2473 thanks heaps for this, really appreciated :grin:

1 Like

No worries.
I’m glad you managed to get it all working. I’m sure your instructional write up will be helpful for anyone else trying to accomplish this. :+1:t3:

I didn’t post my working code because I’ve adjusted it so far from the original it would not work for other people trying to use it.

1 Like

Thanks again! Out of interest have you got any Hive TRV's in use?

No, sorry. I got rid of all my smart trv's a few years back when the heat from the rads made the plastic pushrod attached to the solenoid melt. that was an expensive lesson learned.

Looks like they've changed something on the Hive end again!

{"message":"Forbidden"} when you try and access the url.

Home Assistant Community talking about a possible enforcement of 2FA??? Hive Integration - Third party integrations - Home Assistant Community

It’s happening on both the ST and HE versions of Hive (Connect) - I wouldn’t mind them enforcing 2 FA (in-fact I would enable it by choice) just as long as you can generate ‘app passwords’ like you can for most other platforms.

If you guys have the energy:

Potential workaround here:

Thanks brumster instructions were really useful for a noob such as myself. However I can't get past step 5, any ideas anybody please? I have checked and 2FA is off but I get this message when trying to authenticate.

Error: Unable to determine the current character, it is not a string, number, array, or object The current character read is 'P' with an int value of 80 Unable to determine the current character, it is not a string, number, array, or object line number 1 index number 0 PASTE HiveToken.json content into here ^

1 Like

The integration is broken atm following a change made by Hive to prevent access to the API. The guys on the ST forum appear to be getting somewhere but I think any success will be short lives when ST eventually pull the plug on the IDE. Solving this is beyond me so I'll sit here hopeful that some bright spark can solve the issue so that integration with HE works again at some point.

Seems like the ST are having some success.

Just tested this and it works :slight_smile:

So I've just had a go. All credit goes to the guys on the ST forum linked above. Here's what I did following the instructions on the ST forum, described here with related modifications to make it work on HE!

Install the Hive Connect app from here: https://raw.githubusercontent.com/alyc100/SmartThingsPublic/master/smartapps/alyc100/hive-connect.src/hive-connect.groovy

Then:

  1. In the App edit all references to 'app.namespace' and change it to "alyc100" , make sure you insert the alyc100 in quotes as above.
  2. Then on the next line of code replace:
    if(tmaApp) {
    with this:
    if(childApps) {

Install the driver:
https://raw.githubusercontent.com/alyc100/SmartThingsPublic/master/devicetypes/alyc100/hive-heating.src/hive-heating.groovy

And then comment out these two lines:
capability "tigerdrum36561.boostLabel"
capability "tigerdrum36561.boostLength"

Note: Removal of these lines likely to break the boost functionality! I'm not sure at the stage. If anyone else has a view on this let me know please.

Then do this:

  1. You need a computer where you can run node.js. I'm using a Mac, this took minutes with OSX, I can't comment for Windows!
  2. Install node.js if you haven’t already. https://nodejs.org/en/ , on the mac: brew install 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 https://www.dropbox.com/s/f9zphtaomgaqwoa/index.js?dl=0 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.

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 app
  3. Intentionally blank
  4. Copy the contents of HiveTokens.js file and paste them into the ‘’ single quotes in line 109. It’s a very long string.
  5. Save and then add the app.
  6. Go to Apps and add the Hive App
  7. Hopefully it should say ‘AUTHENTICATED’ in the smart app.

Thanks again to @Baz2473 as well as the guys on ST forum. @Baz2473 if you have any ideas on these two lines let me know:

    capability "tigerdrum36561.boostLabel"
    capability "tigerdrum36561.boostLength"

Hi there,

Would you mind pasting a copy of the App code you are using, as there are 2 sections where if(tmaApp) { is referred to (Lines 183 and 322) - however when I try and run the app I get the following error:

Error: No signature of method: user_app_alyc100_Hive__Connect__289.findChildAppByName() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values: [Hive (Connect)]

Many thanks,
Guy

Guy, I won't past the code just yet as it has my token in it.

Did you do this:

In the App edit all references to app.namespace and change it to "alyc100"

Make sure you post the alyc100 in quotes as above.

I only updated the first instance of this:

if(tmaApp) {
with this:
if(childApps) {

The 2nd relates to automations which I don't use) but I've just updated it any way. Good spot!

Hi there,

I'm still having an issue running the App - are you able to paste a copy of the code obfuscating your token please (or just completely excluding line 109)

Many thanks,
Guy