HASS-sonoff-ewelink icon indicating copy to clipboard operation
HASS-sonoff-ewelink copied to clipboard

https://eu-api.coolkit.cc:8080/api gives 503 Service Temporarily Unavailable

Open stefanbesteman-weareyou opened this issue 5 years ago • 11 comments
trafficstars

delete this template text while filling your issue/request but before that please check if:

  • do you have the latest version of the code in use? (this is a very common problem & fix that everyone ignores)
  • did you gave a quick look to the other issues to see if the issue is already reported? (otherwise i will close the issue without any response. it takes me good hours to develop & manage this plugin, you can take 3 minutes to do a quick reading)

stefanbesteman-weareyou avatar Oct 30 '20 12:10 stefanbesteman-weareyou

Hi peterbuga,

I think I have the same problem than stefanbesteman..

I use home assistant version 0.101.3 with the lattest version of HASS-sonoff-ewelink (HASS-sonoff-ewelink-0.3.3.tar.gz) installed. It was working perfectly but yesterday it begins to fail.. It retrieves all sensor data perfect, but if I try to switch on / off.... It does not work and home assisstant log shows the next message:

2020-10-30 23:49:02 ERROR (Thread-2) [custom_components.sonoff] websocket error: Connection is already closed.

I am going to try install this in the lattest home assistant version with the patch that I have seen are needed in init.py code..

Thank you very much.

This service is very ussefull..

Kind regards, Juan Carlos

jcdlca avatar Oct 30 '20 23:10 jcdlca

I have tried in home assisstant 0.115.3 with the change that I have seen in other issue.. but now in this server the log shows:

2020-10-31 00:12:57 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for sonoff doing I/O at custom_components/sonoff/init.py, line 372: r = requests.get('https://{}-api.coolkit.cc:8080/api/user/device?lang=en&apiKey={}&getTags=1&version=6&ts=%s&nonce=%s&appid=oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq&imei=%s&os=iOS&model=%s&romVersion=%s&appVersion=%s'.format(
2020-10-31 00:13:01 ERROR (Thread-3) [custom_components.sonoff] websocket error: Connection is already closed

Is anyone that has the same problem?.

Kind regards, Juan Carlos

jcdlca avatar Oct 31 '20 00:10 jcdlca

Hello, I have the same issue than @jcdlca .

"websocket error: Connection is already closed."

cris88 avatar Oct 31 '20 09:10 cris88

Hi @cris88,

I am testing with https://github.com/AlexxIT/SonoffLAN and It works well. There are few changes to work with the configuration of HASS-sonoff-ewelink.

Kind regards, Juan Carlos

jcdlca avatar Oct 31 '20 21:10 jcdlca

@cris88 @jcdlca in init.py from custom_components/sonoff/ at line 605 you need to add appid and imei, change de payload with this

    payload = {
        'action'    : "userOnline",
        'userAgent' : 'app',
        'version'   : 6,
        'nonce'     : ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8)),
        'apkVersion': "1.8",
        'os'        : 'iOS',
        'at'        : self._sonoff.get_bearer_token(),
        'apikey'    : self._sonoff.get_user_apikey(),
        'ts'        : str(int(time.time())),
        'model'     : self._sonoff.get_model(),
        'romVersion': self._sonoff.get_romVersion(),
        'sequence'  : str(time.time()).replace('.',''),
        'appid'     : 'oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq', 
        'imei'      : 'a6372777-890f-4dea-8fd0-4fb29fa4982f'
    }

sarbumarius avatar Nov 03 '20 12:11 sarbumarius

@sarbumarius it works! Thank you!!

cris88 avatar Nov 05 '20 21:11 cris88

@cris88 @jcdlca in init.py from custom_components/sonoff/ at line 605 you need to add appid and imei, change de payload with this

    payload = {
        'action'    : "userOnline",
        'userAgent' : 'app',
        'version'   : 6,
        'nonce'     : ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8)),
        'apkVersion': "1.8",
        'os'        : 'iOS',
        'at'        : self._sonoff.get_bearer_token(),
        'apikey'    : self._sonoff.get_user_apikey(),
        'ts'        : str(int(time.time())),
        'model'     : self._sonoff.get_model(),
        'romVersion': self._sonoff.get_romVersion(),
        'sequence'  : str(time.time()).replace('.',''),
        'appid'     : 'oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq', 
        'imei'      : 'a6372777-890f-4dea-8fd0-4fb29fa4982f'
    }

This is perfect, works instantly! what i did: Modified and saved the file with HA running and then restarted HA and works perfectly!

vldfr avatar Nov 07 '20 14:11 vldfr

'appid' : 'oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq', 'imei' : 'a6372777-890f-4dea-8fd0-4fb29fa4982f'

Just for my general knowledge, whose appid and imei is this?

iosoft avatar Dec 08 '20 10:12 iosoft

'appid' : 'oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq', 'imei' : 'a6372777-890f-4dea-8fd0-4fb29fa4982f'

Who's app id is this and how will i find mine

zalcock avatar Jan 04 '21 19:01 zalcock

@cris88 @jcdlca in init.py from custom_components/sonoff/ at line 605 you need to add appid and imei, change de payload with this

    payload = {
        'action'    : "userOnline",
        'userAgent' : 'app',
        'version'   : 6,
        'nonce'     : ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8)),
        'apkVersion': "1.8",
        'os'        : 'iOS',
        'at'        : self._sonoff.get_bearer_token(),
        'apikey'    : self._sonoff.get_user_apikey(),
        'ts'        : str(int(time.time())),
        'model'     : self._sonoff.get_model(),
        'romVersion': self._sonoff.get_romVersion(),
        'sequence'  : str(time.time()).replace('.',''),
        'appid'     : 'oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq', 
        'imei'      : 'a6372777-890f-4dea-8fd0-4fb29fa4982f'
    }

It seems to not be working anymore, anytime I add the lines, however I do it, hass hangs on initializing

josrafafonlo avatar Jan 07 '21 19:01 josrafafonlo