homebridge-plugins / homebridge-resideo

The Homebridge Resideo plugin allows you to access your Resideo devices from HomeKit.
ISC License
37 stars 8 forks source link

Support Request: Automation failing to set thermostat heat point #777

Closed mnich0ls closed 1 year ago

mnich0ls commented 1 year ago

Describe Your Problem

I have a scene that sets two thermostats to certain heat points. Running that scene manually works just fine, but attempting to set the scene in an automation sets the wrong heat point

I'm running the latest beta with a minor change to always set the system to Heat mode for an experiment I was running https://github.com/mnich0ls/homebridge-resideo/tree/dev. I know I should probably run the same tests on the latest version (and not my development version), but I think there might be an actual timing bug here.

I set up some automations yesterday and tested them manually from my phone, and they were working just fine. However they failed to run correctly last night and this morning. I did further testing of the same automation (just running them at different times) and they continued to fail repeatedly.

Again, if I run the automation manually (e.g. "test this automation" from the Home app) they work just fine. I noticed a difference in the order of execution based on whether the automation runs normally (i.e. automatically as programmed) or manually. And looking at the functions that are called based on the logs, it does appear that the order matters. Called in the order of the "failing" logs below, the TargetTemperature will be set from this.device.changeableValues!.heatSetpoint instead, which would be incorrect at the time the function is called I believe (since the device's current changeable values would have the previous heat set-point).

Relevant log output

Order of successful execution of the automation:

[16/01/2023, 09:03:09] [Resideo] Thermostat: Upstairs Thermostat Set TargetHeatingCoolingState: 1
[16/01/2023, 09:03:09] [Resideo] Thermostat: Upstairs Thermostat Set TargetTemperature: 20
[16/01/2023, 09:03:09] [Resideo] Thermostat: Upstairs Thermostat Set HeatingThresholdTemperature: 20
[16/01/2023, 09:03:09] [Resideo] Thermostat: Upstairs Thermostat Set CoolingThresholdTemperature: 25.5
[16/01/2023, 09:03:09] [Resideo] Thermostat: Downstairs Thermostat Set TargetHeatingCoolingState: 1
[16/01/2023, 09:03:09] [Resideo] Thermostat: Downstairs Thermostat Set CoolingThresholdTemperature: 25.5
[16/01/2023, 09:03:09] [Resideo] Thermostat: Downstairs Thermostat Set TargetTemperature: 20
[16/01/2023, 09:03:09] [Resideo] Thermostat: Downstairs Thermostat Set HeatingThresholdTemperature: 20
[16/01/2023, 09:03:09] [Resideo] Thermostat Upstairs Thermostat API doesn't support Auto mode in settings update. Using mode Heat instead
[16/01/2023, 09:03:09] [Resideo] Thermostat: Upstairs Thermostat didn't send thermostatSetpointStatus, Model: Round

Order of failed execution of the same automation:

[16/01/2023, 09:08:02] [Resideo] Thermostat: Upstairs Thermostat Set TargetTemperature: 15.600000000000001
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat Set HeatingThresholdTemperature: 15.600000000000001
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat Set TargetTemperature: 15.600000000000001
[16/01/2023, 09:08:02] [Resideo] Thermostat: Upstairs Thermostat Set CoolingThresholdTemperature: 29.400000000000002
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat Set CoolingThresholdTemperature: 29.400000000000002
[16/01/2023, 09:08:02] [Resideo] Thermostat: Upstairs Thermostat Set HeatingThresholdTemperature: 15
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat Set TargetHeatingCoolingState: 1
[16/01/2023, 09:08:02] [Resideo] Thermostat: Upstairs Thermostat Set TargetHeatingCoolingState: 1
[16/01/2023, 09:08:02] [Resideo] Thermostat Downstairs Thermostat API doesn't support Auto mode in settings update. Using mode Heat instead
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat didn't send thermostatSetpointStatus, Model: Round
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat set autoChangeoverActive, Model: Round

Complete set of logs for successfull attempt:

[16/01/2023, 09:34:47] [Resideo] Thermostat: Upstairs Thermostat Set TargetHeatingCoolingState: 1
[16/01/2023, 09:34:47] [Resideo] Thermostat: Upstairs Thermostat Set TargetTemperature: 20
[16/01/2023, 09:34:47] [Resideo] Thermostat: Upstairs Thermostat Set CoolingThresholdTemperature: 25.5
[16/01/2023, 09:34:47] [Resideo] Thermostat: Upstairs Thermostat Set HeatingThresholdTemperature: 20
[16/01/2023, 09:34:47] [Resideo] Thermostat: Downstairs Thermostat Set TargetHeatingCoolingState: 1
[16/01/2023, 09:34:47] [Resideo] Thermostat: Downstairs Thermostat Set TargetTemperature: 20
[16/01/2023, 09:34:47] [Resideo] Thermostat: Downstairs Thermostat Set CoolingThresholdTemperature: 25.5
[16/01/2023, 09:34:47] [Resideo] Thermostat: Downstairs Thermostat Set HeatingThresholdTemperature: 20
[16/01/2023, 09:34:47] [Resideo] Thermostat Upstairs Thermostat API doesn't support Auto mode in settings update. Using mode Heat instead
[16/01/2023, 09:34:47] [Resideo] Thermostat: Upstairs Thermostat didn't send thermostatSetpointStatus, Model: Round
[16/01/2023, 09:34:47] [Resideo] Thermostat: Upstairs Thermostat set autoChangeoverActive, Model: Round
[16/01/2023, 09:34:47] [Resideo] Thermostat: Upstairs Thermostat Heating/cooling state not set to Auto for Model: Round, Using device setting autoChangeoverActive: false
[16/01/2023, 09:34:47] [Resideo] Thermostat: Upstairs Thermostat TargetHeatingCoolingState (HEAT): 1, TargetTemperature: 68 heatSetpoint, CoolingThresholdTemperature: 78 coolSetpoint
[16/01/2023, 09:34:47] [Resideo] Room Sensor Thermostat: Upstairs Thermostat set request ({"mode":"Heat","autoChangeoverActive":false,"heatSetpoint":68,"coolSetpoint":78}) to Resideo API.
[16/01/2023, 09:34:47] [Resideo] Thermostat Downstairs Thermostat API doesn't support Auto mode in settings update. Using mode Heat instead
[16/01/2023, 09:34:47] [Resideo] Thermostat: Downstairs Thermostat didn't send thermostatSetpointStatus, Model: Round
[16/01/2023, 09:34:47] [Resideo] Thermostat: Downstairs Thermostat set autoChangeoverActive, Model: Round
[16/01/2023, 09:34:47] [Resideo] Thermostat: Downstairs Thermostat Heating/cooling state not set to Auto for Model: Round, Using device setting autoChangeoverActive: false
[16/01/2023, 09:34:47] [Resideo] Thermostat: Downstairs Thermostat TargetHeatingCoolingState (HEAT): 1, TargetTemperature: 68 heatSetpoint, CoolingThresholdTemperature: 78 coolSetpoint
[16/01/2023, 09:34:47] [Resideo] Room Sensor Thermostat: Downstairs Thermostat set request ({"mode":"Heat","autoChangeoverActive":false,"heatSetpoint":68,"coolSetpoint":78}) to Resideo API.
[16/01/2023, 09:34:48] [Resideo] Thermostat: Downstairs Thermostat pushChanges: {"mode":"Heat","autoChangeoverActive":false,"heatSetpoint":68,"coolSetpoint":78}
[16/01/2023, 09:34:48] [Resideo] Thermostat: Upstairs Thermostat pushChanges: {"mode":"Heat","autoChangeoverActive":false,"heatSetpoint":68,"coolSetpoint":78}

Complete set of logs for failed attempt:

[16/01/2023, 09:08:02] [Resideo] Thermostat: Upstairs Thermostat Set TargetTemperature: 15.600000000000001
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat Set HeatingThresholdTemperature: 15.600000000000001
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat Set TargetTemperature: 15.600000000000001
[16/01/2023, 09:08:02] [Resideo] Thermostat: Upstairs Thermostat Set CoolingThresholdTemperature: 29.400000000000002
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat Set CoolingThresholdTemperature: 29.400000000000002
[16/01/2023, 09:08:02] [Resideo] Thermostat: Upstairs Thermostat Set HeatingThresholdTemperature: 15
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat Set TargetHeatingCoolingState: 1
[16/01/2023, 09:08:02] [Resideo] Thermostat: Upstairs Thermostat Set TargetHeatingCoolingState: 1
[16/01/2023, 09:08:02] [Resideo] Thermostat Downstairs Thermostat API doesn't support Auto mode in settings update. Using mode Heat instead
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat didn't send thermostatSetpointStatus, Model: Round
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat set autoChangeoverActive, Model: Round
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat Heating/cooling state not set to Auto for Model: Round, Using device setting autoChangeoverActive: false
[16/01/2023, 09:08:02] [Resideo] Thermostat: Downstairs Thermostat TargetHeatingCoolingState (HEAT): 1, TargetTemperature: 68 heatSetpoint, CoolingThresholdTemperature: 85 coolSetpoint
[16/01/2023, 09:08:02] [Resideo] Room Sensor Thermostat: Downstairs Thermostat set request ({"mode":"Heat","autoChangeoverActive":false,"heatSetpoint":68,"coolSetpoint":85}) to Resideo API.
[16/01/2023, 09:08:02] [Resideo] Thermostat Upstairs Thermostat API doesn't support Auto mode in settings update. Using mode Heat instead
[16/01/2023, 09:08:02] [Resideo] Thermostat: Upstairs Thermostat didn't send thermostatSetpointStatus, Model: Round
[16/01/2023, 09:08:02] [Resideo] Thermostat: Upstairs Thermostat set autoChangeoverActive, Model: Round
[16/01/2023, 09:08:02] [Resideo] Thermostat: Upstairs Thermostat Heating/cooling state not set to Auto for Model: Round, Using device setting autoChangeoverActive: false
[16/01/2023, 09:08:02] [Resideo] Thermostat: Upstairs Thermostat TargetHeatingCoolingState (HEAT): 1, TargetTemperature: 68 heatSetpoint, CoolingThresholdTemperature: 85 coolSetpoint
[16/01/2023, 09:08:02] [Resideo] Room Sensor Thermostat: Upstairs Thermostat set request ({"mode":"Heat","autoChangeoverActive":false,"heatSetpoint":68,"coolSetpoint":85}) to Resideo API.
[16/01/2023, 09:08:03] [Resideo] Thermostat: Downstairs Thermostat pushChanges: {"mode":"Heat","autoChangeoverActive":false,"heatSetpoint":68,"coolSetpoint":85}
[16/01/2023, 09:08:03] [Resideo] Thermostat: Upstairs Thermostat pushChanges: {"mode":"Heat","autoChangeoverActive":false,"heatSetpoint":68,"coolSetpoint":85}

### Config for homebridge-resideo

```shell
{
            "name": "Resideo",
            "credentials": {
                "consumerKey": "---",
                "consumerSecret": "---",
                "refreshToken": "---",
                "notice": "Keep your tokens a secret!"
            },
            "options": {
                "devices": [
                    {
                        "deviceID": "TCC-***",
                        "configDeviceName": "Downstairs Thermostat",
                        "deviceClass": "Thermostat",
                        "deviceModel": "Round",
                        "thermostat": {
                            "show_auto": false
                        },
                        "logging": "debug"
                    },
                    {
                        "deviceID": "TCC-***",
                        "configDeviceName": "Upstairs Thermostat",
                        "deviceClass": "Thermostat",
                        "deviceModel": "Round",
                        "thermostat": {
                            "show_auto": false
                        },
                        "logging": "debug"
                    }
                ],
                "logging": "debug"
            },
            "_bridge": {
                "username": "---",
                "port": 52674
            },
            "platform": "Resideo"
        }

Screenshots

No response

Device & Model

Round

Node.js Version

v18.12.1

NPM Version

8.19.2

Homebridge Version

1.6.0

Homebridge Resideo Plugin Version

v1.3.0-dev

Homebridge Config UI X Plugin Version

No response

Operating System

Raspbian GNU/Linux Bullseye (11)

mnich0ls commented 1 year ago

I forgot to include my question. Why do we set the TargetTemperature using this.device.changeableValues!.heatSetpoint in the function setTargetHeatingCoolingState? If I'm correct in my assumption, that's where the incorrect heat point is being set.

https://github.com/donavanbecker/homebridge-resideo/blob/latest/src/devices/thermostats.ts#L865

mnich0ls commented 1 year ago

I tested a change here on the dev branch I linked to above that seems to solve my specific problem, but I'm sure it has unintended consequences.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 1 year ago

This issue has been closed as no further activity has occurred.