core: evohome: water_heater.turn_on, water_heater.turn_off not working

The problem

I cannot get the hot water to turn on/off with the service call image image

Environment

Home Assistant 0.116.4

arch aarch64
chassis embedded
dev false
docker true
docker_version 19.03.12
hassio true
host_os HassOS 5.4
installation_type Home Assistant OS
os_name Linux
os_version 4.19.127-v8
python_version 3.8.5
supervisor 249
timezone Europe/London
version 0.116.4
virtualenv false

Problem-relevant configuration.yaml

evohome:
  username: !secret EvoHomeUserName
  password: !secret EvoHomePassword

Traceback/Error logs

2020-10-24 16:03:32 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.548354343312] 'EvoDHW' object has no attribute 'async_turn_on'

Additional information

Neither call seems to work

water_heater.turn_on
water_heater.turn_on
entity_id: entity_id: water_heater.dhw_controller

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 18 (8 by maintainers)

Most upvoted comments

Have the set_away_mode and set_operation_mode functions just stopped working for anyone else? The current state is read fine but neither of these functions work any more, they did two weeks ago.

This shoudl have been a separate issue - no bother, #50803 will fix this too.

OK, the code to add to evohome\water_heater.py is quite simple:

    async def async_turn_on(self):
        """Turn on."""
        await self._evo_broker.call_client_api(self._evo_device.set_dhw_on())

    async def async_turn_off(self):
        """Turn off."""
        await self._evo_broker.call_client_api(self._evo_device.set_dhw_off())

… but unfortunately, I’ve discovered a bug in the underlying client library, which will slow things down.

This is the relevant service call:

service: water_heater.turn_on
data: {entity_id: water_heater.dhw_controller}

… which gives:

2021-05-17 22:17:20 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'EvoDHW' object has no attribute 'async_turn_on'
Traceback (most recent call last):
   ...
  File "/home/dbonnes/home-assistant/homeassistant/helpers/service.py", line 689, in _handle_entity_call
    result = hass.async_run_job(partial(getattr(entity, func), **data))  # type: ignore
AttributeError: 'EvoDHW' object has no attribute 'async_turn_on'

I have now set up a test bed - will have a look in the next few days.

As a work around I’m using this to control my hot water with a new custom component https://github.com/watchforstock/evohome-client/blob/57d8c762540b15ee18ec450900fc00b03636446a/docs/source/api2/hotwater.rst

Have the set_away_mode and set_operation_mode functions just stopped working for anyone else? The current state is read fine but neither of these functions work any more, they did two weeks ago.

The base cause is multi-factorial: a) these service calls are not exposed (but they could/should? be), instead use: water_heater.set_operation_mode, and water_heater.set_away_mode b) there is no clear documentation in homeassistant.io for how to turning the water_heater on/off - this shoudl be added

water_heater.turn_on, water_heater.turn_off could easily be added to evohome

Note: setting evohome to away mode will also turn off the DHW: use:

- action:
    - service: evohome.set_system_mode
      data:
        mode: Away
        period: {days: 30}