sebr / bhyve-home-assistant

Orbit BHyve custom component for Home Assistant
MIT License
252 stars 42 forks source link

Binary Sensor does not load in `3.0.0-beta0` #131

Closed jweston2112 closed 2 years ago

jweston2112 commented 2 years ago

Describe the bug After loading and Configuring Beta 3.0.0

An Error appears in the Log after core Restart

Logger: homeassistant.setup Source: setup.py:298 First occurred: 1:14:19 AM (1 occurrences) Last logged: 1:14:19 AM

Unable to prepare setup for platform bhyve.binary_sensor: Platform not found (No module named 'homeassistant.components.bhyve').

Expected behaviour

No error in Log

BHyve devices

BHyve Hub BH1-0001

Valve HT25-0000 (Backyard)

Logs

2022-05-17 01:25:07 DEBUG (MainThread) [custom_components.bhyve.pybhyve.client] Logged in
2022-05-17 01:25:07 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform bhyve.binary_sensor: Platform not found (No module named 'homeassistant.components.bhyve').
2022-05-17 01:25:07 INFO (MainThread) [custom_components.bhyve.sensor] Creating state sensor: Backyard state
2022-05-17 01:25:07 DEBUG (MainThread) [custom_components.bhyve.sensor] State sensor Backyard state setup: State: auto | Available: True
2022-05-17 01:25:07 INFO (MainThread) [custom_components.bhyve.sensor] Creating history sensor: Backyard zone history
2022-05-17 01:25:07 INFO (MainThread) [custom_components.bhyve.sensor] Creating battery sensor: Backyard battery level
2022-05-17 01:25:07 INFO (MainThread) [custom_components.bhyve.switch] Creating switch: Backyard rain delay
2022-05-17 01:25:07 INFO (MainThread) [custom_components.bhyve.switch] Creating switch: Backyard zone
2022-05-17 01:25:07 INFO (MainThread) [custom_components.bhyve.switch] Backyard zone watering_status: None
2022-05-17 01:25:07 INFO (MainThread) [custom_components.bhyve.switch] Backyard Zone: Watering program Default (a) is not enabled, skipping
2022-05-17 01:25:07 INFO (MainThread) [custom_components.bhyve.switch] Creating switch: Program Default
2022-05-17 01:25:08 INFO (MainThread) [custom_components.bhyve.pybhyve.websocket] Authenticating websocket
2022-05-17 01:25:08 INFO (MainThread) [custom_components.bhyve.pybhyve.websocket] Websocket connected
jweston2112 commented 2 years ago

config_entry-bhyve-acab942cf181da63901732cbb796b2f7.json.txt

The Diagnostic Info Download file ... in case that give you more insight...

I had also restarted ang had gotten additional messages but they were to indicate that the Yaml entries were still in the configuration and so I removed them and re-re-started core and this is the only remaining Error.

sebr commented 2 years ago

Thanks @jweston2112 - I'll take a look asap but hopefully it doesn't impact your environment! It doesn't look like you have any entities which would create a binary_sensor

jweston2112 commented 2 years ago

No Worries ... I guess when I get update notices I should read them a bit more carefully... (I missed it was a beta).

My Config was just Like your example in the repository image

So I dont know if it is some kind of hold over from that as you can see there was a binary_sensor in that config...

I have also noticed that when I click reload from the integrations the entities become unavailable... till I restart HA Core. Not sure if the error its getting is preventing the reload... but If I see logs that indicate anything I will be sure to update this issue.

Thanks for your awesome code and effort... having this in HA has been a huge help here on my farm...

jweston2112 commented 2 years ago

this maybe what I had just mentioned..

2022-05-17 02:45:31 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry jimweston1932@gmail.com for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 474, in async_unload
    result = await component.async_unload_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 173, in async_unload_entry
    return await component.async_unload_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 172, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2022-05-17 02:45:31 ERROR (SyncWorker_8) [homeassistant.components.python_script.bhyve_next_watering.py] Error executing script: Could not find zone's device name on entity switch.backyard_zone. Is this a BHyve zone switch entity?
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 224, in execute
    exec(compiled.code, restricted_globals)
  File "bhyve_next_watering.py", line 18, in <module>
Exception: Could not find zone's device name on entity switch.backyard_zone. Is this a BHyve zone switch entity?
2022-05-17 02:45:31 ERROR (SyncWorker_4) [homeassistant.components.python_script.bhyve_next_watering.py] Error executing script: Could not find zone's device name on entity switch.backyard_zone. Is this a BHyve zone switch entity?
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 224, in execute
    exec(compiled.code, restricted_globals)
  File "bhyve_next_watering.py", line 18, in <module>
Exception: Could not find zone's device name on entity switch.backyard_zone. Is this a BHyve zone switch entity?
2022-05-17 02:45:31 ERROR (SyncWorker_0) [homeassistant.components.python_script.bhyve_next_watering.py] Error executing script: Could not find zone's device name on entity switch.backyard_zone. Is this a BHyve zone switch entity?
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 224, in execute
    exec(compiled.code, restricted_globals)
  File "bhyve_next_watering.py", line 18, in <module>
Exception: Could not find zone's device name on entity switch.backyard_zone. Is this a BHyve zone switch entity? 
gdlesage commented 2 years ago

Great update!

I am seeing same log error, but does not affect function of integration

Logger: homeassistant.setup Source: setup.py:298 First occurred: 9:32:05 AM (1 occurrences) Last logged: 9:32:05 AM

Unable to prepare setup for platform bhyve.binary_sensor: Platform not found (No module named 'homeassistant.components.bhyve')