joeyhage / homebridge-alexa-smarthome

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

Can't control Thermostat after updating to 2.0.4 #79

Closed nyirsh closed 6 months ago

nyirsh commented 6 months ago

Describe The Bug: After updating the plugin to v2.0.4 I can't control my Amazon Smart Thermostat anymore, rollbacking to v2.0.3 seems to fix the issue. Through the application the Thermostat appears as unreachable, the cached temperature is shown alongside a status message "No response". No matter what kind of update you do in the details screen it will revert back to its previously cached state.

To Reproduce:

Just update to v2.0.4 while using a regular "Amazon Smart Thermostat", Device and Manufactorer Software Version both "16975104", then check the Home app. The thermostat will appear greyed out as it was off (which is not), a "No response" label is shown and whatever you do it will revert back to it's OFF state in its details. I also tried removing the device from HB cache but it didn't change.

As soon as you revert back to plugin v2.0.3 everything appears to be working perfectly without changing anything else.

Expected behavior:

Logs:

[12/12/2023, 14:53:02] [homebridge-alexa-smarthome] Launched child bridge with PID 12956
[12/12/2023, 14:53:02] Registering platform 'homebridge-alexa-smarthome.HomebridgeAlexaSmartHome'
[12/12/2023, 14:53:02] [homebridge-alexa-smarthome] Loaded homebridge-alexa-smarthome v2.0.4 child bridge successfully
[12/12/2023, 14:53:02] Loaded 1 cached accessories from cachedAccessories.0E8E7FEBD75C.
[12/12/2023, 14:53:02] [homebridge-alexa-smarthome] Loading accessory from cache: Thermostat
[12/12/2023, 14:53:02] [homebridge-alexa-smarthome] Alexa-Remote: cookie was provided
[12/12/2023, 14:53:03] Homebridge v1.7.0 (HAP v0.11.1) (homebridge-alexa-smarthome) is running on port 53204.
[12/12/2023, 14:53:03] [homebridge-alexa-smarthome] Alexa-Remote: Authentication checked: true
[12/12/2023, 14:53:03] [homebridge-alexa-smarthome] Alexa-Remote: Change Base URL for API calls to na-api-alexa.amazon.com
[12/12/2023, 14:53:04] [homebridge-alexa-smarthome] Successfully authenticated Alexa account.
[12/12/2023, 14:53:04] [homebridge-alexa-smarthome] Found 1 devices connected to the current Alexa account.
[12/12/2023, 14:53:04] [homebridge-alexa-smarthome] BEGIN devices connected to Alexa account

 [
  {
    "displayName": "Thermostat",
    "deviceType": "THERMOSTAT"
  }
]

