Home Assistant Integration for Sengled Bulbs. This is a custom component to allow control of Sengled Bulbs in Homeassistant using the unofficial Sengled API. Please note this mimics the Sengled app and therefore Sengled may cut off access at anytime.
Error during setup of component sengledapi
9:35:51 PM – (ERROR) util/async_.py
Detected blocking call to putrequest inside the event loop. This is causing stability issues. Please report issue to the custom integration author for sengledapi doing blocking calls at custom_components/sengledapi/sengledapi/devices/request.py, line 40: r = requests.post(self._url, headers=self._header, data=self.payload)
9:35:51 PM – (WARNING) util/async.py
full logs below
2022-09-21 01:35:49.451 INFO (MainThread) [custom_components.sengledapi] Creating new SengledApi component
2022-09-21 01:35:49.451 INFO (MainThread) [custom_components.sengledapi.sengledapi.sengledapi] Sengled Api initializing.
2022-09-21 01:35:49.451 INFO (MainThread) [custom_components.sengledapi.sengledapi.sengledapi] Sengled Api initializing async.
2022-09-21 01:35:49.452 INFO (MainThread) [custom_components.sengledapi.sengledapi.sengledapi] Sengledapi: Login
2022-09-21 01:35:49.452 INFO (MainThread) [custom_components.sengledapi.sengledapi.sengledapi] SengledApi: Login Request.
2022-09-21 01:35:49.452 INFO (MainThread) [custom_components.sengledapi.sengledapi.devices.request] SengledApi: Sengled Request initializing.
2022-09-21 01:35:49.452 INFO (MainThread) [custom_components.sengledapi.sengledapi.devices.request] SengledApi: Get Login Response async.
2022-09-21 01:35:50.657 DEBUG (MainThread) [custom_components.sengledapi.sengledapi.devices.request] SengledApi: Get Login Response {'ret': 3, 'msg': '用户名不存在', 'customerId': None, 'mobileId': None, 'nick_name': '', 'relative_path': '', 'jsessionId': '', 'ucenterAddr': '', 'appServerAddr': '', 'serAddressess': None, 'privacyPolicyStatus': None}
2022-09-21 01:35:50.659 DEBUG (MainThread) [custom_components.sengledapi.sengledapi.sengledapi] SengledApi Login {'ret': 3, 'msg': '用户名不存在', 'customerId': None, 'mobileId': None, 'nick_name': '', 'relative_path': '', 'jsessionId': '', 'ucenterAddr': '', 'appServerAddr': '', 'serAddressess': None, 'privacyPolicyStatus': None}
2022-09-21 01:35:50.659 INFO (MainThread) [custom_components.sengledapi] SengledApi Connected to Sengled account
2022-09-21 01:35:50.659 DEBUG (MainThread) [custom_components.sengledapi.sengledapi.sengledapi] SengledApi: Get Devices.
2022-09-21 01:35:50.659 INFO (MainThread) [custom_components.sengledapi.sengledapi.devices.request] SengledApi: Sengled Request initializing.
2022-09-21 01:35:51.036 INFO (MainThread) [customcomponents.sengledapi.sengledapi.devices.request] SengledApi: Sengled Request initializing.
2022-09-21 01:35:51.265 WARNING (MainThread) [homeassistant.util.async] Detected blocking call to putrequest inside the event loop. This is causing stability issues. Please report issue to the custom integration author for sengledapi doing blocking calls at custom_components/sengledapi/sengledapi/devices/request.py, line 40: r = requests.post(self._url, headers=self._header, data=self._payload)
2022-09-21 01:35:51.268 ERROR (MainThread) [homeassistant.setup] Error during setup of component sengledapi
Traceback (most recent call last):
File "/config/custom_components/sengledapi/sengledapi/sengledapi.py", line 253, in async_do_request
return await Request(url, payload).async_get_response(jsessionId)
File "/config/custom_components/sengledapi/sengledapi/devices/request.py", line 57, in async_get_response
data = await resp.json()
File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1103, in json
raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://element.cloud.sengled.com/zigbee/device/getDeviceDetails.json')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
result = await task
File "/config/custom_components/sengledapi/init.py", line 64, in async_setup
sengledapi_devices = await sengledapi_account.async_get_devices()
File "/config/custom_components/sengledapi/sengledapi/sengledapi.py", line 182, in async_get_devices
data = await self.async_do_request(url, payload, SESSION.jsession_id)
File "/config/custom_components/sengledapi/sengledapi/sengledapi.py", line 255, in async_do_request
return Request(url, payload).get_response(jsessionId)
File "/config/custom_components/sengledapi/sengledapi/devices/request.py", line 40, in get_response
r = requests.post(self._url, headers=self._header, data=self._payload)
File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 115, in post
return request("post", url, data=data, json=json, kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, send_kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 398, in _make_request
conn.request(method, url, httplib_request_kw)
File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 239, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/local/lib/python3.10/http/client.py", line 1282, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.10/http/client.py", line 1293, in _send_request
self.putrequest(method, url, skips)
File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 219, in putrequest
return HTTPConnection.putrequest(self, method, url, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/util/async.py", line 180, in protected_loop_func
checkloop(func, strict=strict)
File "/usr/src/homeassistant/homeassistant/util/async.py", line 168, in check_loop
raise RuntimeError(
RuntimeError: Blocking calls must be done in the executor or a separate thread; Use await hass.async_add_executor_job(); at custom_components/sengledapi/sengledapi/devices/request.py, line 40: r = requests.post(self._url, headers=self._header, data=self._payload)
2022-09-21 01:46:58.003 ERROR (MainThread) [homeassistant.components.ipp.coordinator] Error fetching ipp data: Invalid response from API: Timeout occurred while connecting to IPP server.
Hi there, cany idea what this error means.
Error during setup of component sengledapi 9:35:51 PM – (ERROR) util/async_.py Detected blocking call to putrequest inside the event loop. This is causing stability issues. Please report issue to the custom integration author for sengledapi doing blocking calls at custom_components/sengledapi/sengledapi/devices/request.py, line 40: r = requests.post(self._url, headers=self._header, data=self.payload) 9:35:51 PM – (WARNING) util/async.py
full logs below
2022-09-21 01:35:49.451 INFO (MainThread) [custom_components.sengledapi] Creating new SengledApi component 2022-09-21 01:35:49.451 INFO (MainThread) [custom_components.sengledapi.sengledapi.sengledapi] Sengled Api initializing. 2022-09-21 01:35:49.451 INFO (MainThread) [custom_components.sengledapi.sengledapi.sengledapi] Sengled Api initializing async. 2022-09-21 01:35:49.452 INFO (MainThread) [custom_components.sengledapi.sengledapi.sengledapi] Sengledapi: Login 2022-09-21 01:35:49.452 INFO (MainThread) [custom_components.sengledapi.sengledapi.sengledapi] SengledApi: Login Request. 2022-09-21 01:35:49.452 INFO (MainThread) [custom_components.sengledapi.sengledapi.devices.request] SengledApi: Sengled Request initializing. 2022-09-21 01:35:49.452 INFO (MainThread) [custom_components.sengledapi.sengledapi.devices.request] SengledApi: Get Login Response async. 2022-09-21 01:35:50.657 DEBUG (MainThread) [custom_components.sengledapi.sengledapi.devices.request] SengledApi: Get Login Response {'ret': 3, 'msg': '用户名不存在', 'customerId': None, 'mobileId': None, 'nick_name': '', 'relative_path': '', 'jsessionId': '', 'ucenterAddr': '', 'appServerAddr': '', 'serAddressess': None, 'privacyPolicyStatus': None} 2022-09-21 01:35:50.659 DEBUG (MainThread) [custom_components.sengledapi.sengledapi.sengledapi] SengledApi Login {'ret': 3, 'msg': '用户名不存在', 'customerId': None, 'mobileId': None, 'nick_name': '', 'relative_path': '', 'jsessionId': '', 'ucenterAddr': '', 'appServerAddr': '', 'serAddressess': None, 'privacyPolicyStatus': None} 2022-09-21 01:35:50.659 INFO (MainThread) [custom_components.sengledapi] SengledApi Connected to Sengled account 2022-09-21 01:35:50.659 DEBUG (MainThread) [custom_components.sengledapi.sengledapi.sengledapi] SengledApi: Get Devices. 2022-09-21 01:35:50.659 INFO (MainThread) [custom_components.sengledapi.sengledapi.devices.request] SengledApi: Sengled Request initializing. 2022-09-21 01:35:51.036 INFO (MainThread) [customcomponents.sengledapi.sengledapi.devices.request] SengledApi: Sengled Request initializing. 2022-09-21 01:35:51.265 WARNING (MainThread) [homeassistant.util.async] Detected blocking call to putrequest inside the event loop. This is causing stability issues. Please report issue to the custom integration author for sengledapi doing blocking calls at custom_components/sengledapi/sengledapi/devices/request.py, line 40: r = requests.post(self._url, headers=self._header, data=self._payload) 2022-09-21 01:35:51.268 ERROR (MainThread) [homeassistant.setup] Error during setup of component sengledapi Traceback (most recent call last): File "/config/custom_components/sengledapi/sengledapi/sengledapi.py", line 253, in async_do_request return await Request(url, payload).async_get_response(jsessionId) File "/config/custom_components/sengledapi/sengledapi/devices/request.py", line 57, in async_get_response data = await resp.json() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1103, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://element.cloud.sengled.com/zigbee/device/getDeviceDetails.json') During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component result = await task File "/config/custom_components/sengledapi/init.py", line 64, in async_setup sengledapi_devices = await sengledapi_account.async_get_devices() File "/config/custom_components/sengledapi/sengledapi/sengledapi.py", line 182, in async_get_devices data = await self.async_do_request(url, payload, SESSION.jsession_id) File "/config/custom_components/sengledapi/sengledapi/sengledapi.py", line 255, in async_do_request return Request(url, payload).get_response(jsessionId) File "/config/custom_components/sengledapi/sengledapi/devices/request.py", line 40, in get_response r = requests.post(self._url, headers=self._header, data=self._payload) File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 115, in post return request("post", url, data=data, json=json, kwargs) File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, kwargs) File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send r = adapter.send(request, kwargs) File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send resp = conn.urlopen( File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 398, in _make_request conn.request(method, url, httplib_request_kw) File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 239, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "/usr/local/lib/python3.10/http/client.py", line 1282, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.10/http/client.py", line 1293, in _send_request self.putrequest(method, url, skips) File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 219, in putrequest return HTTPConnection.putrequest(self, method, url, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/util/async.py", line 180, in protected_loop_func checkloop(func, strict=strict) File "/usr/src/homeassistant/homeassistant/util/async.py", line 168, in check_loop raise RuntimeError( RuntimeError: Blocking calls must be done in the executor or a separate thread; Use
await hass.async_add_executor_job()
; at custom_components/sengledapi/sengledapi/devices/request.py, line 40: r = requests.post(self._url, headers=self._header, data=self._payload) 2022-09-21 01:46:58.003 ERROR (MainThread) [homeassistant.components.ipp.coordinator] Error fetching ipp data: Invalid response from API: Timeout occurred while connecting to IPP server.