Sonoff /eWeLink component for original firmware

Is Sonoff Pow R2 supported?

Hi,
There is warning in the HA 0.109.0

  • 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 176: headers=self._headers, json=app_details)
  • 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 374: ), headers=self._headers)
  • 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 221: r = requests.post(‘https://%s-disp.coolkit.cc:8080/dispatch/app’ % self._api_region, headers=self._headers)
3 Likes

i have mainly error line 374

2020-04-29 19:09:01 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 374: ), headers=self._headers)

Error comes from this code part:

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(
            self._api_region, self.get_user_apikey(), str(int(time.time())), ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8)), self._imei, self._model, self._romVersion, self._appVersion
            ), headers=self._headers)
2 Likes

Getting the same error on my setup as well

Hi,
I have the same warnings in HA version 0.109.1
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 374: ), headers=self._headers).
Maybe it will need a fix.
Thanks

@ reported warning above https://github.com/peterbuga/HASS-sonoff-ewelink/issues/232#issuecomment-621987827

2 Likes

hi,
i am having the folowing error all the time:
ERROR (Thread-2) [custom_components.sonoff] websocket error: [Errno 104] Connection reset by peer
(rp3 with hassio)
and hassio stop responding after about 1/2 days.
do you have any idea what can cause it ?

Sounds like he may not be able to look into it right away.
This one worked for me, simply removed the “api_region” line, I had a very basic setup.

Thanks for all your time and effort @peterbuga worked perfect for quite a long time!

hi,
how to install it just to replace all the files at the sonoff folder (under the cutom component) ?
because the sensor.py file is missing

Hey @peterbuga just thought I would let you know that your integration works with my Wemeter energy monitor here WEMeter 3 phase energy monitor as this device uses Ewelink.
So I guess you can add it to your device list. Heres what i am getting out of it at the moment.


Thanks for such a great integration. If I could see the three phases that it reads that would just be the icing on the cake!

Can it work on separate vlan?

I move 2 sonoff device into separate vLAN and I lost the connectivity.

Hi!
Do you have some news about this warning?

are you sure you’re using my component? and not the one(s) lan-oriented? my component doesn’t care where you have your sonoff’s installed they could be easily around the world and the HA instance hosted on a VPS and it’ll still work => cloud based

yes.

1 Like

Just upgraded to .6 and all my sonoff entities have lost connection. rolled back to the snapshot .4 and still broken. I saw the I/O loop before but was working fine. Thought the upgrade would help but has broken everything now.
Here trying to find a fix.

Looking at AlexxIT py files to see if these fix the issue.

After hours of working on the hyperv back ups etc, finally came back up with all connections. I think it may have been something to do with me trying to install grafana/influxdb and messing about with that. Reverted back to a copy without grafana installed.

In my Sonoff integration binary sensors stop working. Error log:

Error while setting up sonoff platform for binary_sensor

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 178, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 442, in wait_for
return fut.result()
File “/config/custom_components/sonoff/binary_sensor.py”, line 34, in async_setup_platform
entity = SonoffSensorRF(hass, device, rf)
File “/config/custom_components/sonoff/binary_sensor.py”, line 47, in init
self._name = self._rf[‘name’]
KeyError: ‘name’

Is AlexxIT integration works?

Yes, like a charm :wink:

binary sensors works too? or you don’t use it?