END devices connected to Alexa account
[12/12/2023, 14:53:04] [homebridge-alexa-smarthome] Found all 1 devices in plugin settings.
[12/12/2023, 14:53:04] [homebridge-alexa-smarthome] Updating device states
[12/12/2023, 14:53:04] [homebridge-alexa-smarthome] Thermostat ::: Attempting to add accessory(s) for device: {
  "id": "2aafd215-a3d1-4c3c-9193-baef63b85a5a",
  "displayName": "Thermostat",
  "description": "Amazon Smart Thermostat",
  "supportedProperties": [
    "setTargetTemperature",
    "setModeValue@2aafd215-a3d1-4c3c-9193-baef63b85a5a_5",
    "setRangeValue@2aafd215-a3d1-4c3c-9193-baef63b85a5a_1",
    "setRangeValue@2aafd215-a3d1-4c3c-9193-baef63b85a5a_2"
  ],
  "supportedTriggers": [
    "temperatureSensorTrigger"
  ],
  "supportedOperations": [
    "setTargetTemperature",
    "setModeValue@2aafd215-a3d1-4c3c-9193-baef63b85a5a_5",
    "setRangeValue@2aafd215-a3d1-4c3c-9193-baef63b85a5a_1",
    "setRangeValue@2aafd215-a3d1-4c3c-9193-baef63b85a5a_2"
  ],
  "availability": "AVAILABLE",
  "icon": {
    "@iconType": "SmartHomeApplianceType",
    "value": "THERMOSTAT"
  },
  "providerData": {
    "enabled": true,
    "relationships": [],
    "categoryType": "APPLIANCE",
    "deviceType": "THERMOSTAT",
    "dmsDeviceIdentifiers": [
      {
        "deviceSerialNumber": "REDACTED",
        "deviceType": "A39QOBV8YPBZIY"
      }
    ]
  }
}
[12/12/2023, 14:53:04] [homebridge-alexa-smarthome] Thermostat ::: Current state: [
  {
    "namespace": "Alexa.ThermostatController.Schedule",
    "name": "scheduleEnabled",
    "value": true
  },
  {
    "namespace": "Alexa.ThermostatController",
    "name": "targetSetpoint",
    "value": {
      "value": 60,
      "scale": "FAHRENHEIT"
    }
  },
  {
    "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": 64.859375,
      "scale": "FAHRENHEIT"
    }
  },
  {
    "namespace": "Alexa.HumiditySensor",
    "name": "relativeHumidity",
    "value": 32
  },
  {
    "namespace": "Alexa.ThermostatController.HVAC.Components",
    "name": "coolerOperation",
    "value": "OFF"
  },
  {
    "namespace": "Alexa.ThermostatController.HVAC.Components",
    "name": "fanOperation",
    "value": "OFF"
  },
  {
    "namespace": "Alexa.AutomationManagement",
    "name": "automationStatuses",
    "value": [
      {
        "status": "AUTOMATED",
        "capability": "Alexa.ThermostatController"
      }
    ]
  },
  {
    "namespace": "Alexa.ModeController",
    "name": "mode",
    "value": "2",
    "instance": "5"
  },
  {
    "namespace": "Alexa.ThermostatController",
    "name": "thermostatMode",
    "value": "HEAT"
  },
  {
    "namespace": "Alexa.RangeController",
    "name": "rangeValue",
    "value": 3,
    "instance": "1"
  },
  {
    "namespace": "Alexa.TemperatureSensor",
    "name": "temperature",
    "value": {
      "value": 65,
      "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"
  }
]
[12/12/2023, 14:53:04] [homebridge-alexa-smarthome] Thermostat ::: Range capabilities: {}
[12/12/2023, 14:53:04] [homebridge-alexa-smarthome] Restored existing accessory from cache: Thermostat
[12/12/2023, 14:53:07] [homebridge-alexa-smarthome] Obtained device states from cache
[12/12/2023, 14:53:07] [homebridge-alexa-smarthome] Thermostat - Get current temperature result: 18.3
[12/12/2023, 14:53:07] [homebridge-alexa-smarthome] Obtained device states from cache
[12/12/2023, 14:53:07] [homebridge-alexa-smarthome] Obtained device states from cache
[12/12/2023, 14:53:07] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)
[12/12/2023, 14:53:07] [homebridge-alexa-smarthome] Thermostat - Get temperature units result: 1
[12/12/2023, 14:53:07] [homebridge-alexa-smarthome] Obtained device states from cache
[12/12/2023, 14:53:07] [homebridge-alexa-smarthome] Thermostat - Get target temperature result: 15.6
[12/12/2023, 14:53:27] [homebridge-alexa-smarthome] Obtained device states from cache
[12/12/2023, 14:53:27] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)
[12/12/2023, 14:53:28] [homebridge-alexa-smarthome] Obtained device states from cache
[12/12/2023, 14:53:28] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)
[12/12/2023, 14:53:30] [homebridge-alexa-smarthome] Obtained device states from cache
[12/12/2023, 14:53:30] [homebridge-alexa-smarthome] Obtained device states from cache
[12/12/2023, 14:53:30] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)
[12/12/2023, 14:53:30] [homebridge-alexa-smarthome] Thermostat - Get target temperature result: 15.6
[12/12/2023, 14:53:30] [homebridge-alexa-smarthome] Obtained device states from cache
[12/12/2023, 14:53:30] [homebridge-alexa-smarthome] Thermostat - Get current temperature result: 18.3
[12/12/2023, 14:53:33] [homebridge-alexa-smarthome] Obtained device states from cache
[12/12/2023, 14:53:33] [homebridge-alexa-smarthome] Thermostat - Get current temperature result: 18.3
[12/12/2023, 14:53:33] [homebridge-alexa-smarthome] Obtained device states from cache
[12/12/2023, 14:53:33] [homebridge-alexa-smarthome] Thermostat - Get target temperature result: 15.6
[12/12/2023, 14:53:33] [homebridge-alexa-smarthome] Obtained device states from cache
[12/12/2023, 14:53:33] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[12/12/2023, 14:53:42] [homebridge-alexa-smarthome] Thermostat - Triggered set target temperature: 18.900000000000002

