gazoodle / gecko-home-assistant

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

does not work after HACS install. #15

Closed maccident closed 2 years ago

maccident commented 3 years ago

First, thank you for taking your time to write this integration.

Describe the bug

Just installed the integration via HACS, and enabled the integration in the UI (Configuration -> Integrations -> Gecko)

I wasn't asked for any information, and after completing, I had an integration listed with my spa name.

No devices or entities are listed, and the logs under Configuration -> Logs show the following relevant information:

Home Assistant Info

Version core-2021.4.3
Installation Type Home Assistant OS
Development false
Supervisor true
Docker true
Virtual Environment false
Python Version 3.8.7
Operating System Family Linux
Operating System Version 5.4.109
CPU Architecture x86_64
Timezone America/Los_Angeles

Error:

Logger: custom_components.gecko
Source: util/async_.py:139 
Integration: Gecko (documentation, issues) 
First occurred: 1:29:04 PM (1 occurrences) 
Last logged: 1:29:04 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 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1266, 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 150, in protected_loop_func
    check_loop()
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 139, 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)
maegibbons commented 3 years ago

Hi @scope666

Apply the STATP fix otherwise you will get data errors which become evident after a few hours of running.

Krs

Mark

Scope666 commented 3 years ago

Hi @Scope666

Apply the STATP fix otherwise you will get data errors which become evident after a few hours of running.

Krs

Mark

