Hive Integration

Yes it does.

Hi @PianSom,

I upgraded my DEV machine to 3.5 and so far all is working well with the Hive platform.

Personally I have no experience with hass.io, I donā€™t know if you need to do anything differently to get things to work there, but I guess Bobby_Nobble is confirming that it is working in hass.io?

1 Like

Thatā€™s what ā€yesā€ means :wink:

Excellent thanks - it might be worth moving over finally as the Hive integration is top priority for me.

Just temporarily change line 133 in \custom_components\light\hive.py file to:

SUPPORTFEATURES = (SUPPORT_BRIGHTNESS | SUPPORT_COLOR_TEMP)

removing the ā€œSUPPORT_RGB_COLORā€ option

This will at least enable you to turn light on/off

I have colour bulb installed, totally new to HA, but if you need data more then happy to help, just point me in the right direction to send you API information.

Hi @ProfKay

sorry i havnt got back to you sooner. i have been working on the Hive Colour Bulb with @roostlick and i am close to finishing it. just need to work out some niggles as i donā€™t have the bulb myself. Thanks for offering to help i could add you to a private group to help test it if you want?

Hi all and big thanks @rendili, @Khole and other contributors of the Hive integration component for Home Assistant.

First off I am a new user to HA so am still experimenting and ā€˜playing aroundā€™ to configure my system. So I fully expect to make newbie errors before I am fully up to speed.

My query is this:

I have a couple of Hive lights all set up and accessible from HA. We use an Amazon Echo to control the lights. When the lights are turned on/off using the Echo, the status doesnā€™t change in HA.

I understand that the Echo communicates directly with the Hive hub and HA is not notified immediately, but I expected HA to poll the Hive api and update the status eventually. A delay of a few minutes is expected, but right now the status never changes.

I can control the lights using HA so the communication to the Hive api appears to be working.

Is there something else I need to do or configure in a certain way to get the status to update?

There should only be a momentary delay if that before the status changes so sounds like youā€™ve got something wrong. You could always set up the lights in HA using emulated_hue and then control them from your Echo via HA rather than directly.

@Bobby_Nobble - thanks for your reply.

Ok thats good to know. I followed the setup and installation from instructions in this thread and this is a fresh install of Home Assistant so Iā€™m not sure why there would be a problem.

It seems that HA is connecting to the Hive api with no issues but is not updating the light status as it should. I am a coder so Iā€™ll have a look at the code and network data to see if I can find anything amiss.

Iā€™ll leave setting them up with emulated_hue as a fall back option if I canā€™t identify the problem.

Hi @Max_Bonner

The hive component polls the hive API every 2 minutes by default. If you have the below in your config that would override it and set it to 10 minutes for example

minutes_between_updates: 10

If the call to poll the hive API is failing it generally will put something in your HA log. Is there anything in the log?

Yes please, add me to the private group.

Hi @Khole, no I havenā€™t changed any configuration beyond adding the component with hive user/pass. It finds my two dimmable lights, with correct names.

My log is not showing any errors.

Lights are showing the correct status on the hive webpage/dashboard.

Can you suggest anything else to check? I am happy to run tests or debug code if it will help solve this problem.

Hi @Max_Bonner

Just to let you know I have also just recently installed HA, been using HIVE for the past year, I am using Amazon Echo to control Hive as well.

The HA console updates for me, all be it, with a delay. The only thing to note, is I have HASS.IO installation on a raspberry pi 3.

Thanks for the info - yeah I expect a delay between updates, but Iā€™m not getting any status changes right now :confused:

This in itself is not a big deal but I plan to incorporate more complex automation and scripting based on sensor inputs etc. and knowing the current status of lights will become more important.

I used the ā€˜All In Oneā€™ installer for my Pi 3 since I was already running a working MQTT/Node-Red installation.

@Khole - Iā€™ve noticed that if I restart HA and there is a Hive light switched on the status is correctly shown after reloading - but this then will not be updated.

I have switched on full logging - does the Hive component write any INFO/DEBUG entries to the log when the api is polled?

hi @Max_Bonner,

There is not any logging for when then Hive component retrieves data from the API.

If you have Hive Heating then looking at the last update time of the Target Temperature should give a good idea on when the Hive API data was last updated.
The Target Temper sensor does an update every 30 seconds, but the Hive component will only get new data from the Hive API when the data is over 2 minutes old.

I donā€™t know the detail around the Hive Lights, @Khole wrote all the code for the lights , but I think if you add a ā€œloggingā€ parameter to your configuration.yaml it will output some detailed logging / debugging information for all the light code

it could be the following line to add logging, @Khole will be able to confirm:

logging: True

Thanks for your reply.

I have already enabled full logging in the HA config.

Getting Hive Heating is next on my list - but I wanted to find a home controller that worked and that I can work with :grinning: before going ahead. I was sent a free Hive Hub and a couple of lights as free promotion which is where I am now.

I will add a few _LOGGER writes to show api returned values at various points in the main ā€˜hive.pyā€™ to see if I can determine what is failing and where.

Ah nice :slight_smile:

So in your configuration.yaml for the hive component you have something like:

hive: 
  username: YOUR_USERNAME 
  password: YOUR_PASSWORD
  logging: True

This should turn on the hive lights logging that outputs a load of extra _LOGGER code that @Khole added to troubleshoot any light issues

Yep - I worked that out from the code :wink: I also have the main logger: to display everything.

I will let you know if I find anything failing in my setup and hopefully we can prevent it happening to any one else.