joeyhage / homebridge-alexa-smarthome

Connect Alexa devices to HomeKit
MIT License
82 stars 20 forks source link

Thermostat Functionality #56

Closed louis-test closed 8 months ago

louis-test commented 12 months ago

If thermostat is in Auto mode unable to set high/low comfort windows Unable to change device mode. If thermostat is in "Off" mode, thermostat shows as "offline" in homekit

Setup a new thermostat that has both heating and cooling functions. Place thermostat in "Auto" mode from Alexa App Attempt to change temperatures (or mode) in Home App

Temperature and Mode should change.

Logs:

[10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Obtained device states from cache [10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Thermostat - Get thermostat mode result: 3 [10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Obtained device states from cache [10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Thermostat - Get current temperature result: 22.6 [10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Obtained device states from cache [10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Thermostat - Get temperature units result: 1 [10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Obtained device states from cache [10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Thermostat - Get cooling temperature result: 25 [10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Obtained device states from cache [10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Thermostat - Get heating temperature result: 17.8 [10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Thermostat - Triggered set cooling temperature: 25 [10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Thermostat - Triggered set heating temperature: 17.2 [10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Thermostat - Triggered set heating temperature: 14.4 [10/9/2023, 5:59:55 PM] [HomebridgeAlexaSmartHome] Thermostat - Triggered set cooling temperature: 25

[10/9/2023, 5:55:36 PM] [HomebridgeAlexaSmartHome] Thermostat ::: Current state: [ { "namespace": "Alexa.ThermostatController.Schedule", "name": "scheduleEnabled", "value": true }, { "namespace": "Alexa.Energy.DemandResponseController", "name": "eventStatus", "value": { "eventId": "", "status": "NO_EVENT", "activeSignals": [] } }, { "namespace": "Alexa.EndpointHealth", "name": "connectivity", "value": { "value": "OK" } }, { "namespace": "Alexa.ThermostatController.Configuration", "name": "allowedTemperatureRange", "value": { "heating": { "minimum": { "value": 50, "scale": "FAHRENHEIT" }, "maximum": { "value": 87, "scale": "FAHRENHEIT" } }, "cooling": { "minimum": { "value": 53, "scale": "FAHRENHEIT" }, "maximum": { "value": 90, "scale": "FAHRENHEIT" } } } }, { "namespace": "Alexa.ThermostatController.Schedule", "name": "adaptiveRecoveryEnabled", "value": true }, { "namespace": "Alexa.ThermostatController.Configuration", "name": "temperatureScale", "value": "FAHRENHEIT" }, { "namespace": "Alexa.TemperatureSensor", "name": "preciseTemperature", "value": { "value": 72.4921875, "scale": "FAHRENHEIT" } }, { "namespace": "Alexa.HumiditySensor", "name": "relativeHumidity", "value": 43 }, { "namespace": "Alexa.ThermostatController", "name": "upperSetpoint", "value": { "value": 75, "scale": "FAHRENHEIT" } }, { "namespace": "Alexa.ThermostatController.HVAC.Components", "name": "coolerOperation", "value": "OFF" }, { "namespace": "Alexa.AutomationManagement", "name": "automationStatuses", "value": [ { "status": "AUTOMATED", "capability": "Alexa.ThermostatController" } ] }, { "namespace": "Alexa.ThermostatController", "name": "lowerSetpoint", "value": { "value": 68, "scale": "FAHRENHEIT" } }, { "namespace": "Alexa.ThermostatController", "name": "thermostatMode", "value": "AUTO" }, { "namespace": "Alexa.RangeController", "name": "rangeValue", "value": 3, "instance": "1" }, { "namespace": "Alexa.TemperatureSensor", "name": "temperature", "value": { "value": 72, "scale": "FAHRENHEIT" } }, { "namespace": "Alexa.ThermostatController", "name": "adaptiveRecoveryStatus", "value": "INACTIVE" }, { "namespace": "Alexa.ThermostatController.Configuration", "name": "setupState", "value": "REMOTE_CONTROL" }, { "namespace": "Alexa.ThermostatController.HVAC.Components", "name": "primaryHeaterOperation", "value": "OFF" }, { "namespace": "Alexa.RangeController", "name": "rangeValue", "value": 3, "instance": "2" }, { "namespace": "Alexa.RangeController", "name": "rangeValue", "value": 3, "instance": "3" }, { "namespace": "Alexa.RangeController", "name": "rangeValue", "value": 75, "instance": "8" }, { "namespace": "Alexa.RangeController", "name": "rangeValue", "value": 3, "instance": "6" }, { "namespace": "Alexa.RangeController", "name": "rangeValue", "value": 68, "instance": "7" }

[10/9/2023, 5:55:36 PM] [HomebridgeAlexaSmartHome] Thermostat ::: Attempting to add accessory(s) for device: { "id": "e7f7fcf6-1817-4245-8696-7f6220c7bdea", "displayName": "Thermostat", "description": "Amazon Smart Thermostat", "supportedProperties": [ "setTargetTemperature", "setRangeValue@e7f7fcf6-1817-4245-8696-7f6220c7bdea_1", "setRangeValue@e7f7fcf6-1817-4245-8696-7f6220c7bdea_2", "setModeValue@e7f7fcf6-1817-4245-8696-7f6220c7bdea_5" ], "supportedTriggers": [ "temperatureSensorTrigger" ], "supportedOperations": [ "setTargetTemperature", "setRangeValue@e7f7fcf6-1817-4245-8696-7f6220c7bdea_1", "setRangeValue@e7f7fcf6-1817-4245-8696-7f6220c7bdea_2", "setModeValue@e7f7fcf6-1817-4245-8696-7f6220c7bdea_5" ], "availability": "AVAILABLE", "icon": { "@iconType": "SmartHomeApplianceType", "value": "THERMOSTAT" }, "providerData": { "enabled": true, "relationships": [], "categoryType": "APPLIANCE", "deviceType": "THERMOSTAT", "dmsDeviceIdentifiers": [ { "deviceSerialNumber": "GD61M600213603AA", "deviceType": "A39QOBV8YPBZIY" } ] } }

Plugin Config:

Not applicable - straight forward.

Screenshots:

Not applicable - straight forward.

Environment:

louis-test commented 11 months ago

Sorry, i've looked through the code substantially and found most of my answers.

Currently "Set" Thermostat Mode is not implemented Currently "GetCurrentThermostatMode" is not implemented Setting Temperature in Auto Mode is using the wrong API

I'm far from a coder, but i've done my best to 'fix/add' these items. Unfortunately I don't know how to create my own plugin to test this, so if you can somehow create a test branch that I can install into homekit, I would be happy to test the modifications thoroughly.

I don't know if the modifications I made however will fix the "offline" issue when the thermostat is configured for Mode = Off

Also, yes i know i could create a pull request, but far from having the proper know-how. Appreciate it if you could manually take a look at my proposed changes!

temperature-mapper.txt thermostat-mapper.txt thermostat-accessory.txt

joeyhage commented 8 months ago

This should be fixed now as of v2.1.0 and further improved in v2.1.1.