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

Bug: Unable to control the heating/cooling setting on Honeywell Lyric Round Wi-Fi Thermostat #554

Closed mowens closed 3 years ago

mowens commented 3 years ago

Describe The Bug

Unable to control the heating/cool status [OFF, HEAT, COOL] on a lyric round wi-fi thermostat. The plugin is providing a 'Target Heating Cooling State' of 3 (which I believe stands for AUTO) which is outside of the supported values from the HomeKit spec for air conditioners

To Reproduce

  1. Configure Honeywell account and setup thermostats as described by the plugin
  2. From HomeKit, attempt to change the heating cooling status

Expected behavior

The heating cooling status should change but doesn't. Seems like looks like the plugin does not the correct heat/cool mode via the logs {"mode":"Auto","autoChangeoverActive":true,"heatSetpoint":70,"coolSetpoint":78,"heatCoolMode":"Cool"}. Round thermostat is returning Auto mode which is not in allowedModes but source isn't checking the specialMode which is required for the Round thermostat to allow 'Auto' mode

Relevant log output

[9/12/2021, 8:03:57 AM] [HoneywellHome] Launched child bridge with PID 23215
[9/12/2021, 8:03:57 AM] Registering platform 'homebridge-honeywell-home.HoneywellHome'
[9/12/2021, 8:03:57 AM] [HoneywellHome] Loaded homebridge-honeywell-home v10.0.1 child bridge successfully
[9/12/2021, 8:03:57 AM] Loaded 2 cached accessories from cachedAccessories.0EA672B2A602.
[9/12/2021, 8:03:57 AM] [HoneywellHome] Finished initializing platform: HoneywellHome
[9/12/2021, 8:03:57 AM] [HoneywellHome] Using Default Refresh Rate.
[9/12/2021, 8:03:57 AM] [HoneywellHome] Using Default Push Rate.
[9/12/2021, 8:03:57 AM] [HoneywellHome] Config OK
[9/12/2021, 8:03:57 AM] [HoneywellHome] Loading accessory from cache: Downstairs Thermostat Thermostat
[9/12/2021, 8:03:57 AM] [HoneywellHome] Loading accessory from cache: Upstairs Thermostat Thermostat
Preparing Advertiser for 'HoneywellHome 0DC9' using bonjour-hap backend!
[9/12/2021, 8:03:57 AM] [HoneywellHome] Executed didFinishLaunching callback
Starting to advertise 'HoneywellHome 0DC9' using bonjour-hap backend!
[9/12/2021, 8:03:57 AM] Homebridge v1.3.4 (HoneywellHome) is running on port 41654.
[9/12/2021, 8:03:58 AM] [HoneywellHome] Got access token: <removed>
[9/12/2021, 8:03:58 AM] [HoneywellHome] New refresh token: <removed>
[9/12/2021, 8:03:58 AM] [HoneywellHome] Homebridge config.json has been updated with new refresh token.
[9/12/2021, 8:03:58 AM] [HoneywellHome] Total Locations Found: 1
[9/12/2021, 8:03:58 AM] [HoneywellHome] Total Devices Found at 25 Lustre Street : 2
[9/12/2021, 8:03:58 AM] [HoneywellHome] Restoring existing accessory from cache: Downstairs Thermostat Thermostat DeviceID: TCC-5978628
[9/12/2021, 8:03:58 AM] [HoneywellHome] Thermostat Downstairs Thermostat Thermostat Heat - Device is Currently:  0
[9/12/2021, 8:03:58 AM] [HoneywellHome] Thermostat Downstairs Thermostat Thermostat - Device is in "Cool" mode
[9/12/2021, 8:03:58 AM] [HoneywellHome] Thermostat Downstairs Thermostat Thermostat - [ 'Cool', 'Heat', 'Off' ]
[9/12/2021, 8:03:58 AM] [HoneywellHome] Thermostat Downstairs Thermostat Thermostat - Only Show These Modes: [2,1,0]
[9/12/2021, 8:03:58 AM] [HoneywellHome] Removing service
[9/12/2021, 8:03:58 AM] [HoneywellHome] Adding service
[9/12/2021, 8:03:58 AM] [HoneywellHome] Thermostat UDID: Downstairs Thermostat-TCC-5978628-Round
[9/12/2021, 8:03:58 AM] [HoneywellHome] Restoring existing accessory from cache: Upstairs Thermostat Thermostat DeviceID: TCC-5978636
[9/12/2021, 8:03:58 AM] [HoneywellHome] Thermostat Upstairs Thermostat Thermostat Heat - Device is Currently:  0
[9/12/2021, 8:03:58 AM] [HoneywellHome] Thermostat Upstairs Thermostat Thermostat - Device is in "Cool" mode
[9/12/2021, 8:03:58 AM] [HoneywellHome] Thermostat Upstairs Thermostat Thermostat - [ 'Cool', 'Heat', 'Off' ]
[9/12/2021, 8:03:58 AM] [HoneywellHome] Thermostat Upstairs Thermostat Thermostat - Only Show These Modes: [2,1,0]
[9/12/2021, 8:03:58 AM] [HoneywellHome] Removing service
[9/12/2021, 8:03:58 AM] [HoneywellHome] Adding service
[9/12/2021, 8:03:58 AM] [HoneywellHome] Thermostat UDID: Upstairs Thermostat-TCC-5978636-Round
[9/12/2021, 8:04:25 AM] [HoneywellHome] Thermostat Downstairs Thermostat Thermostat - Set TargetHeatingCoolingState: 2
[9/12/2021, 8:04:25 AM] [HoneywellHome] thermostatSetpointStatus not sent for Round Thermostats
[9/12/2021, 8:04:25 AM] [HoneywellHome] Round
[9/12/2021, 8:04:25 AM] [HoneywellHome] Round/D6 set autoChangeoverActive
[9/12/2021, 8:04:25 AM] [HoneywellHome] Round
[9/12/2021, 8:04:25 AM] [HoneywellHome] Sending request for Downstairs Thermostat Thermostat to Honeywell API. mode: Cool coolSetpoint: 78 heatSetpoint: 70 thermostatSetpointStatus: PermanentHold
[9/12/2021, 8:04:25 AM] [HoneywellHome] Thermostat Downstairs Thermostat Thermostat pushChanges - {"mode":"Cool","autoChangeoverActive":true,"coolSetpoint":78,"heatSetpoint":70}
[9/12/2021, 8:04:27 AM] [HoneywellHome] Thermostat Downstairs Thermostat Thermostat - Fetched update for Downstairs Thermostat from Honeywell API: {"mode":"Auto","autoChangeoverActive":true,"heatSetpoint":70,"coolSetpoint":78,"heatCoolMode":"Cool"}
[9/12/2021, 8:04:27 AM] [HoneywellHome] Thermostat Downstairs Thermostat Thermostat Heat - Device is Currently:  0
[9/12/2021, 8:04:27 AM] [homebridge-honeywell-home] This plugin generated a warning from the characteristic 'Target Heating Cooling State': characteristic value 3 is not contained in valid values array. See https://git.io/JtMGR for more info.
[9/12/2021, 8:04:27 AM] [homebridge-honeywell-home] Error: 
    at TargetHeatingCoolingState.Characteristic.characteristicWarning (/Users/mike/.nvm/versions/node/v16.9.1/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2038:105)
    at TargetHeatingCoolingState.Characteristic.validateUserInput (/Users/mike/.nvm/versions/node/v16.9.1/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1955:16)
    at TargetHeatingCoolingState.Characteristic.updateValue (/Users/mike/.nvm/versions/node/v16.9.1/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1379:20)
    at Thermostat.Service.updateCharacteristic (/Users/mike/.nvm/versions/node/v16.9.1/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:465:35)
    at Thermostats.updateHomeKitCharacteristics (/Users/mike/.nvm/versions/node/v16.9.1/lib/node_modules/homebridge-honeywell-home/src/devices/thermostats.ts:655:20)
    at Thermostats.refreshStatus (/Users/mike/.nvm/versions/node/v16.9.1/lib/node_modules/homebridge-honeywell-home/src/devices/thermostats.ts:403:12)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Thermostats.pushChanges (/Users/mike/.nvm/versions/node/v16.9.1/lib/node_modules/homebridge-honeywell-home/src/devices/thermostats.ts:546:5)
    at /Users/mike/.nvm/versions/node/v16.9.1/lib/node_modules/homebridge-honeywell-home/src/devices/thermostats.ts:256:11

