Closed pjestico closed 3 years ago
Hi,
I need to look into this as it looks like they have changed the authentication.
Hi, Any update at all? I really want to get this module back up and working on my mirror!
Hi, I have been looking into this. Seems like British Gas are now using Amazon Web Services for the authentication. Some clever folks look to have worked out what is needed to connect, but I am not sure whether the solution will work with Magic Mirror where you have no interaction bar the initial module setup. I'll look into it in a bit more detail at the weekend
Changes have been made to use the new login method. I've tested it to a certain extent and it all appears to be working. Give it a test and let me know...
Caveat to these changes - you will need to disable 2FA initially, and once the install process has been followed 2FA can be re-enabled.
Hey, thank you so much for this module.
we got 2 issues, number one: the file index.js doesnt exist in MMM-Hive/tokenGeneration
and secondly: if we ignore above and continue with editing index file.
after adding (login('xxxx@xxxxxx.com','xxxxxxxxx')): to the bottom of the file. we get the following error:
pi@magicmirror:~/node_modules/amazon-user-pool-srp-client $ node /home/pi/node_modules/amazon-user-pool-srp-client/index.js > /home/pi/node_modules/amazon-user-pool-srp-client/HiveTokens.json /home/pi/node_modules/amazon-user-pool-srp-client/index.js:122 (login('xxxxx.com','xxxxxx')): ^
SyntaxError: Unexpected token : at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
can you please suggest what i should do as i have deleted and installed multiple times and followed everything as requested.
Thank you
Hi, I have tried to get it working tonight and still have an issue:
[2021-04-02 23:11:02.108] [ERROR] Whoops! There was an uncaught exception...
[2021-04-02 23:11:02.111] [ERROR] Error: ENOENT: no such file or directory, open '/home/pi/node_modules/amazon-user-pool-srp-client/HiveTokens.json'
at Object.openSync (fs.js:447:3)
at Object.func (electron/js2c/asar.js:138:31)
at Object.func [as openSync] (electron/js2c/asar.js:138:31)
at Object.readFileSync (fs.js:349:35)
at Object.fs.readFileSync (electron/js2c/asar.js:580:40)
at Object.fs.readFileSync (electron/js2c/asar.js:580:40)
at Class.getData (/home/pi/MagicMirror/modules/MMM-Hive/node_helper.js:41:24)
at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-Hive/node_helper.js:136:9)
at Socket.
I did a git pull && npm install with 2FA disabled on the hive app, then enabled 2FA and reloaded MM
Thanks!
Hi,
Realised this morning I'd forgotten the index.js 🤦♂️
It's there now though, so please use that file when following the install. When you open the file you will see at the bottom there is already a section to add your Hive username and password, so overwrite the xxxxx's with your details so it should end up like this (I've included extra lines from the file to make it easier to see where to edit):
})
.then(({ AuthenticationResult }) => {
console.log('{"token":"'+AuthenticationResult.IdToken+'",'+
'"refreshToken":"'+AuthenticationResult.RefreshToken+'",'+
'"accessToken":"'+AuthenticationResult.AccessToken+'"}')
})
})
}
login('hive@hive.com','P@55W0RD')
Once that's edited, save and you should be good to follow the remaining steps.
Working perfectly now!! Thanks so much for your effort and a great module!
Fantastic - glad it's working 👍 and thanks for letting me know
Just in case you wanted to add it, I also added a batteryIcon option in this release that shows the Thermostat battery. It hasn't been fully tested, but looks to work correctly.
Tried the batteryIcon but i dont see any change on the module :(
Oh, that's disappointing. Just tested again on my end and you should see it next to the inside temperature (as per the below, highlighted in the red square). Can you send me you config.js for the MMM-Hive (blank out the username / password if they are still in the file).
Definetly no icon, config below:
module: "MMM-Hive",
header: "Hive",
position: "top_right",
config: {
temperatureSuffix: "°C",
// username: "xxx", // password: "xxx", postcode: 'xxx', updateInterval: '120000', //60000 is 1 minute showNext: true, //shows target temp insideIconSet: 'fa fa-fire', //fa fa-fire or fa fa-home or any font awesome font insideText: 'Hallway', highestTemp: '24', // full icon temp highTemp: '20', // 3/4 icon temp lowTemp: '18', // 1/2 icon temp lowestTemp: '15', // 1/4 icon temp, below this will show empty batteryIcon: 'true', //displays battery level of thermo animatedLoading: 'true', //animates loading image }, },
i have commented out the username and password from the file, i guess now 2FA is used it does not need them here?
Can you remove the single quotes either side of the true settings for batteryIcon and animatedLoading same as below:
{
module: "MMM-Hive",
header: "Hive",
position: "top_right",
config: {
temperatureSuffix: "°C",
// username: "xxx",
// password: "xxx",
postcode: 'xxx',
updateInterval: '120000', //60000 is 1 minute
showNext: true, //shows target temp
insideIconSet: 'fa fa-fire', //fa fa-fire or fa fa-home or any font awesome font
insideText: 'Hallway',
highestTemp: '24', // full icon temp
highTemp: '20', // 3/4 icon temp
lowTemp: '18', // 1/2 icon temp
lowestTemp: '15', // 1/4 icon temp, below this will show empty
batteryIcon: true, //displays battery level of thermo
animatedLoading: true, //animates loading image
},
},
Its working great now after this suggestion, thanks again!
I have two factor auth enabled on my account after repeated badgering from the App to enable it. This prevents the module from logging in. Is there a fix planned for this?