hllhll / HomeAssistant-EKON-iAircon

EKON iAircon / Tadiran climate component written in Python3 for Home Assistant. On the bases of Gree Climate component for easier interfacing with HASS
GNU General Public License v3.0
14 stars 7 forks source link

AC not responding #15

Closed liorm0505 closed 3 years ago

liorm0505 commented 3 years ago

Describe the bug AC not responding. Entity available but do not control the AC. Restarting HA solve the problem temporerly.

To Reproduce Turn the AC on/off several times (not repeatedly)

Configuration

climate:

  - platform: ekon
    username: xxx
    password: xxx
    #base_url: https://www.airconet.xyz/
    base_url: https://www.activate-ac.com/
    name_mapping: 
      - id : 2771
        name: Living Room AC
    ssl_ignore: True

Platform: HASSIO 0.114.4

Log:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 263, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 456, in async_device_update
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/ekon/climate.py", line 581, in update
    self.GetAndSync()
  File "/config/custom_components/ekon/climate.py", line 547, in GetAndSync
    self._controller.refreshACs()
  File "/config/custom_components/ekon/climate.py", line 405, in refreshACs
    self.refreshACsJson( self.query_devices() )
  File "/config/custom_components/ekon/climate.py", line 343, in query_devices
    attch = json.loads(result.content)['attachment']
  File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Logger: custom_components.ekon.climate
Source: custom_components/ekon/climate.py:298
Integration: ekon (documentation)
First occurred: September 15, 2020, 7:24:07 PM (109802 occurrences)
Last logged: 9:11:11 PM

ws_on_error() - WS Error:
Logger: custom_components.ekon.climate
Source: custom_components/ekon/climate.py:299
Integration: ekon (documentation)
First occurred: September 15, 2020, 7:24:07 PM (109802 occurrences)
Last logged: 9:11:11 PM

Handshake status 502 Bad Gateway
scheme http is invalid
[Errno 111] Connection refused
[Errno 110] Operation timed out
[Errno -3] Try again

Note: While this error occure, the AC respond via Airconnect+ app.

HawkUser commented 3 years ago

Please try my PR, I guess your problem stick with the SSL_Ignore https://github.com/hllhll/HomeAssistant-EKON-iAircon/compare/master...HawkUser:patch-1

hllhll commented 3 years ago

It looks more then that, It seems like the WebSocket fails and the fallback HTTP fails also, @liorm0505 Thanks, will look into that.

BTW, You should check why the WS fails, it shouldnt, Does it changes (probably not, but worth a shot) if you add the config:

ws_url: wss://www.activate-ac.com/v2

'''scheme http is invalid''' Seems like wrong configuration, please verify ws_url and make sure it's web socket secure scheme (wss)

liorm0505 commented 3 years ago

Hi,

Thank you for the suggestion. I am currently testing to see if the issue still persist if i turn off AD-GUARD addon. Though i do not have the ability to configure the device DNS, i would like to give it a shot.

BTW - are you having issues with the Ekon device getting stuck? (the app says it's not connected to the Wifi and the AC does not respond to the IR). This is not related to the issue above.

hllhll commented 3 years ago

Hi I Hope that the original problem is now resolved, for the other issue, Let's discuss on #17

liorm0505 commented 3 years ago

Hi, After updating to the latest code and disabling AD-GUARD the original problem is resolved.

Thanks.