nielsfaber / zoned-heating

Integration for multi-zone climate control
37 stars 9 forks source link

Debug when misbehaving #5

Closed a8ree closed 1 year ago

a8ree commented 1 year ago

Hi Niels I really like this integration - its great and is just what I was looking for. I am using this to control eight zones with my Nest for the past couple of weeks.

Periodically I have some issues where either the boiler doesn't turn off or when it turns on isn't at a high enough temperature. Can you tell me how I can debug and understand what is going wrong?

Thanks!

nielsfaber commented 1 year ago

Good to hear you like this integration! It's made very basic and only tested for my own use-case, so it might need some adaptations to be more versatile. I'd be happy to help if you require some changes.

I think the best first step for debugging is to take a look at the history of your climate devices. I would look at the following things:

You can also enable debug logging for the zoned heating component by adding this to the configuration.yaml:

  default: warning
  logs:
    custom_components.zoned_heating: debug

This change requires restarting HA. Afterwards you should be able to read back all actions performed by the integration via the HA logs.

Please share your findings!

a8ree commented 1 year ago

Hi Niels

Thanks for getting back to me. I will put in place the debug and will keep an eye out for it misbehaving and will let you know what I find out.

Many thanks!

a8ree commented 1 year ago

Hi Niels

I'm wondering whether you might be able to point me in the direction of why this call is failing

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/nest/climate_sdm.py", line 314, in async_set_temperature
    await trait.set_heat(temp)
  File "/usr/local/lib/python3.10/site-packages/google_nest_sdm/thermostat_traits.py", line 147, in set_heat
    return await self._cmd.execute(data)
  File "/usr/local/lib/python3.10/site-packages/google_nest_sdm/traits.py", line 32, in execute
    return await self._auth.post(f"{self._device_id}:executeCommand", json=data)
  File "/usr/local/lib/python3.10/site-packages/google_nest_sdm/auth.py", line 105, in post
    return await AbstractAuth._raise_for_status(resp)
  File "/usr/local/lib/python3.10/site-packages/google_nest_sdm/auth.py", line 129, in _raise_for_status
    raise ApiException(": ".join(detail)) from err
google_nest_sdm.exceptions.ApiException: Error from API: 400: FAILED_PRECONDITION: sdm.devices.commands.ThermostatTemperatureSetpoint.SetHeat command not allowed in current thermostat mode.: Bad Request

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/zoned_heating/switch.py", line 193, in async_zone_state_changed
    await self.async_calculate_override()
  File "/config/custom_components/zoned_heating/switch.py", line 228, in async_calculate_override
    await self.async_start_override_mode(temperature_increase)
  File "/config/custom_components/zoned_heating/switch.py", line 255, in async_start_override_mode
    await self.async_update_override_setpoint(temperature_increase)
  File "/config/custom_components/zoned_heating/switch.py", line 315, in async_update_override_setpoint
    await async_set_temperature(self.hass, self._controller_entity, new_setpoint)
  File "/config/custom_components/zoned_heating/util.py", line 105, in async_set_temperature
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1755, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1792, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, 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 958, 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 613, in async_service_temperature_set
    await entity.async_set_temperature(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/nest/climate_sdm.py", line 316, in async_set_temperature
    raise HomeAssistantError(f"Error setting HVAC mode: {err}") from err
homeassistant.exceptions.HomeAssistantError: Error setting HVAC mode: Error from API: 400: FAILED_PRECONDITION: sdm.devices.commands.ThermostatTemperatureSetpoint.SetHeat command not allowed in current thermostat mode.: Bad Request
2023-01-27 06:42:17.007 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/google_nest_sdm/auth.py", line 124, in _raise_for_status
    resp.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://smartdevicemanagement.googleapis.com/v1/enterprises/8b3fee4b-334b-4072-8838-c003c1d43ebf/devices/AVPHwEtaiI4TrGvIPG5z95mjUt0tvVgEO6JrU6Qi6uj9W-3_mSdBM6FP1MvDVns8zCo5w7pbYPPpZN6XgZCEIS-Q5I-Frw:executeCommand')

Zoned heating was turned on by an automation this morning and it turned the heating on (Nest) - successfully

I realised when I got downstairs that the Nest was off. It looks like the call to the Nest is periodically not working?

nielsfaber commented 1 year ago

Closing old issues (please let me know if help is still needed).