herikw / home-assistant-custom-components

Atag One Custom components for Home-Assistant
GNU General Public License v3.0
11 stars 5 forks source link

TypeError on my setup #2

Closed omannion closed 5 years ago

omannion commented 6 years ago

Hi,

I am getting this error in HA 77.2:

Error while setting up platform atagone

Traceback (most recent call last): File "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 143, in send_request resp = json.loads(result.read()) File "/usr/lib/python3.5/json/init.py", line 312, in loads s.class.name)) TypeError: the JSON object must be str, not 'bytes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=hass.loop) File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for return fut.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 "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 110, in setup_platform add_devices([AtagOneThermostat(config.get(CONF_NAME), config.get(CONF_HOST), config.get(CONF_PORT))]) File "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 131, in init self.update() File "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 257, in update resp = self.send_request(self, READ_PATH, jsonPayload) File "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 144, in send_request except HTTPError as ex: NameError: name 'HTTPError' is not defined

I am running on Raspian using venv.

herikw commented 6 years ago

Hi,

Was missing some library to display the HTTPerror. This has been fixed, please grab the latest version.

But it actually also means that there is some error in the communication with the ATAG thermostat.

Did you define the correct IP address in configuration.yaml?


Van: omannion notifications@github.com Verzonden: zaterdag 1 september 2018 15:38 Aan: herikw/home-assistant-custom-components CC: Subscribed Onderwerp: [herikw/home-assistant-custom-components] TypeError on my setup (#2)

Hi,

I am getting this error in HA 77.2:

Error while setting up platform atagone

Traceback (most recent call last): File "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 143, in send_request resp = json.loads(result.read()) File "/usr/lib/python3.5/json/init.py", line 312, in loads s.class.name)) TypeError: the JSON object must be str, not 'bytes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=hass.loop) File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for return fut.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 "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 110, in setup_platform add_devices([AtagOneThermostat(config.get(CONF_NAME), config.get(CONF_HOST), config.get(CONF_PORT))]) File "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 131, in init self.update() File "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 257, in update resp = self.send_request(self, READ_PATH, jsonPayload) File "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 144, in send_request except HTTPError as ex: NameError: name 'HTTPError' is not defined

I am running on Raspian using venv.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/herikw/home-assistant-custom-components/issues/2, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMt7ka_vRNdfDNIpQfYPY0zQ5Ix2WGLlks5uWo3sgaJpZM4WWOU9.

omannion commented 6 years ago

Yeh, it is still hanging on this

Error while setting up platform atagone

Traceback (most recent call last): File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=hass.loop) File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for return fut.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 "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 111, in setup_platform add_devices([AtagOneThermostat(config.get(CONF_NAME), config.get(CONF_HOST), config.get(CONF_PORT))]) File "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 132, in init self.update() File "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 259, in update resp = self.send_request(self, READ_PATH, jsonPayload) File "/home/homeassistant/.homeassistant/custom_components/climate/atagone.py", line 144, in send_request resp = json.loads(result.read()) File "/usr/lib/python3.5/json/init.py", line 312, in loads s.class.name)) TypeError: the JSON object must be str, not 'bytes'

My thermostat has a reserved IP so it never changes. I have confirmed the IP on the thermostat network settings. I can ping it from the HA host.

My config entry is copied from the example, I have only added the thermostat IP.

It is almost like the host information in configuration.yaml is not getting passed to the custom component.

omannion commented 5 years ago

Managed to get it working by downloading latest version and deleting line 154. Many thanks for developing this component.