krocat / ToonHA

Home-Assistant component for Toon by Eneco

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error while setting thermostat setpoint from Siri on Apple Watch

mlowijs opened this issue · comments

While setting the temperature of Toon through Siri on my Apple Watch, the following error pops up in my hass logs:

2017-11-16 22:08:11 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/lib/python3.6/asyncio/tasks.py", line 182, in _step result = coro.throw(exc) File "/opt/hass/lib/python3.6/site-packages/homeassistant/core.py", line 1038, in _event_to_service_call yield from service_handler.func(service_call) File "/opt/hass/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 399, in async_operation_set_service yield from climate.async_set_operation_mode(operation_mode) File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__ yield self # This tells Task to wait for completion. File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup future.result() File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result raise self._exception File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/home/hass/.homeassistant/custom_components/climate/toon.py", line 91, in set_operation_mode self.thermos.set_state(toonlib_values[operation_mode]) KeyError: 'auto'

(view full log snippet here)

If I comment out the offending line 91, the error obviously doesn't show
up, and Siri/HomeKit seems to react much faster to my command

I'm using the latest version of ToonHA (cloned from GitHub).

Thanks for reporting this and making the stack trace more readable! Siri seems to want to tell Toon to go into a mode called "auto", but that's not a mode Toon supports. When exactly does this error show up?

I take it that by removing the line the Toon will also stop updating the program on the thermostat?

The error shows up if I give the voice command Siri, set the thermostat to xx degrees, regardless of the current setpoint or program Toon is in.

I think the mode switching is something that HomeKit/Homebridge does. The following log messages show up in Homebridge when I set a temperature/give the above voice command:

[11/16/2017, 10:36:52 PM] [HomeAssistant] fetching Current Heating Cooling state for: Thermostaat
[11/16/2017, 10:36:53 PM] [HomeAssistant] Setting temperature on the 'Thermostaat' to 16
[11/16/2017, 10:36:54 PM] [HomeAssistant] Successfully set temperature of 'Thermostaat'
[11/16/2017, 10:36:55 PM] [HomeAssistant] Setting Current Heating Cooling state on the 'Thermostaat' to auto
[11/16/2017, 10:36:55 PM] [HomeAssistant] Successfully set current heating cooling state of 'Thermostaat'

I'm not sure why it is trying to do that mode switch.

HomeKit allows you to set one of the following modes on a thermostat: off, auto, heat or cool.
I think these can be safely ignored by ToonHA?

I created a pull request ( #19 ) to work around this issue.

Pull request merged, thanks!