Config for homebridge-honeywell-home

{
            "name": "HoneywellHome",
            "credentials": {
                "consumerKey": "<removed>",
                "consumerSecret": "<removed>",
                "accessToken": "<removed>",
                "refreshToken": "<removed>"
            },
            "options": {
                "thermostat": {
                    "hide_fan": true,
                    "thermostatSetpointStatus": "PermanentHold"
                },
                "roompriority": {
                    "priorityType": "PickARoom"
                }
            },
            "platform": "HoneywellHome",
            "_bridge": {
                "username": "0E:A6:72:B2:A6:02",
                "port": 41654
            }
        }

Screenshots

IMG_9C8CD26C5994-1

Device & Model

Honeywell Round

Node.js Version

16.9.1

NPM Version

7.21.1

Homebridge Version

1.3.4

Homebridge Honeywell Home Plugin Version

10.0.1

Homebridge Config UI X Plugin Version

4.41.2

Operating System

macOS

mowens commented 3 years ago

Looking at the logs and the source code it would appear that the "allowed modes" doesn't contain the "Auto" feature (https://github.com/donavanbecker/homebridge-honeywell-home/blob/latest/src/devices/thermostats.ts#L852) but the thermostat does actually support 'Auto'.

IMG_8C0045C4AC0A-1