[12/12/2023, 14:53:50] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:53:50] [homebridge-alexa-smarthome] Thermostat - Get temperature units result: 1

[12/12/2023, 14:53:50] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:53:50] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[12/12/2023, 14:53:51] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:53:51] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[12/12/2023, 14:53:52] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:53:52] [homebridge-alexa-smarthome] Thermostat - Get current temperature result: 18.3

[12/12/2023, 14:53:52] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:53:52] [homebridge-alexa-smarthome] Thermostat - Get target temperature result: 18.9

[12/12/2023, 14:53:52] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:53:52] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:53:52] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[12/12/2023, 14:53:53] [homebridge-alexa-smarthome] Thermostat - Get temperature units result: 1

[12/12/2023, 14:53:55] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:53:55] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:53:55] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[12/12/2023, 14:53:55] [homebridge-alexa-smarthome] Thermostat - Get target temperature result: 18.9

[12/12/2023, 14:53:55] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:53:55] [homebridge-alexa-smarthome] Thermostat - Get current temperature result: 18.3

[12/12/2023, 14:53:55] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:53:55] [homebridge-alexa-smarthome] Thermostat - Get temperature units result: 1

[12/12/2023, 14:54:11] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:11] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:11] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[12/12/2023, 14:54:11] [homebridge-alexa-smarthome] Thermostat - Get current temperature result: 18.3

[12/12/2023, 14:54:11] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:11] [homebridge-alexa-smarthome] Thermostat - Get target temperature result: 18.9

[12/12/2023, 14:54:11] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:11] [homebridge-alexa-smarthome] Thermostat - Get temperature units result: 1

[12/12/2023, 14:54:15] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:15] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[12/12/2023, 14:54:16] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:16] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[12/12/2023, 14:54:18] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:18] [homebridge-alexa-smarthome] Thermostat - Get target temperature result: 18.9

[12/12/2023, 14:54:18] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:18] [homebridge-alexa-smarthome] Thermostat - Get temperature units result: 1

[12/12/2023, 14:54:18] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:18] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:18] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[12/12/2023, 14:54:18] [homebridge-alexa-smarthome] Thermostat - Get current temperature result: 18.3

[12/12/2023, 14:54:20] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:20] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:20] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[12/12/2023, 14:54:20] [homebridge-alexa-smarthome] Thermostat - Get target temperature result: 18.9

[12/12/2023, 14:54:20] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:20] [homebridge-alexa-smarthome] Thermostat - Get current temperature result: 18.3

[12/12/2023, 14:54:20] [homebridge-alexa-smarthome] Obtained device states from cache

[12/12/2023, 14:54:20] [homebridge-alexa-smarthome] Thermostat - Get temperature units result: 1

It is worth noting that, while collecting this logs, I tried to change the temperature on the Home app and always got DeviceOffline(ENDPOINT_UNREACHABLE) to appear in the logs after each attempt.

Plugin Config:

{
    "devices": [
        "Thermostat"
    ],
    "auth": {
        "refreshInterval": 4,
        "proxy": {
            "clientHost": "REDACTED",
            "port": REDACTED
        }
    },
    "amazonDomain": "amazon.com",
    "language": "en-US",
    "performance": {
        "cacheTTL": 300,
        "backgroundRefresh": true
    },
    "debug": true,
    "_bridge": {
        "username": "REDACTED",
        "port": 53204
    },
    "platform": "HomebridgeAlexaSmartHome"
}

Screenshots:

