If I change my Hive Heating externally to ST, i.e. using the actual Hive app, ST does seem to detect and reflect whatever the change was (for example, changing from off to boost).
However, the controls for Hive Heating in the ST app don’t seem to perform any changes at all. Changing temp or changing mode, it thinks about it for a few seconds and then just gives up and keeps whatever the setting was before.
So it only seems to be a one way thing. The Hive Connect ST smartapp can read changes fine, it just can’t make changes itself.
@Alyc100
ST IDE log output for the Hive (Connect) smartapp shows messages about the authorization header needing certain parameters, as shown in the attached screenshot.
Very strange. I just had a look at mine. I’m not getting any of those errors you’re seeing and also changing the values in the device handler synchronises with Hive just fine. Anyone else having issues?
When you are in the app and tap the area that says ‘Tap to refresh Authentication’ make sure you have Live Logging open and let me know if you see any error messages that appear in there. Make sure that you don’t post any tokens in this public forum.
TypeError: Cannot read property ‘split’ of undefined
at login (c:\Users\glenb\node_modules\amazon-user-pool-srp-client\index.js:144:55)
at Object. (c:\Users\glenb\node_modules\amazon-user-pool-srp-client\index.js:179:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
I see Andrew (post 353) had the same issue but resolved it with a reboot. But that did not work for me.
The environment variables in step 9 haven’t been defined properly. If using Windows 10, you need the commands $env:CognitoUserPoolUsers = ‘eu-west-1_SamNfoWtf’ and then $env:CognitoUserPoolClientWeb = ‘3rl4i0ajrmtdm8sbre54p9dvd9’
If that fails, you can always edit the index.js to hardcode these values.
replace all occurrences of process.env.CognitoUserPoolClientWeb (appears twice) with '3rl4i0ajrmtdm8sbre54p9dvd9'
and all occurrences of process.env.CognitoUserPoolUsers (appears once) with 'eu-west-1_SamNfoWtf'
so for example the line (appears twice in index.js) ClientId: process.env.CognitoUserPoolClientWeb
becomes ClientId: '3rl4i0ajrmtdm8sbre54p9dvd9'
and the line (appears once in index.js) const userPoolId = process.env.CognitoUserPoolUsers.split('_')[1]
becomes const userPoolId = 'eu-west-1_SamNfoWtf'.split('_')[1]
Alex,
All seems to be working well. I can control my Hive devices (Heating, bulbs and smart plugs) from Smartthings/ActionTiles, with feed back received from all devices as well.
Again, thanks so much for your help.
For me is still the same. When i started whole process again i had “Tap to refresh authentication” and after some time it changes to “Authenticated as null. Tap to refresh authentication” (I’m doing that on Linux (debian 10) and on Windows 10) .
That is my log from Simulation when I’m pressing “updateDevices”: https://pastebin.com/qmQKh6M6 (ofc. i hid all tokens)
And log from " Live Logging" on IDE when I’m opening Hive (Connect) app and pressing “Done” in SmartThigs: https://pastebin.com/DRWjQvew
I think your integration might be working. Check your devices. The username isn’t actually being populated from an API like I thought, it’s just a value I had hanging around from an old value I had typed in with the older version of the smart app (doh!).
Will look to update this in the code, but I think you’re actually up and running.
EDIT: Update code to 3.2c from Github. Removed username reference as it’s redundant. Should now say AUTHENTICATED if working or NOT AUTHENTICATED.
Remember when you update from GitHub, you will have to paste in HiveTokens.json content again. You probably shouldn’t have to regenerate again though. Just copy the last value generated.
Now in Hive (Connect) I can see “AUTHENTICATED. Tap to refresh authentication” but when I want to click “Devices” I have nothing to select (only black screen with “Next” on the bottom). When I press “Next” I’m getting “We.re having trouble connection. Check your network connection and try agian.”
Ah. There was a missing def on that line from when I was playing about with some code. I’ve updated GitHub but you can quickly fix by changing line 1197 as below:
resp = apiGET("/products") to def resp = apiGET("/products")
Now I can see all of my devices buy when I’m pressing “Done” after select all of them there is a Error “We’re having trouble connection. Check your network connection and try again.”
But! Some devices has added (about 4 or 5). After repeat that process i had the same error but again has been added 4 or 5 devices. I was repeating that few times until all devices has been added. Everything is working now <3
Thanks Alex, all working now for me in the ST Cloud.
I did try porting the app back into HE, but received the 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)]’
after hitting ‘Next’ following successful authentication. Not sure if it’s an obvious issue with the porting of the app (before Hive messed around with the authentication there wasn’t any problem using the previous SmartApp code).
I hadn’t realised that you had updated the Hive Heating DTH back in mid-October, to reflect a URL change. So I was running an older version of that DTH.
I have now updated the Hive Heating DTH to the latest from your GitHub, as well as updated the Hive (Connect) smartapp to the latest v3.2c.
Regenerated the HiveTokens.json file again and pasted its contents into the smartapp in ST IDE at the appropriate line.
Now my new ST app reads the thermostat data AND the controls work again (thanks to updating the DTH)
I see AUTHENTICATED in the smartapp and all looks to be working as expected again.
Thanks again for all your work and help on this, always appreciated. I just hope BG doesn’t decide to mess things up for us again anytime soon