Is this a sign that I need the patch? (I've since installed it via Portainer as a test, will use the script method for a more permanent fix)

image

maegibbons commented 3 years ago

Possibly, usually more visible in Heat graphs jumping up and down. The effect gets cumalatively worse from system start.

Everybody needs to apply patch. It is NOT system dependent. I have not yet come across a controller that does NOT issue STATP messages.

If it issues STATP the problem will be there.

Krs

Mark

rct commented 3 years ago

Is this a sign that I need the patch? (I've since installed it via Portainer as a test, will use the script method for a more permanent fix)

I was going to post the same thing this morning.

image

This "stuttering" of on/off is hopefully resolved with that patch. image

Note: I've opened #22 to try and group information about that specific problem in one place to help others.

Scope666 commented 3 years ago

Somewhat related to this, since I'm new to this integration... is there a dependency on Gecko cloud servers for In Touch 2? I'm suddenly not able to connect with the mobile app, yet still have solid blue on the transmitter and receiver. This is translating to lots of this in the HA logs:

2021-06-13 18:30:00 WARNING (Thread-6) [geckolib.driver.udp_socket] Couldn't find new handler for b'RFERR'
2021-06-13 18:30:02 DEBUG (Thread-6) [geckolib.driver.udp_socket] Handler has timed out
2021-06-13 18:30:02 DEBUG (Thread-6) [geckolib.driver.udp_socket] Handler retry count 0
2021-06-13 18:30:02 DEBUG (Thread-6) [geckolib.driver.udp_socket] Sending b'<PACKT><SRCCN>IOScc927d39-a1c3-449b-a740-50393cd2699f</SRCCN><DESCN>SPA68:27:19:85:f6:ff</DESCN><DATAS>SFILE\x03</DATAS></PACKT>' to ('192.168.1.73', 10022)
2021-06-13 18:30:02 DEBUG (Thread-6) [geckolib.driver.udp_socket] Received b'<PACKT><SRCCN>SPA68:27:19:85:f6:ff</SRCCN><DESCN>IOScc927d39-a1c3-449b-a740-50393cd2699f</DESCN><DATAS>RFERR</DATAS></PACKT>' from ('192.168.1.73', 10022)
2021-06-13 18:30:02 DEBUG (Thread-6) [geckolib.driver.udp_socket] Received b'RFERR' from ('192.168.1.73', 10022, b'SPA68:27:19:85:f6:ff', b'IOScc927d39-a1c3-449b-a740-50393cd2699f')
2021-06-13 18:30:02 WARNING (Thread-6) [geckolib.driver.udp_socket] Couldn't find new handler for b'RFERR'
2021-06-13 18:30:04 DEBUG (Thread-6) [geckolib.driver.udp_socket] Handler has timed out
2021-06-13 18:30:04 DEBUG (Thread-6) [geckolib.driver.udp_socket] Default retry failed handler for GeckoConfigFileProtocolHandler(send_bytes=None, age=2.032159031019546, has_timedout=True, should_remove_handler=False, timeout=2s, retry_count=0)(parms=('192.168.1.73', 10022, b'SPA68:27:19:85:f6:ff', b'IOScc927d39-a1c3-449b-a740-50393cd2699f'), content=None) being used
2021-06-13 18:30:04 DEBUG (Thread-6) [geckolib.driver.udp_socket] Removed timedout handlers [GeckoConfigFileProtocolHandler(send_bytes=None, age=2.032357721007429, has_timedout=True, should_remove_handler=True, timeout=2s, retry_count=0)(parms=('192.168.1.73', 10022, b'SPA68:27:19:85:f6:ff', b'IOScc927d39-a1c3-449b-a740-50393cd2699f'), content=None)]
2021-06-13 18:30:04 DEBUG (Thread-6) [geckolib.driver.udp_socket] Remaining handlers [GeckoPacketProtocolHandler(send_bytes=None, age=2.0128584560006857, has_timedout=False, should_remove_handler=False, timeout=0s, retry_count=0)(parms=('192.168.1.73', 10022, b'SPA68:27:19:85:f6:ff', b'IOScc927d39-a1c3-449b-a740-50393cd2699f'), content=b'RFERR'), GeckoPartialStatusBlockProtocolHandler(send_bytes=None, age=22.58305094507523, has_timedout=False, should_remove_handler=False, timeout=0s, retry_count=0)(parms=None, content=None), GeckoPingProtocolHandler(send_bytes=None, age=7.5490875779651105, has_timedout=False, should_remove_handler=False, timeout=0s, retry_count=0)(parms=('192.168.1.73', 10022, b'SPA68:27:19:85:f6:ff', b'IOScc927d39-a1c3-449b-a740-50393cd2699f'), content=None)]
2021-06-13 18:30:12 ERROR (Thread-5) [root] Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/site-packages/geckolib/spa.py", line 286, in _ping_thread_func
    self.refresh()
  File "/usr/local/lib/python3.8/site-packages/geckolib/spa.py", line 315, in refresh
    if not self.is_connected:
  File "/usr/local/lib/python3.8/site-packages/geckolib/spa.py", line 310, in is_connected
    raise RuntimeError("Spa took too long to connect ...")
RuntimeError: Spa took too long to connect ...
maegibbons commented 3 years ago

There is no depenency within geckolib for cloud servers and I dont think there is a requirement for the intouch.2 to talk to the cloud. The rferr is when the two blue boxes are not talking.

This is rare and usually requires a reboot in home or of the hot tub.

Krs

Mark

Scope666 commented 3 years ago

There is no depenency within geckolib for cloud servers and I dont think there is a requirement for the intouch.2 to talk to the cloud. The rferr is when the two blue boxes are not talking.

This is rare and usually requires a reboot in home or of the hot tub.

Krs

Mark

Cool, thanks for confirming. I had the idea to use a spare WiFi extender that has an ethernet port to use basically as an ethernet bridge, this allowed me to get the In Touch MUCH closer to the tub. So far so good...

PS. However they're doing the RF, it really doesn't travel through walls well.

Johan-Arens commented 2 years ago

Folk, I'm sorry that I've not been able to get time to address these issues, it bugs me that you guys are trying to use this, not getting anywhere and I'm unable to really help.

There are a couple of avenues that can be followed to try to alleviate some of the issues.

  1. SpaPackStruct.xml -> This file is downloaded from the Gecko website. It is available at http://intouch.geckoal.com/gecko/prod/SpaPackStruct.xml. If you get this file and place it is in the integration folder then the code will not need to go looking for it which will prevent HA from complaining that there is IO during initialization.
  2. However, this is version 19 of the file which doesn't contain the definintions for some modern YE model spas. This leads to not finding any entities (I need to get a better error system so this is clear). I have managed to extract a later version of the file from the Android APK files (see Run time error: Spa took too long to connectย geckolib#12). Using this can sometimes help.
  3. This still is not be the latest version, and at present I have no way to get this. I'm trying to get Gecko to release this and I've made contact with their CTO on LinkedIn so there is some hope there.

As a final last-ditch effort we might construct our own XML data but we'd need to sniff the protocol using the app and being careful to operate specific devices, like power-up P1 and then off again. This would be a long uphill process so I'm not massively keen to go there.

If anyone fancies also touching base with Gecko to see if we can persuade them to work with us then this might be a good choice, always keen for win-win solutions.

I will get back to this library soon, but other commitments are ... well, important too.

Stupid question, by saying place the XML file in the integration folder, do you mean config/custom_components/gecko ?

TomK commented 2 years ago

Stupid question, by saying place the XML file in the integration folder, do you mean config/custom_components/gecko ?

@Johan-Arens I put mine in /config/ and that seems to work ๐Ÿ‘

Johan-Arens commented 2 years ago

Stupid question, by saying place the XML file in the integration folder, do you mean config/custom_components/gecko ?

@Johan-Arens I put mine in /config/ and that seems to work ๐Ÿ‘

Thanks TomK, I'm getting a step further, I guess now what is missing is to get v24 of SpaPackStruct.xml.

Did anyone get any luck getting a copy of it ?

RhinoRich commented 2 years ago

Stupid question, by saying place the XML file in the integration folder, do you mean config/custom_components/gecko ?

@Johan-Arens I put mine in /config/ and that seems to work ๐Ÿ‘

Thanks TomK, I'm getting a step further, I guess now what is missing is to get v24 of SpaPackStruct.xml.

Did anyone get any luck getting a copy of it ?

@maegibbons modified it for my newer pack. I can send it to you if you DM me your email address.

Johan-Arens commented 2 years ago

Stupid question, by saying place the XML file in the integration folder, do you mean config/custom_components/gecko ?

@Johan-Arens I put mine in /config/ and that seems to work ๐Ÿ‘

Thanks TomK, I'm getting a step further, I guess now what is missing is to get v24 of SpaPackStruct.xml. Did anyone get any luck getting a copy of it ?

@maegibbons modified it for my newer pack. I can send it to you if you DM me your email address.

Hi maegibbons, I sent you email, thanks !

RhinoRich commented 2 years ago

Stupid question, by saying place the XML file in the integration folder, do you mean config/custom_components/gecko ?

@Johan-Arens I put mine in /config/ and that seems to work ๐Ÿ‘

Thanks TomK, I'm getting a step further, I guess now what is missing is to get v24 of SpaPackStruct.xml. Did anyone get any luck getting a copy of it ?

@maegibbons modified it for my newer pack. I can send it to you if you DM me your email address.

Hi maegibbons, I sent you email, thanks !

The message was from me. I just credited the author of the fix.

EDIT: Sorry, not sure how the github mailserver works. Please mail richardhallhenley at gmail

Johan-Arens commented 2 years ago

Yep, trying now :-)

Thanks !

Johan Arens @.***

On Aug 18, 2021, at 2:17 PM, RhinoRich @.***> wrote:

Hi. Obviously it has to be renamed.

On Wed, 18 Aug 2021 at 19:15, Johan-Arens @.***> wrote:

Stupid question, by saying place the XML file in the integration folder, do you mean config/custom_components/gecko ?

@Johan-Arens https://github.com/Johan-Arens I put mine in /config/ and that seems to work ๐Ÿ‘

Thanks TomK, I'm getting a step further, I guess now what is missing is to get v24 of SpaPackStruct.xml. Did anyone get any luck getting a copy of it ?

@maegibbons https://github.com/maegibbons modified it for my newer pack. I can send it to you if you DM me your email address.

Hi maegibbons, I sent you email, thanks !

โ€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gazoodle/gecko-home-assistant/issues/15#issuecomment-901326964, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASKOHHOQYE7ZK4K3LN35N3TT5P2DDANCNFSM42YCGPWQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

โ€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gazoodle/gecko-home-assistant/issues/15#issuecomment-901328339, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJZAUASQQLKPCHFOWT4ZOPLT5P2LDANCNFSM42YCGPWQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.

RhinoRich commented 2 years ago

Looks like you have to change that format! I messaged you on FB Messenger

maegibbons commented 2 years ago

Looks like you have to change that format! I messaged you on FB Messenger

Rich.

I have sorted him with V33.

Krs

Mark

gazoodle commented 2 years ago

I think all the issues in here are resolved, mostly with v0.0.7, but all with v0.0.8, so I'm closing the issue. Please feel free to reopen or raise another issue if required.