joeyhage / homebridge-alexa-smarthome

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

Amazon Smart Thermostat #72

Closed biomir closed 10 months ago

biomir commented 10 months ago

Describe Your Problem:

Was able to successfully authenticate and load Amazon Smart Thermostat from Alexa and show current state (temp), however unable to control device with Homebridge.

Logs:

[14/11/2023, 13:14:51] [HomebridgeAlexaSmartHome] Thermostat Downstairs - Set target temperature - RequestUnsuccessful(Error setting smart home device state. Response: {
  "controlResponses": [],
  "errors": [
    {
      "entity": {
        "entityId": "b71d9598-058b-4867-9f62-6c4b0c04dec9",
        "entityType": "APPLIANCE"
      },
      "code": "IotaServiceException",
      "message": "IOTA_SERVICE_EXCEPTION",
      "data": null
    }
  ]
}. Error code: IotaServiceException)

Plugin Config:


{
            "devices": [
                "Thermostat Downstairs",
                "Thermostat Upstairs"
            ],
            "auth": {
                "refreshInterval": 4,
                "proxy": {
                    "clientHost": "homebridge.local",
                    "port": 9007
                }
            },
            "amazonDomain": "amazon.com",
            "language": "en-US",
            "performance": {
                "cacheTTL": 15,
                "backgroundRefresh": true
            },
            "debug": false,
            "platform": "HomebridgeAlexaSmartHome"
        }

Screenshots:

Environment:

biomir commented 10 months ago

To clarify: once thermostat is powered on via Alexa app, Homebridge is able to control temp settings up/down, but not able to turn on/off the device or switch function to cool/heat/auto.

bastianveiser commented 10 months ago

I have a similar issue where I can see my thermostats but can not control them. Turning them "on" does not change the fact that I can not control them in homekit.

Logs

[11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Obtained device states from cache [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Upstairs Thermostat - Get target temperature - DeviceOffline(ENDPOINT_UNREACHABLE) [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Upstairs Thermostat - Get temperature units result: 1 [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Obtained device states from cache [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Obtained device states from cache [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Upstairs Thermostat - Get heating temperature - DeviceOffline(ENDPOINT_UNREACHABLE) [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Upstairs Thermostat - Get thermostat mode result: 0 [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Obtained device states from cache [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Obtained device states from cache [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Upstairs Thermostat - Get cooling temperature - DeviceOffline(ENDPOINT_UNREACHABLE) [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Upstairs Thermostat - Get current temperature result: 22.8 [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Obtained device states from cache [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Downstairs Thermostat - Get thermostat mode result: 0 [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Obtained device states from cache [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Obtained device states from cache [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Downstairs Thermostat - Get heating temperature - DeviceOffline(ENDPOINT_UNREACHABLE) [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Downstairs Thermostat - Get current temperature result: 22.1 [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Obtained device states from cache [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Obtained device states from cache [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Downstairs Thermostat - Get cooling temperature - DeviceOffline(ENDPOINT_UNREACHABLE) [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Obtained device states from cache [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Downstairs Thermostat - Get target temperature - DeviceOffline(ENDPOINT_UNREACHABLE) [11/17/2023, 11:33:47 AM] [homebridge-alexa-smarthome] Downstairs Thermostat - Get temperature units result: 1

shenghan97 commented 10 months ago

I just looked through the codebase and it appears changing mode is not currently supported - there's no handler to set modes and it's being configured as a read-only property. Hope this can be supported soon!

thermostat-accessory.ts#L59C1-L64C10

this.service
  .getCharacteristic(this.platform.Characteristic.TargetHeatingCoolingState)
  .onGet(this.handleTargetStateGet.bind(this))
  .onSet(() => {
    throw this.readOnlyError;
  });
biomir commented 10 months ago

Thanks for that closer look into the source-code. For now, I just use seasonal extreme temps as set points to simulate an OFF output, so as to render this plugin 'usable' in creating homekit automation/scenes. Works but not ideal, since Alexa would need to keep thermostat permanently ON. Hope developer will issue update with debugged handlers for mode toggle/control.

zouma45 commented 10 months ago

@biomir added the support for thermostat control state, it should work in the next release (probably 2.0.4). Let me know if you encounter any issues once released.

joeyhage commented 10 months ago

@biomir @zouma45 2.0.4 was just released. Closing this issue but please open a new one if the issue persists.

biomir commented 9 months ago

Thanks for this latest update… but having issues configuring thermostat with this version: keep getting error with “Get Power-InvalidResponse (state not available)”. Then after attempts to uninstall plugin, clear cache, reboot HB server, successfully request Alexa cookies using different portal, etc… new set of bugs creeped in. Screenshot of log script attached below:Sent from my iPhoneOn Dec 8, 2023, at 9:36 PM, Joey Hage @.***> wrote: @biomir @zouma45 2.0.4 was just released. Closing this issue but please open a new one if the issue persists.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>