Climate control GeniusHub

I have created a component to get data from my Genius hub. Not sure if this is the right place for it as it can also produce motion and luminance data so isn’t just climate. Work love someone to review my code and advise. I also think I need to switch to asynio to avoid blocking.

Code can be found here: https://github.com/GeoffAtHome/genius-hub-home-assistant

Hi Geoff,

I’ve been waiting in vain for Genius to expand their connectivity options beyond IFTTT so your work is very welcome. I’ve got the files uploaded and the config added, i believe i’ve managed to sniff out my api key from the traffic going between the genius hub and the cloud servers but i’m not seeing anything in the overview in HASS. Is there something else i need to do? I’ve literally set up my first HASSIO pi today so apologies if this is a stupid question.

Hi,

Sorry I have been away travelling.

The API key used to be found in the about tab on the UI. This appears to have now been removed. This is NOT the same as the Autorization token that can be seen in the request headers.

If you logout of the hub and click/double click, on the “Welcome” text on the login screen some additional options appears. It maybe that when the Connect to “LocalHub” is selected and tunnel is turned off and you are on the local network the API key is displayed.

The request you should see is something along the lines off:
http://xxx.yyy.zzz.aaa:1223/v3/zone/ZZ/?sig=KEY

Where:
xxx.yyy.zzz.aaa is the IP address on the local network.
ZZ is the zone
KEY is the API key.

I’ll need to take a look when I am connected locally to my Genius Hub and get back to you… hopefully later today.

Just check when I am connected locally to my hub and I can’t see the API key anymore. The code still works but it looks like between v2 and v3 the authentication has been improved. I need to upgrade the scripts to workaround this which will take me sometime…

The key can be found by using Chrome when connected to the hub. Using the Chrome developer tools, navigate to the Application tab. Under “Storage\Local Storage” select the https://genishub.co.uk node as illustrated below.

(upload://cW5mG0Ykwz69Mc38cQSNVQnqnMU.png)

In the node “user::user-credentials” the required key is the data in quotes call signature.

Let me know how you get on.

Did you get it working? Did you see the post on how to get the key?

Hi Geoff,

Just attempting to install this as well. I am not seeing any new panels in the overview page for the component.

I retrieved the API using the ‘user::user-credentials’ string in Chrome and added to the configuration file - I put in the signature string without any quotes. Added in the files to the ‘custom_components’ folder (and sub folders). Restarted Home Assistant.

The log file for home assistant is giving me a warning about using a custom component for ‘climate.genius’, ‘switch.genius’ and ‘genius’ so I am assuming that the component is being loaded and I have something wrong with the configuration details.

I had gone into the https://my.geniushub.co.uk page to try to get an API key but that does not seem to be working at all. They seem to be missing files that are being called when trying to view the tokens on the account or trying to add a new token:

https://hub-server-1.heatgenius.co.uk/v3/auth/tokens
https://hub-server-1.heatgenius.co.uk/v3/auth/token

Any idea why it would not be showing for me on Home Assistant?

Cheers

Let me know if you get this going OK. I’m going to try it shortly too.

Hi,

Have you recently upgraded you HG Hub? When I upgraded my hub the v3 API stopped working. According to Simon from HG this should not be the case.

I recently revamped the code to make use of the new public API. This update was made three days ago. Are you using the latest code?

Tokens are obtained from here: https://my.geniushub.co.uk/tokens

Cheers,

Geoff

Its working for me but I do have some issues to resolve with getting it working with Alexa. The main part is mapping between what HG, HA and Alexa thinks a setting is.

Things left to do:

  1. resolve HA/Alexa issues
  2. Get it working with older APIs so it still works without reaching out to the internet
  3. Docker installation to make it easier for everyone.

Hi Geoff,

Hub is currently on version 5.2.2 build 0b71284.

Think I have the newest version of the code. I took the code down from your Git repo on Saturday morning (around 11am GMT) - had it been updated after then?

When I go to the Tokens page https://my.geniushub.co.uk/tokens it is giving me an error message saying ‘Failed to load tokens from hub, please try again later’ - same when I try to add a new Token. Looking at the Network tab in the console it is giving a 404 error when trying to do an AJAX call to https://hub-server-1.heatgenius.co.uk/v3/auth/tokens

I will get in touch with HG about the Tokens page not working to see if they can shed any light on that.

Cheers

From the notes about the new API I believe the hub firmware needs to be at least 5.2.4 or 5.2.6. These may be only beta release versions.

To get going:

  1. Ensure that your Hub firmware is v5.2.4

FWIW the version of my hub is 5.2.6. I know the tokens are not available until you hub is upgraded.

Hi Geoff / xAPPO,

Thanks for that - I put in a support request with Genius Hub earlier today as well so hopefully they will push me to the newest firmware when they answer that.

I have no idea (just did a quick google) if the updated firmware is available else where. It’s not available in the auto updater in my hub and I could only find change notes with the online search.

Cheers

5.2.6 is a beta release. You have to have opted into the beta program to be on this version. Only if you are in the beta program will that firmware show as an available upgrade.

I can confirm that I am in the beta program. I will look at updating the code to work with older firmware. This is something that I need to do as the public API is no accessible locally, which is the main reason why I like Home Assistant as much as possible is kept local.

I had a power outage that took my internet down for over 24 hours. Going out over the internet is not option when you network is down.

This will should not be a big deal as it is basically resurrecting the older code with some refactoring. This will take time (maybe a week or some) and then I will need someone to test with older firmware.

Updated to use non-public API. Configuration has changed as has the three genius.py files. Using the non-public API allows accessing the hub on a local IP address. This is more responsive and avoids problems when connection the internet is down.

This should also work with earlier versions firmware. I.e. you don’t need to be on the beta program.

I should also this configuration may not work with your set up. It works for me as in each zone I have both a TRV and sensor. If this does not work for you let me know and I can modify.

Revised for sensors and refactored.
Should be more robust for different setups.
If you can’t get this working drop me message.

Hi,

I’ve just been checking out the Genius kit. Apparently it’s z-wave compatible. Have you (or anyone) tried to control it directly via a z-wave interface?

Thanks!