Pyhass / Hive-Custom-Component

A custom version of the home assistant hive component
MIT License
33 stars 17 forks source link

Suddenly stopped working! #22

Closed vinagu closed 3 years ago

vinagu commented 3 years ago

This integration suddenly stopped working and disappeared from the set-up Integrations in Configuration. Re-installing it does not help. Did not update or modify my HASSIO in any way, it just suddenly happened overnight of its own accord. Please help, all my climate automation are now completely broken!

captaindaveman commented 3 years ago

Same issue here, mine broke about 14:00 on the 2nd, tried various things to get it working again, I'm running the latest version of HA but likewise changed nothing that could have triggered this. I don't have 2FA enabled on Hive and Hive still works through the Hive app

dF50M7ch commented 3 years ago

Same here: my HIVE thermostat (my only device) became "unavailable" some time yesterday (the 2nd). Everything is the latest version (HASS-OS on RPi).

ovid-io commented 3 years ago

Having same issue here, same exact time as well

jmoorey1 commented 3 years ago

Same issue with mine. Tried installing the beta version that was suggested to remedy the issues but to no avail.

Dec 3 10:18:31 robin hass[17447]: 2020-12-03 10:18:31 ERROR (MainThread) [homeassistant.setup] Error during setup of component hive Dec 3 10:18:31 robin hass[17447]: Traceback (most recent call last): Dec 3 10:18:31 robin hass[17447]: File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/setup.py", line 213, in _async_setup_component Dec 3 10:18:31 robin hass[17447]: result = await task Dec 3 10:18:31 robin hass[17447]: File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run Dec 3 10:18:31 robin hass[17447]: result = self.fn(*self.args, **self.kwargs) Dec 3 10:18:31 robin hass[17447]: File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/hive/__init__.py", line 121, in setup Dec 3 10:18:31 robin hass[17447]: username = config[DOMAIN][CONF_USERNAME] Dec 3 10:18:31 robin hass[17447]: KeyError: 'hive'

Running Home Assistant Core.

Home Assistant Core Integration
version: 0.118.4
installation_type: Home Assistant Core
dev: false
hassio: false
docker: false
virtualenv: true
python_version: 3.8.5
os_name: Linux
os_version: 4.15.0-124-generic
arch: x86_64
timezone: Europe/London
spants commented 3 years ago

same issue - was using the built in Hive integration and switched to this to try to fix it. I guess API has changed again?

jmoorey1 commented 3 years ago

Tried reinstalling b21 - managed to get all my entities back. Can now do everything except turn hot water on. Can switch it off and to eco, but not on.

Great for my energy bill.

Dec 3 11:16:10 robin hass[18322]: 2020-12-03 11:16:10 ERROR (MainThread) [pyhiveapi.custom_logging] ERROR - Received 500 response from API.

captaindaveman commented 3 years ago

Tried reinstalling b21 - managed to get all my entities back. Can now do everything except turn hot water on. Can switch it off and to eco, but not on.

Great for my energy bill.

Dec 3 11:16:10 robin hass[18322]: 2020-12-03 11:16:10 ERROR (MainThread) [pyhiveapi.custom_logging] ERROR - Received 500 response from API.

Tried this a couple of times, I have heating thermostat and 3 plugs but all entities are showing as 'unavailable' I did get an error stating that scan_interval was an invalid configuration, deleted it and still doesn't work

dF50M7ch commented 3 years ago

Tried this a couple of times, I have heating thermostat and 3 plugs but all entities are showing as 'unavailable' I did get an error stating that scan_interval was an invalid configuration, deleted it and still doesn't work

Unfortunately this didn't work for me (b21 via HACS).

KJonline commented 3 years ago

Hi all, Yes Hive made some changes and broke how this works. The beta version uses a new login method and should work.

There is currently an issue in the beta where you cannot set up HIve using configuration via YAML files, this will need to be removed and hive needs to be set up via the UI until the next beta release. This can be done by going to Home Assistant Configuration >> Integrations >> Add Integration >> Hive

elyobelyob commented 3 years ago

Any tips on how to move to the beta version appreciated.

jmoorey1 commented 3 years ago

Hi all, Yes Hive made some changes and broke how this works. The beta version uses a new login method and should work.

There is currently an issue in the beta where you cannot set up HIve using configuration via YAML files, this will need to be removed and hive needs to be set up via the UI until the next beta release. This can be done by going to Home Assistant Configuration >> Integrations >> Add Integration >> Hive

Thanks for the reply @KJonline - I've done this and everything is working, except being able to turn the hot water on. Heating on/off/auto and hot water off/eco are working fine - just hot water on. I wonder if there's an error in the API calls that it's making? ERROR (MainThread) [pyhiveapi.custom_logging] ERROR - Received 500 response from API.

KJonline commented 3 years ago

@elyobelyob the easiest way is via HACS if you have that install already if not you can manually copy the files from the releases page into your custom_compoennt folder.

@jmoorey1 Yes this issues, seems to be occurring for multiple users, I don't have hot water myself so I work a bit blind on it, with this being beta most thinks work there are a few niggles with it still. ill have a look at it and see what I can identify I may need someone to send me the debug logs.

jmoorey1 commented 3 years ago

@KJonline Happy to grab you whatever you need - how do I enable the debug logging?

KJonline commented 3 years ago

@jmoorey1 Unfortunately with all this coming out of the blue again (Hive Changing their authentication). I haven't had a chance to explain to people what is new in the beta.

But one of them is now when you go into the home assistant integrations page there should be a hive integration and an options button click that. You should get the option to update the scan interval which now can be set as low as 15 seconds and you can switch on Debugging Categories.

There is an extra piece of configuration needed In the YAML files this is so Home assistant know it's in debug mode also which I can share if needed.

dF50M7ch commented 3 years ago

Hi all, Yes Hive made some changes and broke how this works. The beta version uses a new login method and should work.

There is currently an issue in the beta where you cannot set up HIve using configuration via YAML files, this will need to be removed and hive needs to be set up via the UI until the next beta release. This can be done by going to Home Assistant Configuration >> Integrations >> Add Integration >> Hive

This fixed it for me - thank you!

jmoorey1 commented 3 years ago

@jmoorey1 Unfortunately with all this coming out of the blue again (Hive Changing their authentication). I haven't had a chance to explain to people what is new in the beta.

But one of them is now when you go into the home assistant integrations page there should be a hive integration and an options button click that. You should get the option to update the scan interval which now can be set as low as 15 seconds and you can switch on Debugging Categories.

There is an extra piece of configuration needed In the YAML files this is so Home assistant know it's in debug mode also which I can share if needed.

@KJonline I've set the scan interval to 15 seconds, and selected API, Hotwater and ERROR debug categories.

There's no difference in the log files even after a restart, so I assume I need that YAML config for it to take affect as well. Is there a way to check that debug config has taken affect?

ovid-io commented 3 years ago

2020.1_b21 is working great, thanks for taking the time to develop this @KJonline and @perjury!

jmoorey1 commented 3 years ago

2020.1_b21 is working great, thanks for taking the time to develop this @KJonline and @jmoorey1!

Nothing to do with me, it's all @KJonline !

ovid-io commented 3 years ago

Nothing to do with me, it's all @KJonline !

Sorry didn't copy correctly from contributor list :)

captaindaveman commented 3 years ago

Hi all, Yes Hive made some changes and broke how this works. The beta version uses a new login method and should work.

There is currently an issue in the beta where you cannot set up HIve using configuration via YAML files, this will need to be removed and hive needs to be set up via the UI until the next beta release. This can be done by going to Home Assistant Configuration >> Integrations >> Add Integration >> Hive

Thanks, back up and running!

KJonline commented 3 years ago

@jmoorey1 You will need a restart to tell home assistant that your debugging but after that, you can switch debugging off in the Hive config options and that does it in realtime no restart needed.

This is what you need to add to your YAML file and you can leave it there.

You can ignore the pyscript bit that a different integration.

jmoorey1 commented 3 years ago

@KJonline debug logs while trying to change hot water from eco to on;

Dec 3 15:08:19 robin hass[22850]: 2020-12-03 15:08:19 DEBUG (MainThread) [pyhiveapi.custom_logging] UNKNOWNRequest is - post:https://beekeeper-uk.hivehome.com/1.0/nodes/hotwater/e79c914f-01c8-4dc6-b071-32356dd0d28f Dec 3 15:08:19 robin hass[22850]: 2020-12-03 15:08:19 DEBUG (MainThread) [pyhiveapi.custom_logging] UNKNOWNResponse is - 500 Dec 3 15:08:19 robin hass[22850]: 2020-12-03 15:08:19 ERROR (MainThread) [pyhiveapi.custom_logging] ERROR - Received 500 response from API. Dec 3 15:08:19 robin hass[22850]: 2020-12-03 15:08:19 DEBUG (MainThread) [pyhiveapi.custom_logging] Living RoomGetting hot water data. Dec 3 15:08:19 robin hass[22850]: 2020-12-03 15:08:19 DEBUG (MainThread) [pyhiveapi.custom_logging] Living RoomDevice update {'': '', 'Mode': 'SCHEDULE', 'Boost': 'OFF', 'State': 'OFF', 'snnl': {'now': {'value': {'status': 'OFF'}, 'start': 420, 'Start_DateTime': datetime.datetime(2020, 12, 3, 7, 0), 'End_DateTime': datetime.datetime(2020, 12, 3, 18, 0)}, 'next': {'value': {'status': 'ON'}, 'start': 1080, 'Start_DateTime': datetime.datetime(2020, 12, 3, 18, 0), 'End_DateTime': datetime.datetime(2020, 12, 3, 19, 0)}, 'later': {'value': {'status': 'OFF'}, 'start': 1140, 'Start_DateTime': datetime.datetime(2020, 12, 3, 19, 0), 'End_DateTime': datetime.datetime(2020, 12, 4, 6, 0)}}}

midnightracer1 commented 3 years ago

Hi all, Yes Hive made some changes and broke how this works. The beta version uses a new login method and should work.

There is currently an issue in the beta where you cannot set up HIve using configuration via YAML files, this will need to be removed and hive needs to be set up via the UI until the next beta release. This can be done by going to Home Assistant Configuration >> Integrations >> Add Integration >> Hive

Help! Hive has been totally removed from integrations so I cant go in and set the option from there! I've been trying to find out why for days with no joy. maybe if you already had it its still there but this is a new installation and hive isn't an option under integrations anymore!

jmoorey1 commented 3 years ago

@KJonline Tried your new code - works a treat. Absolute superstar. Thank you so much.

KJonline commented 3 years ago

@jmoorey1 Is this Beta 2020.1_b22 that you have tested it against and hot water it working correctly now?

mikebakke commented 3 years ago

I've deployed beta22 manually in custom_components but all my hive devices are showing unavailable. Everything was working till about 14:00 today on v 20. I have restarted the container but no change, other devices are working as expected - just Hive.

Also - I do not see Hive listed in the integrations page. My current Hass version is .118.4

jmoorey1 commented 3 years ago

@jmoorey1 Is this Beta 2020.1_b22 that you have tested it against and hot water it working correctly now?

When I updated water_heater.py with your changes ('ON' to 'MANUAL') it has started to work perfectly. However when I deployed the whole of 2020.1_b22 my entities disappeared again. Potentially because I'm not using 2FA yet..?

I rolled back to 2020.1_b22 and just manually made the changes to the water_heater.py.

Mills79 commented 3 years ago

Hives not available in the integrations menu for me either

KJonline commented 3 years ago

@jmoorey1 Is this Beta 2020.1_b22 that you have tested it against and hot water it working correctly now?

When I updated water_heater.py with your changes ('ON' to 'MANUAL') it has started to work perfectly. However when I deployed the whole of 2020.1_b22 my entities disappeared again. Potentially because I'm not using 2FA yet..?

I rolled back to 2020.1_b22 and just manually made the changes to the water_heater.py.

Yes i found the issue with the hot water in another thread. so that will be fixed in the next version

KJonline commented 3 years ago

@mikebakke @Mills79 Have you tried rebooting your system and clearing the browser cache, have you seen it in the integrations page previously?

stumiles86 commented 3 years ago

Hives not available in the integrations menu for me either

It didn't show up in b22 for me. Went back to b21 and working fine. Try that

mikebakke commented 3 years ago

Depends which integrations page. It does not and has never shown up in the integrations portion of the configuration menus, but I noticed yesterday that it is visible (at b22) in the system info section - I was looking for the hass version number and noticed Hive was listed as integrated there.

The system has been rebooted multiple times and I've just run up a new private browser session so there should be no cache issue.

Will try reverting to b21 and see if there's any change.

Cheers

mikebakke commented 3 years ago

No change unfortunately at b21. All Hive devices are showing unavailable. The only errors in the log relate to bluetooth device tracking and even then my phone is correctly tracked and monitored.

stumiles86 commented 3 years ago

No change unfortunately at b21. All Hive devices are showing unavailable. The only errors in the log relate to bluetooth device tracking and even then my phone is correctly tracked and monitored.

Go to configuration - integrations then add Hive?

mikebakke commented 3 years ago

@stumiles86 that integration is never offered - it's not on the menu

chiversc commented 3 years ago

same here. All my entities are no longer available. I can see Hive listed on the Configuration>Info page, but don't find it under configurations>integration, so have no way to manage it. Any ideas please?

KJonline commented 3 years ago

@chiversc Have you updated to the Beta version if please try learning your cache and restarting your system as those are fixes other people have fond for this issue.

chiversc commented 3 years ago

Beta version and several restarts seems to do the trick. Thanks @KJonline your swift response appreciated

mikebakke commented 3 years ago

OK, so can we be clear about what the beta version is? I am downloading the package from here labelled 2020.1_b22 which has manifest.json ==0.3b21 for the hiveapi

I have restarted multiple times, cleared browser cache etc. If what I'm installing (drop the extracted "hive" folder in custom components) and then refer to that in config.yaml, all I can think to do is delete the current image and reload from docker.hub

KJonline commented 3 years ago

@mikebakke prior to this have you used custom components before. Your folder should be called custom_component then have the hive folder within it

chiversc commented 3 years ago

I found effective to install B22 via HACS.

chiversc commented 3 years ago

@KJonline, forgive me to ask another question, but in this customer integration there is no separate "water_heater" entity, right? I see the sensors for hot water working ok, but no idea how to turn it one and off.

KJonline commented 3 years ago

@chiversc yes there is but unfortunately it’s broken at the minute it will be fixed in the next beta.

chiversc commented 3 years ago

hats off to you for the great work. It's very impressive.

mikebakke commented 3 years ago

@mikebakke prior to this have you used custom components before. Your folder should be called custom_component then have the hive folder within it

Yes indeed - everything was working on b20 until yesterday afternoon - had been up and running for 3+ weeks now. All the devices I've configured are shown -they are just labelled as unavailable

KJonline commented 3 years ago

@mikebakke Sorry for all the questions but can you detail all steps you have taken to upgrade + how you configure it and what you get within the logs e.g errors

tmoore22 commented 3 years ago

b22 worked for me

mikebakke commented 3 years ago

Please don't apologise - I appreciate the effort to create and any support.

So. I went back to my original Pi4 docker installation and: stopped the container deleted container deleted image rm * from custom_components directory wget https://github.com/Pyhive/HA-Hive-Custom-Component/archive/2020.1_b22.zip unzip the hive directory to config/custom_components left the configuration.yaml file alone, so it includes: hive: username: user@gmail.com password: password scan_interval: 2

then run up a fresh container: docker run --init -d --name="hass" -e "TZ=Europe/London" -v /root/hass/config:/config --net=host homeassistant/raspberrypi4-homeassistant:stable

starts and I go to login. Now there is something I had not seen on the other instance. There were error messages telling me that the hive integration could not be started and in the log I see: Log Details (ERROR)

Logger: homeassistant.config Source: config.py:415 First occurred: 15:00:33 (1 occurrences) Last logged: 15:00:33

Logger: homeassistant.config Source: config.py:415 First occurred: 15:00:33 (1 occurrences) Last logged: 15:00:33 Invalid config for [hive]: [scan_interval] is an invalid option for [hive]. Check: hive->hive->scan_interval. (See /config/configuration.yaml, line 14). Please check the docs at https://www.home-assistant.io/integrations/hive

This is strange because the scan_interval is as it always has been...

I am also currently unable to find the file "config.py" identified as triggering the error message at line 415. OK - found it inside the running container but 415 is just where it outputs the message.

I commented out scan_interval even though as far as I can see it matches what is defined in the hive docs and restarted the instance.

Lol... now it gets weird.... I see devices and temps for some things and only on the overview window - my custom gui panel (just restricted number of devices - nothing clever) is all showing unavailable.

Soooo.... unsure why hiding scan_interval made that difference but I can live with that. My custom panel I can probably rebuild quite quickly so I guess my key question is about the entities/devices which are not showing fully on the overview window.

Looking at the entity lists it seems that a lot of the hive ones are now duplicated - the new ones are suffixed _2 and a lot of the originals are flagged with a status of "restored"

tbh - I think my best option now is to just "nuke it from orbit", start with none of my configuration and re-add the hive integration - hopefully that will add the devices clean under b22. Relatively straight forward with docker, so let me do that and update after.

Thanks again for support.

tmoore22 commented 3 years ago

I just had to do exactly the same .. duplicated sensors, removed from config.yaml and reconfigured via the UI (Integrations)

KJonline commented 3 years ago

@mikebakke Yes, that explains the 2 issues you have come across. Scan interval is not supported in YAML anymore as it has been moved into the options configuration within the HIve UI (Within the integrations page) and secondly, there has been changes around how hive sets the names of entities now.

The best bet will be to delete all configuration you currently have restart HA and then add the config back in either via the UI or via YAML (if via YAML reboot again.)

Unfortunately with the situation going on, I haven't properly put a full list of improvements that were put into the beta there was quite a lot. (It's on my todo list)