Pyhass / Hive-Custom-Component

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

[BUG] Heating and Radiator Sensors missing #66

Closed EvBooKY closed 3 years ago

EvBooKY commented 3 years ago

Describe the bug Previously in 2021.1b25, the Heating had a couple of sensors including mode, state and boost which displayed the state of the Hive Heating. In 2021.2 these appear to have disappeared.

The Radiator Valves (TVRs) also have the same with state no longer being available (i think boost and mode were probably there as well, but they are no in my dashboard). Availability,

To Reproduce Steps to reproduce the behaviour:

  1. Entities and search for the radiator or heating name
  2. Expected a list including sensor.hall_radiator_state
  3. The items above are not present.

Expected behaviour Expected mode, state and boost to be available for the heating devices including hive heating (thermostat_1) and the radiator valves.

Screenshots image Note : the state bar has gone grey (unavailable) since the upgrade.

image Shorter list than previously.

Desktop (please complete the following information):

OS: Windows 10 Browser: Chrome Version : 88.0.4324.182

KJonline commented 3 years ago

Same as hot water the names haven't changed have they? I have quite a lot of hive devices and I don't seem to have this issue and I'm using the 2021.2 code.

image
EvBooKY commented 3 years ago

You are correct the name changed from main previously to Thermostat 1. Here are the entities from Thermostat 1. I notice this is a different device model, I'm still managing on the older thermostat.

image

KJonline commented 3 years ago

ye unfortunately because there has been a lot of change throughout the Beta issue. Yes it looks like you have a first gen thermostat, which we have never really officially supported. https://www.hivehome.com/guides/hive-heating mine seems to be the 2nd gen one. Is this still an issue for you

perjury commented 3 years ago

I have a 2 zone system and 4 TRVs I'm getting ZONE_heat_heating_mode and ZONE_heat_heating_state unavailable Two of my TRVs are set to manual operation and they are showing TRV_mode and TRV_state ok The two TRVs that are on schedule are showing TRV_mode and TRV_state unavailable

EvBooKY commented 3 years ago

Good spot @perjury. The only TVR that is working is not on a schedule and is effectively off.

EvBooKY commented 3 years ago

I've turned the hot water off (not scheduled) and restarted and now it has the Mode and State information!

image

KJonline commented 3 years ago

So it sounds like all the issues are related to the schedule mode?

EvBooKY commented 3 years ago

Hi Khole, just installed 2021.2.1 and now getting a different but similar error.

Logger: homeassistant.components.sensor Source: custom_components/hive/sensor.py:213 Integration: Sensor (documentation, issues) First occurred: 18:13:35 (12 occurrences) Last logged: 18:13:35

