Sonoff /eWeLink component for original firmware

How can I provide the longer error log? I have been using HA for a while but I still don’t know how to do some very basic things, hehe.
This is the error I get:
2019-04-27 01:52:47 ERROR (Thread-2) [websocket] error from callback <bound method Sonoff.on_message of <custom_components.sonoff.Sonoff object at 0x72a96570>>: not all arguments converted during string formatting

add this to configuration.yaml and restart HA

logger:
  default: warning
  logs:
    custom_components.sonoff: debug
    custom_components.sonoff.switch: debug
    custom_components.sonoff.light: debug
    custom_components.sonoff.sensor: debug

ps: the last 3 entries might not work, remove them if they throw further errors, i haven’t test them yet :upside_down_face:

Ok full log is:

2019-05-03 12:45:00 ERROR (Thread-22) [websocket] error from callback <bound method Sonoff.on_message of <custom_components.sonoff.Sonoff object at 0x6924aa70>>: ‘NoneType’ object has no attribute ‘attributes’
2019-05-03 12:45:02 WARNING (MainThread) [homeassistant.setup] Setup of group is taking over 10 seconds.
2019-05-03 12:45:02 ERROR (Thread-22) [websocket] error from callback <bound method Sonoff.on_message of <custom_components.sonoff.Sonoff object at 0x6924aa70>>: ‘NoneType’ object has no attribute ‘attributes’
2019-05-03 12:45:05 ERROR (Thread-22) [websocket] error from callback <bound method Sonoff.on_message of <custom_components.sonoff.Sonoff object at 0x6924aa70>>: ‘NoneType’ object has no attribute ‘attributes’
2019-05-03 12:45:06 ERROR (Thread-22) [websocket] error from callback <bound method Sonoff.on_message of <custom_components.sonoff.Sonoff object at 0x6924aa70>>: ‘NoneType’ object has no attribute ‘attributes’
2019-05-03 12:45:07 ERROR (Thread-22) [websocket] error from callback <bound method Sonoff.on_message of <custom_components.sonoff.Sonoff object at 0x6924aa70>>: ‘NoneType’ object has no attribute ‘attributes’
2019-05-03 12:45:26 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.5/asyncio/tasks.py”, line 241, in _step
result = coro.throw(exc)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 352, in async_update_config
dev_id, device)
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 742, in update_config
with open(path, ‘a’) as out:
PermissionError: [Errno 13] Permission denied: ‘/home/homeassistant/.homeassistant/known_devices.yaml’
2019-05-03 12:45:26 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.5/asyncio/tasks.py”, line 241, in _step
result = coro.throw(exc)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 352, in async_update_config
dev_id, device)
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)

If you want I put logger in configuration.yaml and I have other message do you want to analyze???I can see that there is a problem with api key

And this is my log.

2019-05-03 17:04:42 DEBUG (MainThread) [custom_components.sonoff] Create the main object
2019-05-03 17:04:44 INFO (MainThread) [custom_components.sonoff] Found websocket address: eu-pconnect2.coolkit.cc
2019-05-03 17:04:44 DEBUG (Thread-2) [custom_components.sonoff] (re)init websocket
2019-05-03 17:04:44 DEBUG (Thread-2) [custom_components.sonoff] websocket msg: {"error":0,"apikey":"0099a1eb-xxxx-XXXX-9ade-fe34ed876f4b","config":{"hb":1,"hbInterval":145},"sequence":"15568958846129222"}

I have updated to 0.92.2 and now this is my log
DEBUG (MainThread) [custom_components.sonoff] Create the main object
2019-05-03 15:07:29 INFO (MainThread) [custom_components.sonoff] Found websocket address: eu-pconnect1.coolkit.cc
2019-05-03 15:07:29 DEBUG (Thread-22) [custom_components.sonoff] (re)init websocket
2019-05-03 15:07:30 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“error”:0,“apikey”:“8dc99f7d-7786-453d-8117-f95a07c4b6a7”,“config”:{“hb”:1,“hbInterval”:145},“sequence”:“15568888502885945”}
2019-05-03 15:07:40 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“10007089e1”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“power”:“165.30”,“voltage”:“232.95”,“current”:“1.00”,“switch”:“on”},“from”:“device”}
2019-05-03 15:07:40 ERROR (Thread-22) [websocket] error from callback <bound method Sonoff.on_message of <custom_components.sonoff.Sonoff object at 0x692f8c70>>: ‘NoneType’ object has no attribute ‘attributes’
2019-05-03 15:07:56 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“10007089e1”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“power”:“162.82”,“voltage”:“232.91”,“current”:“0.99”,“switch”:“on”},“from”:“device”}
2019-05-03 15:07:59 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File “/usr/lib/python3.5/asyncio/tasks.py”, line 241, in _step
    result = coro.throw(exc)
  File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 352, in async_update_config
    dev_id, device)
  File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
    yield self  # This tells Task to wait for completion.
  File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
    future.result()
  File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
    raise self._exception
  File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 742, in update_config
    with open(path, ‘a’) as out:
