Hive(connect) problem

Hi.
I installed aylc100’s Hive connect and the device drivers and all was working fine but since the last hubitat upgrade it has stopped working.
When i go into the app now it won’t let me login with error code 401. Any ideas please?

There was a problem connecting to Hive. Check your user credentials and error logs in SmartThings web console.

Error: 401: [error:NOT_AUTHORIZED]

Look for this piece of code....

def getBeekeeperAccessToken() {
try {
def params = [
uri: apiBeekeeperURL('/global/login'),

CHANGE the word 'global' to 'cognito' this fixes the issue.

It was nothing to do with Hubitat, it seems that hive had a change of address...

Baz
I’ve no idea how you know this magic, I’m impressed.
I looked through and this already says cognito possibly from where I deleted everything and reinstalled everything. Any ideas what I do now?
Very grateful for your time.

I also found out that their username input field is now case sensitive where it never used to be. And they now support 2 factor authentication.

Make sure you have gone onto the my hive website

http://my.hivehome.com/

and disable 2 factor authentication or it won’t allow you to use hive connect from hubitat.

I’m amazed thanks.
It has got me through authentication fine and I’ve changed a few things mentioned elsewhere. I can see my heating and hot water ck trolls but it doesn’t add light or active plugs as devices. They are found and selected in the hive connect app but just don’t then appear as devices anywhere. Hopefully this is the last hurdle?
Cheers.

From what I can gather you may have only installed the hive connect app and the heating driver. For bulbs and plugs etc you will also need to install the relevant driver from alyc100’s repo.

Hi there.

First post go easy on me :slight_smile:

I'm a current SmartThings user here and I'm looking for alternatives as I see the ST platform become increasingly unreliable as it moves away from where it started. Hubitat looks of interest and leads me to ask the following question.

I'm wondering if anyone has the Hive Connect app working as discussed above?

I have an interesting use case where I have 3 zones and 4 thermostat/switches. I have two wired in parallel so that I can have complete independent control over multiple rooms in one of the zones. For that reason I'd like to wrap some automation around the TRV's having them mimic stats in order to control the rads in the rooms.

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: