Hive Integration

Also readded the integration in hacs and then via integrations and still getting the sms every 2 minutes.

@bradderz

All looks good

Have you cleared all configuration in the Yaml files?

Just out of curiosity are you based UK?

Sorry for all the questions this seems an odd one and can’t think what is triggering this behaviour.

yes I have removed hive login from configuration.yaml. Could there be rogue files in my config folder to look out for that could be requesting this code continously? Although the code is only sent when I add the integration so doubt rogue files is the problem. No worries for the questions, I just would like to use my cameras (2fa) without all the sms! I am based in UK

@bradderz

I’m leaning towards the backend library pyhiveapi is still an old version and for some reason the new version hasn’t been installed. If go into site packages which lives within the deps folder of your home assistant configuration. Once located delete all the pyhiveapi folders and reinstall the custom component from HACS don’t restart home assistant while this is being done. Once reinstalled via hacs give it a go again.

Just deleted all pyhiveapi files in deps folder and in python site-pacakges folder and made sure it wasn’t installed in pip3.

I get this in the log again after re-adding the integration once uninstalled/installed via hacs which I assume is to do with color bulbs

2020-12-01 08:51:16 ERROR (MainThread) [homeassistant.components.light] hive: Error on device update!
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 357, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 466, in async_device_update
await task
File “/Users/bradley/.homeassistant/custom_components/hive/light.py”, line 151, in async_update
self.device = await self.hive.light.get_light(self.device)
File “/Users/bradley/.homeassistant/deps/lib/python/site-packages/pyhiveapi/light.py”, line 41, in get_light
“state”: await self.get_state(device),
File “/Users/bradley/.homeassistant/deps/lib/python/site-packages/pyhiveapi/light.py”, line 73, in get_state
state = data[“state”][“status”]
KeyError: ‘status’
2020-12-01 08:51:16 ERROR (MainThread) [homeassistant.components.light] hive: Error on device update!
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 357, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 466, in async_device_update
await task
File “/Users/bradley/.homeassistant/custom_components/hive/light.py”, line 151, in async_update
self.device = await self.hive.light.get_light(self.device)
File “/Users/bradley/.homeassistant/deps/lib/python/site-packages/pyhiveapi/light.py”, line 55, in get_light
dev_data.update({“hs_color”: await self.get_color(device)})
File “/Users/bradley/.homeassistant/deps/lib/python/site-packages/pyhiveapi/light.py”, line 161, in get_color
(data[“state”][“hue”]) / 360,
TypeError: unsupported operand type(s) for /: ‘NoneType’ and ‘int’

Finally sussed it, I had 2 command line sensors which were reporting back when the hive cameras were activated/deactivated.

Now I have removed these no more SMS! Sorry to waste your time.

Any chance a sensor could be added to see when the cameras are armed/disarmed?

@bradderz

Glad it’s working for you now and its not the integration :slight_smile: . Once this release is out and in the base code im going to start looking at camera, I have already eagerly had a look and I think I will be able to support a camera showing the last motion, a sensor for armed disarmed and a switch to arm and disarm it.

That’s great, I’ll look out for it as my custom camera sensor and switch is now broken due to 2FA

@bradderz Are you still getting errors in the logs for the lights?

I am still getting errors, I thought it might be to do with devices offline in hive app but there aren’t any now and still getting light error but not specific to light now neither. Here is a copy of log and re adding integration…

await entity.async_device_update(warning=False)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 466, in async_device_update
await task
File “/Users/bradley/.homeassistant/custom_components/hive/light.py”, line 151, in async_update
self.device = await self.hive.light.get_light(self.device)
File “/Users/bradley/.homeassistant/deps/lib/python/site-packages/pyhiveapi/light.py”, line 55, in get_light
dev_data.update({“hs_color”: await self.get_color(device)})
File “/Users/bradley/.homeassistant/deps/lib/python/site-packages/pyhiveapi/light.py”, line 161, in get_color
(data[“state”][“hue”]) / 360,
TypeError: unsupported operand type(s) for /: ‘NoneType’ and ‘int’
2020-12-01 12:54:13 ERROR (MainThread) [homeassistant.components.sensor] hive: Error on device update!
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 357, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 466, in async_device_update
await task
File “/Users/bradley/.homeassistant/custom_components/hive/sensor.py”, line 122, in async_update
self.attributes = await self.get_heating_state_sa()
File “/Users/bradley/.homeassistant/custom_components/hive/sensor.py”, line 181, in get_heating_state_sa
snan = await self.hive.heating.get_schedule_now_next_later(self.device)
File “/Users/bradley/.homeassistant/deps/lib/python/site-packages/pyhiveapi/heating.py”, line 276, in get_schedule_now_next_later
current_mode = await self.get_mode(device)
File “/Users/bradley/.homeassistant/deps/lib/python/site-packages/pyhiveapi/heating.py”, line 177, in get_mode
state = data[“props”][“previous”][“mode”]
KeyError: ‘mode’
2020-12-01 12:54:13 ERROR (MainThread) [homeassistant.components.sensor] hive: Error on device update!
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 357, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 466, in async_device_update
await task
File “/Users/bradley/.homeassistant/custom_components/hive/sensor.py”, line 118, in async_update
self.device = await self.hive.sensor.get_sensor(self.device)
File “/Users/bradley/.homeassistant/deps/lib/python/site-packages/pyhiveapi/sensor.py”, line 55, in get_sensor
dev_data.update({“state”: await eval(code),
File “/Users/bradley/.homeassistant/deps/lib/python/site-packages/pyhiveapi/heating.py”, line 177, in get_mode
state = data[“props”][“previous”][“mode”]
KeyError: ‘mode’

doesn’t seem to be affecting the working of states and switches for my entities I might add

@bradderz does your colour bulb report the correct state then?

Well I have all bulbs working but 1 which is identical to a bulb which homeassistant is showing. The 1 not showing does have availibity sensor (is online) and mode sensor but no bulb info whereas another has the sensors as well as the bulb. An exact same problem exist with trv, all but one show up. The trv not showing does have the trv and the sensors when I click on it in entities but when I add it to lovelace it shows as unavilable. Can’t understand it.

Sorted it, change the color of the bulb in hive app and now when I restart homeassistant the bulb appears, not sure if it’s a permanent fix but do remember having to hack pyhiveapi over the weekend to give it some default values in light.py line 151 so it must be to do with having reinstalled pyhiveapi today. Also I removed orphaned entries for trv with same name as not showing and now that trv is showing properly. Thank you for your assistance and for 2FA, been looking out for that fix for a while now.

@bradderz what state was the bulb in when it was failing?

it was powered on, I can only assume it was on normal color not having ever used the color feature before but the dimmer feature was being used 70%

Hi
Is hive down again? Anyone else’s showing NAN?
Cant see any errors in the logs.

1 Like

Mine has also stopped updating, last update was 14:33.

yep - me too :roll_eyes:

Mine is also down, hive app seems to be working. Maybe they have locked down this api behind the new SSO platform