MTrab/danfoss_ally

Can't control Thermostats

Closed this issue · 9 comments

Environment:

  • Home Assistant version: 2022.10.2. I had the same issue on 2022.9 where I installed ally for the first time
  • danfoss_ally version: v1.0.7
  • Operation system: HAOS, Running on "Home Assistant Blue"

Describe the bug

I can't control the thermostats from the integration where I get the following error
AttributeError: 'AllyConnector' object has no attribute 'setMode'

Debug log

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/danfoss_ally/climate.py:181
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 8:24:00 AM (1 occurrences)
Last logged: 8:24:00 AM

[281472329747904] 'AllyConnector' object has no attribute 'setMode'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 202, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1738, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 207, in handle_service
await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 931, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 513, in async_set_preset_mode
await self.hass.async_add_executor_job(self.set_preset_mode, preset_mode)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/danfoss_ally/climate.py", line 181, in set_preset_mode
self._ally.setMode(self._device_id, mode)
AttributeError: 'AllyConnector' object has no attribute 'setMode'

I just noticed it should be fixed in 1.0.7 #21
I wonder why I get the issue as I do run 1.0.7

cat /config/custom_components/danfoss_ally/manifest.json
{ "codeowners": [ "@MTrab" ], "config_flow": true, "documentation": "https://github.com/MTrab/danfoss_ally/blob/master/README.md", "domain": "danfoss_ally", "iot_class": "cloud_polling", "issue_tracker": "https://github.com/MTrab/danfoss_ally/issues", "name": "Danfoss Ally", "requirements": [ "pydanfossally==0.0.26" ], "version": "v1.0.7" }

If I download the 1.0.7 file as a release package it contains "SetMode" and not "set_mode".
Seems like the 1.0.7 artifact is incorrect?
https://github.com/MTrab/danfoss_ally/releases

Yes, the source code does not reflect the changes from PR #21

I have confirmed that it works if I point HACS directly to master

MTrab commented

As I'm thinking of pulling the plug on this integration (as Danfoss are not interested in helping document how to link dev and app accounts) there will be no new updates for now.

If Danfoss (or someone else for that matter) can document how to link app and dev accounts, then I might reconsider - but for now, no new updates/releases.

I have also just sent a request to Danfoss. They must soon begin supporting their own products and services! It probably doesn't help but if more and more people complain, they might realize the need for more support.

@MTrab I am sad to hear as really like the plugin and am using it actively as I do not want my heating to depended on HA by integrating the thermostats without the Gateway.
I will try to write Danfoss as well to see if that could help.
About this issue, I think it is basically because the 1.0.7 artifact does not contain the correct code. Could I persuade you to update the 1.0.7 artifact with the correct code?

Thanks for the work you did on this plugin!

MTrab commented

Should be fixed with 1.1.0

@MTrab
I can confirm it works. Thank you for the effort