E3CCFAA5-6276-4A9F-A182-153956643899_1_201_a On v2.0.4

CF6171EB-953A-470C-B027-09148ACA644C_1_201_a As soon as I rollback to v2.0.3, no other changes applied

Environment:

louis-test commented 6 months ago

I also have the amazon smart thermostats and encountered the exact same issue. Rolling back to v2.0.3 also brings them back into configurable status. Happy to test things if you have any requests.

zouma45 commented 6 months ago

humm, worked fine on my thermostat , I ll check tonight to adjust the code based on the logs shared. I ll let you know once I update, in the meantime, can you fallback to 2.0.3

nyirsh commented 6 months ago

Yeah I've been staying on 2.0.3. If there's anything I can do to help just let me know

QuarterSwede commented 6 months ago

Same issue here. Same fix.

zouma45 commented 6 months ago

I created a PR to fix the issue, I don't have the device to test, but should be fine based on the logs shared :)

joeyhage commented 6 months ago

This issue should be fixed in 2.0.5

QuarterSwede commented 6 months ago

This issue should be fixed in 2.0.5

Still having No Response on 2.0.5. Going back to 2.0.3 immediately fixes the issue.

zouma45 commented 6 months ago

hey @QuarterSwede, thanks for testing, can you please share the logs ? I need to see them since I don't have your device.

zouma45 commented 6 months ago

@nyirsh can you please test on your side and share the logs if you still have issues ?

QuarterSwede commented 6 months ago

I have it running in a child bridge. Don't know if that's relevant.

[12/27/2023, 12:54:23 PM] [homebridge-alexa-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Target Heating Cooling State' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [12/27/2023, 12:54:23 PM] [homebridge-alexa-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Current Temperature' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [12/27/2023, 12:54:23 PM] [homebridge-alexa-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Target Temperature' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [12/27/2023, 12:54:23 PM] [homebridge-alexa-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Temperature Display Units' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [12/27/2023, 12:54:29 PM] [homebridge-alexa-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Target Heating Cooling State' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [12/27/2023, 12:54:29 PM] [homebridge-alexa-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Current Temperature' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [12/27/2023, 12:54:29 PM] [homebridge-alexa-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Target Temperature' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [12/27/2023, 12:54:29 PM] [homebridge-alexa-smarthome] This plugin slows down Homebridge. The read handler for the characteristic 'Temperature Display Units' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [12/27/2023, 3:55:45 PM] [homebridge-alexa-smarthome] Restarting child bridge... [12/27/2023, 3:55:45 PM] Got SIGTERM, shutting down child bridge process... [12/27/2023, 3:55:50 PM] [homebridge-alexa-smarthome] Child bridge process ended [12/27/2023, 3:55:50 PM] [homebridge-alexa-smarthome] Process Ended. Code: 143, Signal: null [12/27/2023, 3:55:57 PM] [homebridge-alexa-smarthome] Restarting Process... [12/27/2023, 3:55:57 PM] [homebridge-alexa-smarthome] Launched child bridge with PID 3605 [12/27/2023, 3:55:57 PM] Registering platform 'homebridge-alexa-smarthome.HomebridgeAlexaSmartHome' [12/27/2023, 3:55:57 PM] [homebridge-alexa-smarthome] Loaded homebridge-alexa-smarthome v2.0.5 child bridge successfully [12/27/2023, 3:55:57 PM] Loaded 1 cached accessories from cachedAccessories.0E633101DC02. [12/27/2023, 3:55:57 PM] [homebridge-alexa-smarthome] Loading accessory from cache: Thermostat [12/27/2023, 3:55:57 PM] Homebridge v1.7.0 (HAP v0.11.1) (homebridge-alexa-smarthome) is running on port 37870. [12/27/2023, 3:55:57 PM] [homebridge-alexa-smarthome] Failed to initialize connection to Alexa. - Error while checking Authentication: Error: getaddrinfo ENOTFOUND alexa.amazon.com [12/27/2023, 3:55:59 PM] [homebridge-alexa-smarthome] Restored existing accessory from cache: Thermostat [12/27/2023, 3:56:33 PM] [homebridge-alexa-smarthome] Launched child bridge with PID 3678 [12/27/2023, 3:56:33 PM] [homebridge-alexa-smarthome] Loaded homebridge-alexa-smarthome v2.0.5 child bridge successfully [12/27/2023, 3:56:33 PM] Registering platform 'homebridge-harmony.HarmonyHubWebSocket' [12/27/2023, 3:56:33 PM] [homebridge-alexa-smarthome] Loading accessory from cache: Thermostat [12/27/2023, 3:56:36 PM] [homebridge-alexa-smarthome] Restored existing accessory from cache: Thermostat [12/27/2023, 3:58:50 PM] [homebridge-alexa-smarthome] Restarting child bridge... [12/27/2023, 3:58:50 PM] Got SIGTERM, shutting down child bridge process... [12/27/2023, 3:58:55 PM] [homebridge-alexa-smarthome] Child bridge process ended [12/27/2023, 3:58:55 PM] [homebridge-alexa-smarthome] Process Ended. Code: 143, Signal: null [12/27/2023, 3:59:02 PM] [homebridge-alexa-smarthome] Restarting Process... [12/27/2023, 3:59:02 PM] [homebridge-alexa-smarthome] Launched child bridge with PID 3981 [12/27/2023, 3:59:02 PM] Registering platform 'homebridge-alexa-smarthome.HomebridgeAlexaSmartHome' [12/27/2023, 3:59:02 PM] [homebridge-alexa-smarthome] Loaded homebridge-alexa-smarthome v2.0.3 child bridge successfully [12/27/2023, 3:59:02 PM] Loaded 1 cached accessories from cachedAccessories.0E633101DC02. [12/27/2023, 3:59:02 PM] [homebridge-alexa-smarthome] Loading accessory from cache: Thermostat [12/27/2023, 3:59:02 PM] Homebridge v1.7.0 (HAP v0.11.1) (homebridge-alexa-smarthome) is running on port 37870. [12/27/2023, 3:59:03 PM] [homebridge-alexa-smarthome] Failed to initialize connection to Alexa. - Error while checking Authentication: Error: getaddrinfo ENOTFOUND alexa.amazon.com [12/27/2023, 3:59:04 PM] [homebridge-alexa-smarthome] Restored existing accessory from cache: Thermostat

QuarterSwede commented 6 months ago

Still having the same issue after 2.0.6. No response.

nyirsh commented 6 months ago

@zouma45 Sorry, I wasn't home for a bit and I couldn't test. I can confirm that the update did not fix the issue. Here are the updated logs:

[31/12/2023, 19:54:38] Registering platform 'homebridge-alexa-smarthome.HomebridgeAlexaSmartHome'
[31/12/2023, 19:54:38] [homebridge-alexa-smarthome] Loaded homebridge-alexa-smarthome v2.0.6 child bridge successfully
[31/12/2023, 19:54:38] Loaded 1 cached accessories from cachedAccessories.0E8E7FEBD75C.
[31/12/2023, 19:54:38] [homebridge-alexa-smarthome] Loading accessory from cache: Thermostat
[31/12/2023, 19:54:38] [homebridge-alexa-smarthome] Alexa-Remote: cookie was provided
[31/12/2023, 19:54:38] [homebridge-alexa-smarthome] Alexa-Remote: former registration data exist, try refresh
[31/12/2023, 19:54:38] [homebridge-alexa-smarthome] Alexa-Cookie: Refresh Token
[31/12/2023, 19:54:38] Homebridge v1.7.0 (HAP v0.11.1) (homebridge-alexa-smarthome) is running on port 53204.
[31/12/2023, 19:54:38] [homebridge-alexa-smarthome] Alexa-Cookie: Response (200)
[31/12/2023, 19:54:38] [homebridge-alexa-smarthome] Refresh Token Response: REDACTED
[31/12/2023, 19:54:38] [homebridge-alexa-smarthome] Alexa-Cookie: Exchange tokens for amazon.com
[31/12/2023, 19:54:39] [homebridge-alexa-smarthome] Alexa-Cookie: Response (200)
… Removing Login to Alexa logs, it worked just fine …
[31/12/2023, 19:54:40] [homebridge-alexa-smarthome] Alexa-Remote: Authentication checked: true
[31/12/2023, 19:54:40] [homebridge-alexa-smarthome] Alexa-Remote: Change Base URL for API calls to na-api-alexa.amazon.com
[31/12/2023, 19:54:41] [homebridge-alexa-smarthome] Successfully authenticated Alexa account.
[31/12/2023, 19:54:42] [homebridge-alexa-smarthome] Found 1 devices connected to the current Alexa account.
[31/12/2023, 19:54:42] [homebridge-alexa-smarthome] BEGIN devices connected to Alexa account

 [
  {
    "displayName": "Thermostat",
    "deviceType": "THERMOSTAT"
  }
]

END devices connected to Alexa account
[31/12/2023, 19:54:42] [homebridge-alexa-smarthome] Found all 1 devices in plugin settings.
[31/12/2023, 19:54:42] [homebridge-alexa-smarthome] Updating device states
[31/12/2023, 19:54:42] [homebridge-alexa-smarthome] Thermostat ::: Attempting to add accessory(s) for device: {
  "id": "2aafd215-a3d1-4c3c-9193-baef63b85a5a",
  "displayName": "Thermostat",
  "description": "Amazon Smart Thermostat",
  "supportedProperties": [
    "setTargetTemperature",
    "setModeValue@2aafd215-a3d1-4c3c-9193-baef63b85a5a_5",
    "setRangeValue@2aafd215-a3d1-4c3c-9193-baef63b85a5a_1",
    "setRangeValue@2aafd215-a3d1-4c3c-9193-baef63b85a5a_2"
  ],
  "supportedTriggers": [
    "temperatureSensorTrigger"
  ],
  "supportedOperations": [
    "setTargetTemperature",
    "setModeValue@2aafd215-a3d1-4c3c-9193-baef63b85a5a_5",
    "setRangeValue@2aafd215-a3d1-4c3c-9193-baef63b85a5a_1",
    "setRangeValue@2aafd215-a3d1-4c3c-9193-baef63b85a5a_2"
  ],
  "availability": "AVAILABLE",
  "icon": {
    "@iconType": "SmartHomeApplianceType",
    "value": "THERMOSTAT"
  },
  "providerData": {
    "enabled": true,
    "relationships": [],
    "categoryType": "APPLIANCE",
    "deviceType": "THERMOSTAT",
    "dmsDeviceIdentifiers": [
      {
        "deviceSerialNumber": “REDACTED”,
        "deviceType": "A39QOBV8YPBZIY"
      }
    ]
  }
}
[31/12/2023, 19:54:42] [homebridge-alexa-smarthome] Thermostat ::: Current state: [
  {
    "namespace": "Alexa.ThermostatController.Schedule",
    "name": "scheduleEnabled",
    "value": true
  },
  {
    "namespace": "Alexa.ThermostatController",
    "name": "targetSetpoint",
    "value": {
      "value": 60,
      "scale": "FAHRENHEIT"
    }
  },
  {
    "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": 59.484375,
      "scale": "FAHRENHEIT"
    }
  },
  {
    "namespace": "Alexa.HumiditySensor",
    "name": "relativeHumidity",
    "value": 40
  },
  {
    "namespace": "Alexa.ThermostatController.HVAC.Components",
    "name": "coolerOperation",
    "value": "OFF"
  },
  {
    "namespace": "Alexa.ThermostatController.HVAC.Components",
    "name": "fanOperation",
    "value": "STAGE_1"
  },
  {
    "namespace": "Alexa.AutomationManagement",
    "name": "automationStatuses",
    "value": [
      {
        "status": "AUTOMATED",
        "capability": "Alexa.ThermostatController"
      }
    ]
  },
  {
    "namespace": "Alexa.ModeController",
    "name": "mode",
    "value": "2",
    "instance": "5"
  },
  {
    "namespace": "Alexa.ThermostatController",
    "name": "thermostatMode",
    "value": "HEAT"
  },
  {
    "namespace": "Alexa.RangeController",
    "name": "rangeValue",
    "value": 3,
    "instance": "1"
  },
  {
    "namespace": "Alexa.TemperatureSensor",
    "name": "temperature",
    "value": {
      "value": 60,
      "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": "STAGE_1"
  },
  {
    "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"
  }
]
[31/12/2023, 19:54:42] [homebridge-alexa-smarthome] Thermostat ::: Range capabilities: {}
[31/12/2023, 19:54:42] [homebridge-alexa-smarthome] Restored existing accessory from cache: Thermostat

[31/12/2023, 19:55:11] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:11] [homebridge-alexa-smarthome] Thermostat - Get target temperature result: 15.6

[31/12/2023, 19:55:11] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:11] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:11] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[31/12/2023, 19:55:11] [homebridge-alexa-smarthome] Thermostat - Get temperature units result: 1

[31/12/2023, 19:55:11] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:11] [homebridge-alexa-smarthome] Thermostat - Get current temperature result: 15.3

[31/12/2023, 19:55:11] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:11] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[31/12/2023, 19:55:22] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:22] [homebridge-alexa-smarthome] Thermostat - Get temperature units result: 1

[31/12/2023, 19:55:22] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:22] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:22] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[31/12/2023, 19:55:22] [homebridge-alexa-smarthome] Thermostat - Get target temperature result: 15.6

[31/12/2023, 19:55:22] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:22] [homebridge-alexa-smarthome] Thermostat - Get current temperature result: 15.3

[31/12/2023, 19:55:29] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:29] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[31/12/2023, 19:55:30] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:30] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[31/12/2023, 19:55:32] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:32] [homebridge-alexa-smarthome] Thermostat - Get target temperature result: 15.6

[31/12/2023, 19:55:32] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:32] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:32] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[31/12/2023, 19:55:32] [homebridge-alexa-smarthome] Thermostat - Get current temperature result: 15.3

[31/12/2023, 19:55:32] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:32] [homebridge-alexa-smarthome] Thermostat - Get temperature units result: 1

[31/12/2023, 19:55:34] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:34] [homebridge-alexa-smarthome] Thermostat - Get target temperature result: 15.6

[31/12/2023, 19:55:34] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:34] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:34] [homebridge-alexa-smarthome] Thermostat - Get power - DeviceOffline(ENDPOINT_UNREACHABLE)

[31/12/2023, 19:55:34] [homebridge-alexa-smarthome] Thermostat - Get temperature units result: 1

[31/12/2023, 19:55:34] [homebridge-alexa-smarthome] Obtained device states from cache

[31/12/2023, 19:55:34] [homebridge-alexa-smarthome] Thermostat - Get current temperature result: 15.3

[31/12/2023, 19:58:41] [homebridge-alexa-smarthome] Updating device states
QuarterSwede commented 6 months ago

2.0.8 fixed it. Thank you! 🙏

joeyhage commented 6 months ago

Thank you, @nyirsh!

louis-test commented 6 months ago

2.0.8 allows mode setting from homekit with Alexa Thermostats, but does not read back the current mode correctly.

Steps to reproduce. 1.) Press center button on thermostat (changes mode or turns off thermostat)

This is the error that will be thrown if the temperature is attempted to be changed while the thermostat is 'off' via external control (alexa or button press). Note, this level of 'off' is equivalent to setting 'off' via Homekit, but the issue lies in Homekit not detecting the thermostats current state.

The thermostat can be turned back on via homekit by toggling the thermostat mode to 'off' and then 'heat' but this is not intuitive an should not be required.

_[1/2/2024, 10:59:33 AM] [HomebridgeAlexaSmartHome] Office Thermostat - Triggered set target temperature: 18.3 [1/2/2024, 10:59:33 AM] [HomebridgeAlexaSmartHome] Office Thermostat - Set target temperature - RequestUnsuccessful(Error setting smart home device state. Response: { "controlResponses": [], "errors": [ { "entity": { "entityId": "4f8bfb05-bfc4-4adc-9d2d-2b9420fb2b8c", "entityType": "APPLIANCE" }, "code": "IotaServiceException", "message": "IOTA_SERVICEEXCEPTION", "data": null } ] }. Error code: IotaServiceException)