Skip to content

No retry or queue mechanism when setMode() fails despite API being connected #77

@simondsmason

Description

@simondsmason

Issue Description

I ran into a weird issue this morning. I came downstairs and it was cold. My Ecobee was off when it should have been on. When I checked the logs I see that the attempt to change mode to heat failed.

Looking at the code I noticed that when setMode() fails to change the thermostat mode (e.g., from 'off' to 'heat'), the driver and parent app do not implement any retry mechanism or queue the failed command for later execution. The failure is logged but no corrective action is taken, leaving the thermostat in an incorrect state with no automatic recovery.

Steps to Reproduce

  1. Thermostat is in 'off' mode
  2. setThermostatMode('heat') is called
  3. Parent app's setMode() sends API request to Ecobee
  4. API request fails (returns non-zero status code, but API connection is still 'full')
  5. setMode() returns false to driver
  6. Driver logs error and sets changed = false
  7. No retry is attempted
  8. No queueing occurs (queueing only happens if API is not fully connected)
  9. Calling app/controller receives no indication that the command failed
  10. Thermostat remains in incorrect state

Options would be to update the driver to include a retry mechanism. And/or add in pushover or something to indicate that the API had not done what it was told to do?

Also this brought up a second issue of sending set points out when the system is not in a mode to receive it which I will post separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions