Hive Integration

Tried to use Alexa through node red to control it but that doesnt seem to be working either. I guess their skill has broken too.

Actually it does look like its still working just takes a few minutes to update, might be able to use that as a work around.

So hopefully just a matter of figuring out the auth method…

1 Like

Hi, I’m no expert but I have been boosting my hive heating via sh script for a while now and when I noticed that hive integration no longer worked this morning I realised my boost script did still work. I then have just tweaked the url I’m posting to turn on my hive light and it worked. I’ll post as much as I can and answer any questions. Hope it helps…

#!/bin/bash
INSTANCE_REGION="$(curl -H ‘Host: beekeeper.hivehome.com’ -H ‘Content-Type: application/json’ -H ‘Accept: /’ -H ‘User-Agent: HiveRNApp/10.16.2 Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148’ -H ‘Accept-Language: en-gb’ --data-binary ‘{“username”:“myemail”,“password”:“mypassword”,“devices”:true,“products”:true,“actions”:true,“homes”:true}’ --compressed ‘https://beekeeper.hivehome.com/1.0/cognito/login’ | python -c “import sys, json; print json.load(sys.stdin)[‘token’]”)"
echo $INSTANCE_REGION
curl -H ‘Host: beekeeper-uk.hivehome.com’ -H ‘accept: /’ -H ‘content-type: application/json’ -H ‘accept-language: en-gb’ -H ‘user-agent: HiveRNApp/10.16.2 Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148’ -H “authorization: ${INSTANCE_REGION}” --data-binary ‘{“status”: “ON”}’ --compressed ‘https://beekeeper-uk.hivehome.com/1.0/nodes/colourtuneablelight/709cc3e4-0b04-4cc4-8e26-b15ec455766f?homeId=myhomeid

1 Like

Interesting, @bradderz… you are using cognito and the pyhiveapi currently uses global
I’ve just changed my version of pyhiveapi to see if it works …

@bradderz @rendili
Fix to get this working is to change the following in pyhiveapi:

 HIVE_API.urls.global_login = "https://beekeeper.hivehome.com/1.0/global/login"

Change the above to:

 HIVE_API.urls.global_login = "https://beekeeper.hivehome.com/1.0/cognito/login"

I can confirm this gets the HA Hive integration going again, so we just need this change made in pyhiveapi

1 Like

Nice one guys, I will test on my system later tonight then release a new pyhiveapi version with the change. Will need to then create a PR with the updated version, this could take a while.

1 Like

I’ve changed the url to incognito in my version of pyhiveapi.py in my custom_components folder and also installed pyhiveapi via pip3 and changed the url in that file in site-packages but still don’t get my hive devices. Any advice what I might be doing wrong please?

@bradderz As a hack on mine … i have edited the init.py file within custom_components/hive

“”“from pyhiveapi import Pyhiveapi”"" ---- Original line
from .pyhiveapi import Pyhiveapi

I have a copy of the pyhiveapi file in the custom_components/hive directory
The copy of the pyhiveapi file has the changes i mentioned in previous post for the url with cognito in.

Once you have made the changes remember to restart hass to reload the integrations… lovelace now showing the climate devices

1 Like

Hi. I did exactly the same thing but whenever I restart HA I get a text from Hive with a verification code and still nothing works. Suggests some sort of 2FA in play?

hmm, possibly i haven’t got any 2fa on my account (didn’t know you could). Not sure what to suggest :no_mouth:

I tried to enable Hive 2FA a while back and it broke HA integration so I needed to disable it again. I’ve now got Hive and HA working again - I just had to rename the folder to pyhiveapi rather than pyhive in custom_component folder.

Yep, I had 2FA enabled on my account. Disabled through the Hive app, restarted HA and all works! Thanks all. Now just need to wait for the “official” fix.

Thanks @bradderz and @MagicalTrev89 that custom component hack has got me back online for now :grin: :clap: :clap: :+1:

Fix is up. Thanks a lot guys, everything is back online now.

1 Like

Hi All,

I have made the URL change and updated the custom component to use the new version. This should be available in HACs as version 2020.0

Will look at doing a PR to add this into home assistant core code

@rendili

5 Likes

Any advice for running HA in a docker instance? I’ve editted /usr/local/lib/python3.8/site-packages/pyhiveapi/pyhiveapi.py and changed URL to “cognito” but no dice…

@splendid Home assistant does use the standard site-packages installed within python its uses its own which are store in the home assistant config folder. the pyhiveapi library will need changing there

Thanks @Khole, but I’m struggling to find where you mean?

Im not familiar with the docker stuff and where HA stores it packages I know on standalone build it is in the home assistant configuration folder.