gazoodle / gecko-home-assistant

Home Assistant integration for spas equipped with Gecko Alliance in.touch2 modules
MIT License
68 stars 24 forks source link

Error from auto-detecting Mr. Steam steamlinx gecko unit. #20

Closed rct closed 3 years ago

rct commented 3 years ago

Version of the custom_component

Version 0.0.5 - from manifest.json Version 0.0.1 - from const.py

pulled from master (default) branch at github.

Configuration

Integration added through UI, no other configuration done. All options still enabled (binary sensor, climate, light, sensor, switch)

image

Describe the bug

Added the gecko-home-assistant custom component. Enabled the integration. It auto detected the Mr. Steam Steamlinux Gecko unit, which isn't currently handled by Geckolib. See Geckolib issue: https://github.com/gazoodle/geckolib/issues/6

Note: when I added the integration to Home Assistant the Gecko unit for the hot tub wasn't connected yet.

I'm not expecting Home Assistant support for the Mr. Steam yet, just looking to avoid the error from the auto-detection of the Mr. Steam unit.

Will report back what happens when integration/hass restarted with in.touch2 (hot tub) Gecko connected.

Debug log

Logger: custom_components.gecko
Source: util/async_.py:140
Integration: Gecko (documentation, issues)
First occurred: 1:29:13 PM (1 occurrences)
Last logged: 1:29:13 PM
Exception during entry setup

Traceback (most recent call last):
  File "/config/custom_components/gecko/__init__.py", line 45, in async_setup_entry
    facade = locator.get_spa_from_identifier(spa_identifier).get_facade(False)
  File "/usr/local/lib/python3.8/site-packages/geckolib/spa.py", line 46, in get_facade
    facade = GeckoFacade(GeckoSpa(self).start_connect())
  File "/usr/local/lib/python3.8/site-packages/geckolib/spa.py", line 73, in __init__
    GeckoSpaPack.__init__(self)
  File "/usr/local/lib/python3.8/site-packages/geckolib/driver/spapack.py", line 15, in __init__
    GeckoSpaPack.download_if_needed()
  File "/usr/local/lib/python3.8/site-packages/geckolib/driver/spapack.py", line 32, in download_if_needed
    GeckoSpaPack.download()
  File "/usr/local/lib/python3.8/site-packages/geckolib/driver/spapack.py", line 39, in download
    response = http.request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/request.py", line 74, in request
    return self.request_encode_url(
  File "/usr/local/lib/python3.8/site-packages/urllib3/request.py", line 96, in request_encode_url
    return self.urlopen(method, url, **extra_kw)
  File "/usr/local/lib/python3.8/site-packages/urllib3/poolmanager.py", line 375, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.8/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1263, in _send_request
    self.putrequest(method, url, **skips)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 214, in putrequest
    return _HTTPConnection.putrequest(self, method, url, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 151, in protected_loop_func
    check_loop()
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 140, in check_loop
    raise RuntimeError(
RuntimeError: I/O must be done in the executor; Use `await hass.async_add_executor_job()` at custom_components/gecko/__init__.py, line 45: facade = locator.get_spa_from_identifier(spa_identifier).get_facade(False)

This is the Home Assistant logger output.  If you need me to turn up debug logging, or give logging from the geckolib shell I can do that. 
maegibbons commented 3 years ago

Have you tried to manually download and install the SpaPackStruct.xml file and put it in the config directory?

Your error looks to be related to the async download issue.

rct commented 3 years ago

Have you tried to manually download and install the SpaPackStruct.xml file and put it in the config directory?

Your error looks to be related to the async download issue.

I have two Gecko units. The Gecko unit that's being discovered is actually for a steam shower, marketed as "SteamLinx" for Mr. Steam steam generators. The definitions for it aren't in SpaPackStruct. There is a separate mobile app for the steam unit.

See https://github.com/gazoodle/geckolib/issues/6

I wasn't clear from where that thread got dropped off whether the problem was finding the equivalent XML file or fixing a naming convention issue.

In any case, I'd be happy to get the Hass integration (probably the Geckolib component) to ignore the steamlinx for now.

maegibbons commented 3 years ago

So what happens when the steamlink is disconnected?

Does it find the tub ok and populate entities?

Are you just trying to ignore the steamlink in the integration?

Just trying to establish your goals.

Krs

Mark

rct commented 3 years ago

I haven't tried with the steamlinx disconnected yet. I will be trying that in the next few days, but I'd prefer not to have to disconnect the steamlinx from the network.

My goal is to be able to monitor the hot tub, ideally from Hass.

maegibbons commented 3 years ago

We can probably modify to ignore steamlink.

I would need access to your HA installation to try that!

PM me your email address if you would like me to take a look.

Krs

Mark

rct commented 3 years ago

I've been under the impression GitHub lacks a PM feature,

Thanks for your offer, but opening up outside access for someone isn't something I'd do.

maegibbons commented 3 years ago

Thats fine. Perfectly understand. I've already fixed several.

Just giving back.

Krs

Mark

rct commented 3 years ago

An update, after disconnecting the Steamlinx Gecko unit, deleting and re-adding the Gecko integration, and restarting Home Assistant I'm still seeking the same "Failed to set up" error. Judging by the other pen issues with the same exception being thrown RuntimeError: I/O must be done in the executor; I now need to look at the other fixes.

maegibbons commented 3 years ago

That exception is usually to do with downloading SpaPackStruct.xml. Are you sure that you have manually tried copying that file to the HA root "config" directory?

Krs

Mark

rct commented 3 years ago

Circling back to close the loop on this. I got things working by:

I can now restart Hass with both connected without issues.

I don't know if disconnecting the steamlinx unit during discovery/config was actually necessary.

At some point I should test with a fresh Hass instance that has no gecko config history. I'm closing this now and will reopen if needed. Updates related to the steamlinx will be the related Geckolib issue - https://github.com/gazoodle/geckolib/issues/6