jfarmer08 / ha-sengledapi

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.
Apache License 2.0
104 stars 34 forks source link

Invalid config #52

Closed VDP07 closed 2 years ago

VDP07 commented 2 years ago

Sengled has been work perfectly until today after i restart HA. the notification pop up that This can not be set up and the following show in my log file. Please advise. .

Logger: homeassistant.setup Source: util/async_.py:140 First occurred: 15:23:27 (1 occurrences) Last logged: 15:23:27

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.9/site-packages/aiohttp/client_reqrep.py", line 1097, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html', 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 254, 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.9/site-packages/requests/api.py", line 117, in post return request('post', url, data=data, json=json, kwargs) File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, kwargs) File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 394, in _make_request conn.request(method, url, httplib_request_kw) File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 239, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "/usr/local/lib/python3.9/http/client.py", line 1279, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.9/http/client.py", line 1290, in _send_request self.putrequest(method, url, skips) File "/usr/local/lib/python3.9/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 151, in protected_loop_func checkloop() File "/usr/src/homeassistant/homeassistant/util/async.py", line 140, in check_loop raise RuntimeError( RuntimeError: I/O must be done in the executor; 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)

jgreenhaw69 commented 2 years ago

I think it was Sengled. Mine dropped too but are back up. Couldn't even access my lights from the app so it had to be server side.

VDP07 commented 2 years ago

I think it was Sengled. Mine dropped too but are back up. Couldn't even access my lights from the app so it had to be server side.

I'm afraid so. Thanks. Everything back online.