Kane610 / deconz

Python library wrapping deconz rest api for home-assistant
MIT License
47 stars 16 forks source link

Handle more errors #89

Open Kane610 opened 3 years ago

Kane610 commented 3 years ago

https://community.home-assistant.io/t/solved-how-do-i-get-danfoss-ally-thermostat-exposed-in-ha-from-deconz/244598/29

2020-11-28 13:24:32 DEBUG (MainThread) [pydeconz.gateway] Sending "put" "{'mode': 'off'}" to "172.30.33.0 /sensors/30/config" 2020-11-28 13:24:32 DEBUG (MainThread) [pydeconz.gateway] HTTP request response: [{'error': {'address': '/sensors/30/config/mode', 'description': 'parameter, mode, not available', 'type': 6}}] 2020-11-28 13:24:32 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139702468536832] /sensors/30/config/mode parameter, mode, not available Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1451, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1486, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 499, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 664, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 536, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/deconz/climate.py", line 115, in async_set_hvac_mode await self._device.async_set_config(data) File "/usr/local/lib/python3.8/site-packages/pydeconz/deconzdevice.py", line 30, in async_set_config await self.async_set(field, data) File "/usr/local/lib/python3.8/site-packages/pydeconz/api.py", line 112, in async_set await self._request("put", field, json=data) File "/usr/local/lib/python3.8/site-packages/pydeconz/gateway.py", line 106, in request _raise_on_error(response) File "/usr/local/lib/python3.8/site-packages/pydeconz/gateway.py", line 220, in _raise_on_error raise_error(data["error"]) File "/usr/local/lib/python3.8/site-packages/pydeconz/errors.py", line 58, in raise_error raise cls("{} {}".format(error["address"], error["description"])) pydeconz.errors.RequestError: /sensors/30/config/mode parameter, mode, not available

Kane610 commented 2 years ago

When sending a http request to the light/action endpoint I get the response: 503 Server Error: Service Unavailable for url: http://localhost:80/api/F4CF203485/groups/1/action/ [{"error":{"address":"/groups/1/action","description":"Not connected","type":950}}]

I send: HTTP PUT /api/F4CF203485/groups/1/action/ {'hue': 0, 'sat': 0, 'transitiontime': 1, 'effect': 'none'} I have 20 tradfri rgb lights connected, and they show up on phoscon

Kane610 commented 2 years ago

image https://github.com/home-assistant/core/issues/68165 Resolved by https://github.com/home-assistant/core/pull/71082