The response back puts the thermostat into mode: Auto where the heatCoolMode: Cool`

{"mode":"Auto","autoChangeoverActive":true,"heatSetpoint":70,"coolSetpoint":78,"heatCoolMode":"Cool"}

Looking at the Honeywell Thermo API docs the Round needs to also check the specialMode not just allowedModes

https://developer.honeywellhome.com/lyric/apis/get/devices/thermostats/%7BdeviceId%7D-0

Screen Shot 2021-09-12 at 12 30 08 PM Screen Shot 2021-09-12 at 12 30 29 PM

My guess here is that the autoChangeoverActive should be treated as 'Auto' mode allowed for the Round thermostat

donavanbecker commented 3 years ago

@mowens Can you submit a pull request?

mowens commented 3 years ago

I certainly can. Mind providing setup details so I can verify my changes?

donavanbecker commented 3 years ago

@mowens I use visual studio code, and test with watch script.

mowens commented 3 years ago

Here ya go:

https://github.com/donavanbecker/homebridge-honeywell-home/pull/558

donavanbecker commented 3 years ago

@mowens Can you try the latest beta?

mowens commented 3 years ago

@donavanbecker Beta works great. I noticed that the plugin version and the latest release notes was out of sync tho. Based on your last commit the beta version should be 10.1.0 (which would make sense with the addition of the debug logging). The package version on the beta branch was actually 10.0.1. Fixed it for ya here:

https://github.com/donavanbecker/homebridge-honeywell-home/pull/559

donavanbecker commented 3 years ago

@mowens, I usually let us GitHub actions version it for me when releasing betas. Once I push this to the latest branch and publish the release then it will be synced up with the release notes.

If I have time today. I will release 10.1.0

donavanbecker commented 3 years ago

v10.1.0 has been released.