Hive Integration

Yes, I’ve got the various hive.py’s duplicated to hive1.pys, each with an instance of the Pyhiveapi object, whereas before there was just the one set of things (the class object/module instances) being used by both.

Hi @rendili Yes that’s right. I have a couple of motion sensors triggering lights. I’d like the actions switched off during daylight for example.

Hi @Dan1

This would be a completely new area to integrate from the Hive API and pull data from and try and present to Home Assistant.
If the Hive automations have something as simple as an On and Off state for each automation, we might be able to do something to integrate that in to Home Assistant by presenting them as switches and then Home Assistant automations could turn them on or off.

hi @gwynevans

To release as an updated version for Home Assistant, we would need to work to enable multiple instances of Hive by using just one set of files and by handling the instances, but it might be possible to build of what you have started already

Hi @rendili. Presenting the actions as switches for each sensor would indeed fit my needs (actually these are already reprented as toggles within the hive interface). Note that each sensor can have multiple actions, so there would be multiple switches to group under each sensor.

Let me know if you are seriously considering this as I’d like to help.

Hi @Dan1

I am not opposed to doing this, but I don’t have the Hive installation to do this at the moment, so would not be able to write anything. I have only heating and hotwater with Hive, so I don’t get the options in the Hive app or website to create automations / actions.
If you could send me some API calls from your web browser to the Hive API i could take a look to see how feasible it would be to add this to the HA Hive integration

Hi @Bobby_Nobble

Just in case you haven’t seen already, v0.61.0 is out with the Hive-R2 release which include the simple boost functionality for heating and hotwater.
I didn’t look like you could specify time or temperature with the climate device, so the way it works for a Hive heating climate device is that is sets the boost to 30 minutes and 0.5c above current temperature. Hive hotwater boost will just set the boost for 30minutes.

This release also include support for the Hive colour bulbs.

1 Like

Hi @rendili, @Dan1

I have looked at this a while ago it does look like it can be done present hive automation as switches. I never took it further than a brief look so I don’t know the ins and outs of using the API to change them. But it definitely looks possible.

Cheers for the heads up, just waiting for the update on hass.io. How you’ve done it sounds perfect for what I wanted.

Thanks again.

1 Like

I’ve just followed these instructions and now see some new icons at the top of my HA web console (see picture), but nothing listed as switches. Can anyone tell me if/how I can change my thermostat from scheduled to manual and set it to a specific temperature?
My system is one of the original British Gas Remote Heating systems, installed in 2013 and migrated to the Hive platform a couple of years ago.

Hi @itm1960

Out of interest, which instructions did you follow?

At a basic level, all you need to do is add the following to your configuration.yaml file:

hive:
 username: YOUR_USERNAME
 password: YOUR_PASSWORD

Try clicking on each icon at the top, one hopefully should be the thermostat, it is here where you can set the temperature and the mode (heat, manual, off)

I followed your very helpful guide from this thread:

(but with the more recent hive.py files from a later post).
If I click one of the icons it pops up a window showing current state and a timeline, but doesn’t give an option to change the state.
I do have that entry in my configuration.yaml:
hive:
username: [email protected]
password: myhivepassword
devices:
- hive_heating
- hive_hotwater
- hive_thermostat_batterylevel
- hive_heating_currenttemperature
- hive_heating_targettemperature
- hive_heating_state
- hive_heating_mode
- hive_heating_boost
- hive_hotwater_mode
- hive_hotwater_state
- hive_hotwater_boost

ah ok.
To be honest, you would be better off just adding those three lines to your config file and not downloading the files embedded in this thread. The files are older versions and the latest and greatest integration for Hive is now included in the home assistant release automatically.
If you have downloaded and copied any hive.py files and added to the custom_components folder structure, then I would advise deleting them, then removing all the -devices: config section and then restart. you should get the latest in the Home Assistant release Assuming you are running 0.61 or later.

Ah OK I’ve done that and now I see the Climate group on my HA console, along with switches - thanks. What I’d like to do is use voice control (Google Home/IFTTT) to switch the operating mode between Scheduled and Manual, and to set a specific target temperature. If I create a script to do that, what commands/syntax should I use?

Hey,

I dont suppose you have the multizone by any chance? Wondering if your HA can see both Thermostats?

I can only see the one at the moment.

Cheers

Hi @KeithMcC

If you are using the Hive integration that is distributed in the latest release of Home Assistant then it supports multizone heating and should show both thermostats
There were some older custom_component files from a long time ago that supported only one zone

Ah! I just noticed an update and you are correct. Now showing both zones. Thanks!

great stuff :slight_smile:

1 Like

Hello, quite new to this. I have HA installed on 2 Win10 machines (one has a full blown Visual Studio on it, the other a new install) and a Ubuntu 17.10. All have the same “problem”. All versions of everything on all machines is the latest. HA installed on top of Python.

In configuration.yaml I have the bare hive: elements (username/password). Everything shows up on the Overview page perfectly (2 lights, heating, hot water and a motion sensor). Porch Sensor as named in the iOS Kasa app gets called binary_sensor.porch_sensor in the Developer tools, States page.

My problem is that HA never receives a on or a off trigger from the sensor. I understand the possible 1:59 second delay but I never receive anything. Nothing in the logs, error or otherwise.

If I “manually” set the state of the sensor in the States page all works as it should,

The sensor is working ok. The Kasa iOS app notifies me instantly of any motion.

For completeness, below is the relevant part of automations.yaml. I don’t think it’s “my code” related rather than something stupid I’m missing in the setup. All firewalls are off and everything involved my end are on the same subnet.

I look forward to learning how daft I’ve been.

Another question, not meaning to distract from the above, is there a way for my iOS (or Android) Kasa app to fire a HA event ? This would solve the <2 minute delay issue.

Thanks, Peter.

- id: porch_sensor_light_on
  alias: Turn on Porch Light when there is movement
  trigger:
    platform: state
    entity_id: binary_sensor.porch_sensor
    to: 'on'
  action:
    service: homeassistant.turn_on
    entity_id: light.ha_porch
- id: porch_sensor_light_off
  alias: Turn off Porch Light 10 minutes after last movement
  trigger:
    platform: state
    entity_id: binary_sensor.porch_sensor
    to: 'off'
    for: 00:10:00
  action:
  - service: homeassistant.turn_off
    entity_id: light.ha_porch

Reading your post it sounds like the motion sensor is a TP-Link one and therefore has nothing to do with Hive?