PermissionError: [Errno 13] Permission denied: ‘/home/homeassistant/.homeassistant/known_devices.yaml’
2019-05-03 15:07:59 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File “/usr/lib/python3.5/asyncio/tasks.py”, line 241, in _step
    result = coro.throw(exc)
  File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 352, in async_update_config
    dev_id, device)
  File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
    yield self  # This tells Task to wait for completion.
  File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
    future.result()
  File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
    raise self._exception
  File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 742, in update_config
    with open(path, ‘a’) as out:
PermissionError: [Errno 13] Permission denied: ‘/home/homeassistant/.homeassistant/known_devices.yaml’
2019-05-03 15:08:27 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“100041a502”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“voltage”:“229.31”,“switch”:“off”},“from”:“device”}
2019-05-03 15:08:36 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“10007089e1”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“power”:“165.27”,“voltage”:“232.76”,“current”:“1.00”,“switch”:“on”},“from”:“device”}
2019-05-03 15:08:52 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“1000419f97”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“voltage”:“230.16”,“switch”:“on”},“from”:“device”}
2019-05-03 15:08:52 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“100041a6bd”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“power”:“2.95”,“voltage”:“234.19”,“current”:“0.00”,“switch”:“on”},“from”:“device”}
2019-05-03 15:08:54 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“10007089e1”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“power”:“162.53”,“voltage”:“233.06”,“current”:“0.99”,“switch”:“on”},“from”:“device”}
2019-05-03 15:08:54 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“100041a6bd”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“power”:“3.66”,“voltage”:“233.67”,“switch”:“on”},“from”:“device”}
2019-05-03 15:09:04 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“10004198ec”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“voltage”:“233.85”,“switch”:“on”},“from”:“device”}
2019-05-03 15:09:06 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“100041a759”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“voltage”:“229.44”,“switch”:“off”},“from”:“device”}
2019-05-03 15:09:07 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“100041a919”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“voltage”:“229.95”,“switch”:“on”},“from”:“device”}
2019-05-03 15:09:08 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“10004197e4”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“voltage”:“230.24”,“switch”:“on”},“from”:“device”}
2019-05-03 15:09:11 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“1000419eab”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“power”:“68.22”,“voltage”:“230.14”,“switch”:“on”},“from”:“device”}
2019-05-03 15:09:12 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“1000419e09”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“voltage”:“230.33”,“switch”:“on”},“from”:“device”}
2019-05-03 15:09:13 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“100041a801”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“voltage”:“229.40”,“switch”:“off”},“from”:“device”}
2019-05-03 15:09:18 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“10007089e1”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“power”:“162.20”,“voltage”:“232.65”,“switch”:“on”},“from”:“device”}
2019-05-03 15:10:27 DEBUG (Thread-22) [custom_components.sonoff] websocket msg: {“action”:“update”,“deviceid”:“100041a502”,“apikey”:“6ac1b22a-4f46-460c-a451-9e0276f4768d”,“userAgent”:“device”,“ts”:0,“params”:{“voltage”:“229.02”,“switch”:“off”},“from”:“device”}

I know it is very long the next time I will copy in paste.bin exscuse me, sorry

Thanks for this! Works perfectly, very easy! :sunglasses:

i have istalled home assistant from zero i have this message i think there is something wrong in init.py
custom_components.sonoff.Sonoff object at 0x7599ae10. Can you help me please??

Does your component work? Some people get those error messages but they don’t seem to interfere with the correct function of the component.

BTW, since I upgraded to 0.92 I think it is now convenient to have a manifest.json file in the Sonoff folder (/custom_components/sonoff/manifest.json).
I created mine like this:

{
        "domain": "sonoff",
        "name": "Sonoff sensor custom component",
        "documentation": "https://github.com/peterbuga/HASS-sonoff-ewelink",
        "requirements": [],
        "dependencies": [],
        "codeowners": ["@peterbuga"]
}

Maybe it’s useful for someoneelse.
And I still get the websocket warnings, so this was not the problem.

I included the manifest.json file in place, but I still get the warnings, and the Configuration checker still complains about the component. So this was not the solution. :frowning:

Peterbuga have you abandoned this component??? Help us please??? It is wonderful to have a custom component of this I hoped that It will be original component for home assistant/hassio.

For God’s sake, he has been here within the last 9 days. I imagine he has a life, and in any event he is NOT your bitch.

6 Likes

@nickrout be quiet with worlds.I asked him, i don’t want that he will do things as command i was only warried becasue some post ago @peterbuga wrote :" i think they might turn obsolete this component with a few firmware updates :sweat_smile: not sure if i’m happy or not yet :thinking:" only for thaht.

My comment was not directed at you @Antonio_Longo

Ok ok so excuse me so I must every 2/3 hours restart hassio/home assistant and clear log because this problem lock hassio/home assistant

looking at the log in this post Sonoff /eWeLink component for original firmware - #468 by Hdjweb there does not seem to be an error related to sonoff custom component.

This seems to mark the start of the error, as I said I can see nothing in the error about the sonoff component. The errors are about device tracking.

yes it is a websoket error related to api key of custom component, iti is mentioned in init.py some are only warning other are error

I assume you are referring to this line, I am not sure how I missed that.