hive: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 358, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update await task File "/config/custom_components/hive/sensor.py", line 145, in async_update self.attributes = await self.get_heating_state_sa() File "/config/custom_components/hive/sensor.py", line 213, in get_heating_state_sa snan = await self.hive.heating.get_schedule_now_next_later(self.device) File "/usr/local/lib/python3.8/site-packages/pyhiveapi/heating.py", line 250, in get_schedule_now_next_later state = await self.helper.getScheduleNNL( File "/usr/local/lib/python3.8/site-packages/pyhiveapi/helper/hive_helper.py", line 115, in getScheduleNNL slot_time = self.convertMinutesToTime(current_slot_custom["start"]) File "/usr/local/lib/python3.8/site-packages/pyhiveapi/helper/hive_helper.py", line 77, in convertMinutesToTime converted_time = datetime.strptime( AttributeError: module 'datetime' has no attribute 'strptime'

perjury commented 3 years ago

ALso just installed 2.1 and that's worse! Now all heating zone sensors have gone unavailable

KJonline commented 3 years ago

please try 2021.2.2

EvBooKY commented 3 years ago

OK, not good for me, I get the following and it appears Hive hasn't even started in HA.

2021-02-21 18:22:53 ERROR (SyncWorker_1) [homeassistant.util.package] Unable to install package pyhiveapi==0.3.4.6: ERROR: Could not find a version that satisfies the requirement pyhiveapi==0.3.4.6 (from versions: 0.2.11, 0.2.12, 0.2.14, 0.2.15, 0.2.16, 0.2.17, 0.2.18, 0.2.18.1, 0.2.19.dev3, 0.2.19, 0.2.19.1, 0.2.19.2, 0.2.19.3, 0.2.19.4, 0.2.19.5, 0.2.20.dev1, 0.2.20.dev2, 0.2.20.1, 0.2.20.2, 0.3b1, 0.3b2, 0.3b3, 0.3b4, 0.3b6, 0.3b7, 0.3b8, 0.3b9, 0.3b10, 0.3b11, 0.3b12, 0.3b14, 0.3b15, 0.3b16, 0.3b17, 0.3b18, 0.3b19, 0.3b20, 0.3b21, 0.3b22, 0.3b23, 0.3, 0.3.1, 0.3.1.1, 0.3.2, 0.3.3, 0.3.4, 0.3.4.1, 0.3.4.2, 0.3.4.3, 0.3.4.4, 0.3.4.5, 2020.1b1, 2020.1b2) ERROR: No matching distribution found for pyhiveapi==0.3.4.6 WARNING: You are using pip version 20.2.4; however, version 21.0.1 is available. You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command. 2021-02-21 18:22:53 ERROR (MainThread) [homeassistant.setup] Setup failed for hive: Requirements for hive not found: ['pyhiveapi==0.3.4.6'].

EvBooKY commented 3 years ago

Maybe I was too quick last time. I restarted HA again and the error above has gone but is replaced with.

Logger: homeassistant.setup Source: custom_components/hive/init.py:7 First occurred: 18:27:03 (1 occurrences) Last logged: 18:27:03

Setup failed for hive: unknown error Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 166, in _async_setup_component component = integration.get_component() File "/usr/src/homeassistant/homeassistant/loader.py", line 467, in get_component cache[self.domain] = importlib.import_module(self.pkg_path) File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "/config/custom_components/hive/init.py", line 7, in from pyhiveapi import Hive File "/usr/local/lib/python3.8/site-packages/pyhiveapi/init.py", line 3, in from .api.hive_async_api import HiveAsync File "/usr/local/lib/python3.8/site-packages/pyhiveapi/api/hive_async_api.py", line 11, in from pyhiveapi.helper.const import HTTP_UNAUTHORIZED File "/usr/local/lib/python3.8/site-packages/pyhiveapi/helper/init.py", line 2, in from .hive_helper import HiveHelper File "/usr/local/lib/python3.8/site-packages/pyhiveapi/helper/hive_helper.py", line 132 schedule_now = fsl_sorted[-1]s ^ SyntaxError: invalid syntax

KJonline commented 3 years ago

This can happened sometimes with rapid releases as the library is cached please restart and try again.

perjury commented 3 years ago

I've restarted twice now and I'm getting

Logger: homeassistant.setup Source: custom_components/hive/init.py:7 First occurred: 18:31:39 (1 occurrences) Last logged: 18:31:39

Setup failed for hive: unknown error Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 166, in _async_setup_component component = integration.get_component() File "/usr/src/homeassistant/homeassistant/loader.py", line 467, in get_component cache[self.domain] = importlib.import_module(self.pkg_path) File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "/config/custom_components/hive/init.py", line 7, in from pyhiveapi import Hive File "/usr/local/lib/python3.8/site-packages/pyhiveapi/init.py", line 3, in from .api.hive_async_api import HiveAsync File "/usr/local/lib/python3.8/site-packages/pyhiveapi/api/hive_async_api.py", line 11, in from pyhiveapi.helper.const import HTTP_UNAUTHORIZED File "/usr/local/lib/python3.8/site-packages/pyhiveapi/helper/init.py", line 2, in from .hive_helper import HiveHelper File "/usr/local/lib/python3.8/site-packages/pyhiveapi/helper/hive_helper.py", line 132 schedule_now = fsl_sorted[-1]s ^ SyntaxError: invalid syntax

KJonline commented 3 years ago

apologies I'm having a nightmare at the min with the releases, please try 2021.2.3 and hopefully this is sorted.

EvBooKY commented 3 years ago

OK, running 2021.2.3 but still errors, different again!

Logger: homeassistant.components.sensor Source: custom_components/hive/sensor.py:270 Integration: Sensor (documentation, issues) First occurred: 18:37:06 (2 occurrences) Last logged: 18:37:06

hive: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 358, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update await task File "/config/custom_components/hive/sensor.py", line 155, in async_update self.attributes = await self.get_hotwater_state_sa() File "/config/custom_components/hive/sensor.py", line 270, in get_hotwater_state_sa snan = await self.hive.hotwater.get_schedule_now_next_later( File "/usr/local/lib/python3.8/site-packages/pyhiveapi/hotwater.py", line 135, in get_schedule_now_next_later state = await self.helper.getScheduleNNL( TypeError: object dict can't be used in 'await' expression

perjury commented 3 years ago

2.3 still seeing errors

Logger: homeassistant.components.sensor Source: custom_components/hive/sensor.py:213 Integration: Sensor (documentation, issues) First occurred: 18:39:47 (8 occurrences) Last logged: 18:39:47

hive: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 358, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update await task File "/config/custom_components/hive/sensor.py", line 145, in async_update self.attributes = await self.get_heating_state_sa() File "/config/custom_components/hive/sensor.py", line 213, in get_heating_state_sa snan = await self.hive.heating.get_schedule_now_next_later(self.device) File "/usr/local/lib/python3.8/site-packages/pyhiveapi/heating.py", line 250, in get_schedule_now_next_later state = await self.helper.getScheduleNNL( TypeError: object dict can't be used in 'await' expression

KJonline commented 3 years ago

yep I have released 2021.4, apologies for all the releases I'm juggling multiple things at home

EvBooKY commented 3 years ago

Looking promising, no errors (apart from my light!) and I am just working through a few name changes now. All seems good. Many thanks Khole. Kevin

EvBooKY commented 3 years ago

Just to confirm all heating, hot water and radiator data now back with a few changes in names as suggested. Thanks again Khole.

KJonline commented 3 years ago

Thanks

perjury commented 3 years ago

Hmm. restarted twice on 2.5 and I'm still seeing Logger: homeassistant.setup Source: custom_components/hive/init.py:7 First occurred: 19:27:18 (1 occurrences) Last logged: 19:27:18

Setup failed for hive: unknown error Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 166, in _async_setup_component component = integration.get_component() File "/usr/src/homeassistant/homeassistant/loader.py", line 467, in get_component cache[self.domain] = importlib.import_module(self.pkg_path) File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "/config/custom_components/hive/init.py", line 7, in from pyhiveapi import Hive File "/usr/local/lib/python3.8/site-packages/pyhiveapi/init.py", line 9, in from .hive import Hive File "/usr/local/lib/python3.8/site-packages/pyhiveapi/hive.py", line 10, in from .light import Light File "/usr/local/lib/python3.8/site-packages/pyhiveapi/light.py", line 72 await self.logger.log( ^ SyntaxError: invalid syntax

perjury commented 3 years ago

How do I go back to the previous beta? I don't seem to have that option in HACS. This version is not working at all for me

dnedeltchev commented 3 years ago

For what is worth... The latest one is working fine, mind you no HACS, just manual install. I had to remove the integration (delete hive folder under custom_components), reboot, remove all entities, reboot, add integration (copy hive under custom_components), reboot, refresh browser, setup integration... All working as expected.

perjury commented 3 years ago

I'll try it again, but it wasn't working for me after 3 restarts

EvBooKY commented 3 years ago

@perjury I stayed on 2021.2.4 as you reported issues with 2021.2.5. To roll back (not tried it) but if you go into HACS and then Integrations. Find the Hive Custom Integration. Then the ... menu you can select reinstall and that offers a drop down box with different versions as below.

image

perjury commented 3 years ago

I rolled back to 2021.2 then reinstalled 2021.2.5 and now it seems to be working. Still have to check everything out but at least I'm not getting an error when I restart

perjury commented 3 years ago

All looking good now apart from two issues that were marked closed but need to be re-opened (but I can't see how to do that)

50 and #55

Issues #33 , #49 and #34 have been resolved. Thanks for all the hard work @KJonline