joeyhage / homebridge-alexa-smarthome

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

Danfoss Link Thermostat is recognized as a temperature Sensor #68

Open patrickkuhl opened 8 months ago

patrickkuhl commented 8 months ago

Describe The Bug:

Hi joeyhage,

I have eleven thermostats (Danfoss Link System) connected to Alexa and they are working fine (you can find four of them in the screenshot below under favorites). These thermostats are the only devices I control via Alexa. All my other smarthome stuff is controlled via HomeKit. I wanted to use your plugin to transfer these thermostats to HomeKit. Unfortunately, the plugin recognizes them as temperature sensors. Have I done something wrong or is it a bug? Maybe there is one thing. The mode of the thermostats is not changeable in Alexa. The mode is always „Benutzerdefiniert“, in English „custom“.

Best regards,

Patrick

To Reproduce:

Expected behavior:

Logs:

[04/11/2023, 15:22:50] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution
[04/11/2023, 15:22:50] [HB Supervisor] Started Homebridge v1.7.0 with PID: 8077
[04/11/2023, 15:22:51] Loaded config.json with 4 accessories and 6 platforms.
[04/11/2023, 15:22:51] Loaded 12 cached accessories from cachedAccessories.
[04/11/2023, 15:22:51] ---
[04/11/2023, 15:22:52] Loaded plugin: homebridge-alexa-smarthome@2.0.1
[04/11/2023, 15:22:52] Registering platform 'homebridge-alexa-smarthome.HomebridgeAlexaSmartHome'
[04/11/2023, 15:22:52] ---
[04/11/2023, 15:22:52] Loaded plugin: homebridge-deconz@1.0.6
[04/11/2023, 15:22:52] Registering platform 'homebridge-deconz.deCONZ'
[04/11/2023, 15:22:52] ---
[04/11/2023, 15:22:52] Loaded plugin: homebridge-dummy@0.9.0
[04/11/2023, 15:22:52] Registering accessory 'homebridge-dummy.DummySwitch'
[04/11/2023, 15:22:52] ---
[04/11/2023, 15:22:52] Loaded plugin: homebridge-eveatmo@1.1.0
[04/11/2023, 15:22:52] Registering platform 'homebridge-eveatmo.eveatmo'
[04/11/2023, 15:22:52] ---
[04/11/2023, 15:22:52] Loaded plugin: homebridge-harmony@1.6.3
[04/11/2023, 15:22:52] Registering platform 'homebridge-harmony.HarmonyHubWebSocket'
[04/11/2023, 15:22:52] ---
[04/11/2023, 15:22:52] Loaded plugin: homebridge-shelly-switch@0.3.0
[04/11/2023, 15:22:52] Registering platform 'homebridge-shelly-switch.Shelly Switch'
[04/11/2023, 15:22:52] ---
[04/11/2023, 15:22:52] Loading 6 platforms...
[04/11/2023, 15:22:52] [Warmwasser] Initializing Shelly Switch platform...
[04/11/2023, 15:22:52] [Wetterstation] Initializing eveatmo platform...
[04/11/2023, 15:22:52] [Wetterstation] Authenticating using 'refresh_token' grant
[04/11/2023, 15:22:55] [Wetterstation] Loading new data from API for: weatherstation
[04/11/2023, 15:22:55] [deCONZ] Initializing deCONZ platform...
[04/11/2023, 15:22:55] [deCONZ] homebridge-deconz v1.0.6, node v18.16.0, homebridge v1.7.0, homebridge-lib v6.6.4
[04/11/2023, 15:22:55] [deCONZ] warning: recommended version: node v20.9.0
[04/11/2023, 15:22:55] [deCONZ] warning: recommended version: homebridge v1.6.1
[04/11/2023, 15:22:55] [HarmonyHub] Initializing HarmonyHubWebSocket platform...
[04/11/2023, 15:22:55] [HarmonyHub] HarmonyPlatform Init
[04/11/2023, 15:22:55] [HomebridgeAlexaSmartHome] Initializing HomebridgeAlexaSmartHome platform...
[04/11/2023, 15:22:55] Loading 4 accessories...
[04/11/2023, 15:22:55] [Fenstersensor] Initializing DummySwitch accessory...
[04/11/2023, 15:22:55] [Fenstersensor] Setting switch to false
[04/11/2023, 15:22:55] [WW Danfoss] Initializing DummySwitch accessory...
[04/11/2023, 15:22:55] [WW Danfoss] Setting switch to false
[04/11/2023, 15:22:55] [WW Timer 10 Minuten] Initializing DummySwitch accessory...
[04/11/2023, 15:22:55] [WW Timer 10 Minuten] Setting switch to false
[04/11/2023, 15:22:55] [Jemand zuhause] Initializing DummySwitch accessory...
[04/11/2023, 15:22:55] [Jemand zuhause] Setting switch to true
[04/11/2023, 15:22:55] [deCONZ] Phoscon-GW: dresden elektronik deCONZ / ConBee II gateway v2.24.1
[04/11/2023, 15:22:55] [deCONZ] Phoscon-GW: warning: recommended version: deCONZ v2.23.2
[04/11/2023, 15:22:55] [HarmonyHub] DidFinishLaunching
[04/11/2023, 15:22:55] [HarmonyHub] (HarmonyHub)INFO - Loading activities...
[04/11/2023, 15:22:55] [HarmonyHub] (undefined)WARNING - platform undefined is empty
[04/11/2023, 15:22:55] [HarmonyHub] INFO - starting hub discovery
[04/11/2023, 15:22:55] [HomebridgeAlexaSmartHome] Alexa-Remote: cookie was provided
[04/11/2023, 15:22:56] [deCONZ] hardware: Raspberry Pi 4B 1.4 (8GB)
[04/11/2023, 15:22:56] [deCONZ] os: Raspbian GNU/Linux 11 (bullseye) [32 bit]
[04/11/2023, 15:22:56] [deCONZ] restored 3 accessories from cache
[04/11/2023, 15:22:56] [deCONZ] ui server: listening on http://127.0.0.1:43333/
[04/11/2023, 15:22:56] [HomebridgeAlexaSmartHome] Alexa-Remote: Authentication checked: true
[04/11/2023, 15:22:56] Initializing platform accessory 'Walküre (Wohnzimmer) Wohnzimmer'...
[04/11/2023, 15:22:56] Initializing platform accessory 'Walküre (Wohnzimmer) Hobbyraum'...
[04/11/2023, 15:22:56] Initializing platform accessory 'Walküre (Wohnzimmer) Außen'...
Setup Payload:
X-HM://0023YKLJ1BGMN
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ 296-28-413 │     
    └────────────┘     

[04/11/2023, 15:22:56] Homebridge v1.7.0 (HAP v0.11.1) (Homebridge A981) is running on port XYZXY.
[04/11/2023, 15:22:56] [HomebridgeAlexaSmartHome] Alexa-Remote: Change Base URL for API calls to eu-api-alexa.amazon.de
[04/11/2023, 15:22:57] [deCONZ] Phoscon-GW: websocket connected to ws://XYZ.XYZ.XYZ.XY:
[04/11/2023, 15:22:57] [HomebridgeAlexaSmartHome] Successfully authenticated Alexa account.
[04/11/2023, 15:22:57] [HomebridgeAlexaSmartHome] Found 11 devices connected to the current Alexa account.
[04/11/2023, 15:22:57] [HomebridgeAlexaSmartHome] BEGIN devices connected to Alexa account

 [
  {
    "displayName": "EG Wohnen",
    "deviceType": "TEMPERATURE_SENSOR"
  },
  {
    "displayName": "OG Kind",
    "deviceType": "TEMPERATURE_SENSOR"
  },
  {
    "displayName": "UG Bad",
    "deviceType": "TEMPERATURE_SENSOR"
  },
  {
    "displayName": "OG Bad",
    "deviceType": "TEMPERATURE_SENSOR"
  },
  {
    "displayName": "UG Gast",
    "deviceType": "TEMPERATURE_SENSOR"
  },
  {
    "displayName": "EG HWR",
    "deviceType": "TEMPERATURE_SENSOR"
  },
  {
    "displayName": "OG Bad HK",
    "deviceType": "TEMPERATURE_SENSOR"
  },
  {
    "displayName": "EG Flur",
    "deviceType": "TEMPERATURE_SENSOR"
  },
  {
    "displayName": "OG Arbeit",
    "deviceType": "TEMPERATURE_SENSOR"
  },
  {
    "displayName": "OG Schlafen",
    "deviceType": "TEMPERATURE_SENSOR"
  },
  {
    "displayName": "EG WC",
    "deviceType": "TEMPERATURE_SENSOR"
  }
]

END devices connected to Alexa account
[04/11/2023, 15:22:57] [HomebridgeAlexaSmartHome] 0 devices provided in settings but 11 matching Alexa smart home devices were discovered.
[04/11/2023, 15:22:57] [HomebridgeAlexaSmartHome] Updating device states
[04/11/2023, 15:22:57] [HarmonyHub] (HarmonyHub)INFO - Discovered Activity : PowerOff
[04/11/2023, 15:22:57] [HarmonyHub] (HarmonyHub)INFO - Discovered Activity : Radio Charivari
[04/11/2023, 15:22:57] [HarmonyHub] (HarmonyHub)INFO - Discovered Activity : Fernsehen
[04/11/2023, 15:22:57] [HarmonyHub] (HarmonyHub)INFO - Discovered Activity : Apple TV
[04/11/2023, 15:22:57] [HarmonyHub] (HarmonyHub)INFO - Discovered Activity : Spielen
[04/11/2023, 15:22:57] [HarmonyHub] (HarmonyHub)INFO - Discovered Activity : Radio Bayern 3
[04/11/2023, 15:22:57] [HarmonyHub] (HarmonyHub)INFO - Discovered Activity : Radio Antenne Bayern
[04/11/2023, 15:22:57] [HarmonyHub] (HarmonyHub)INFO - Discovered Activity : Musik streamen
[04/11/2023, 15:22:58] [deCONZ] Phoscon-GW: warning: BJ Wandsender 1: exposed by draft ddf
[04/11/2023, 15:22:58] [deCONZ] Phoscon-GW: BJ Wandsender 1: add accessory
[04/11/2023, 15:22:58] [deCONZ] BJ Wandsender 1: Busch-Jaeger RB01 v0.0.0 (4 resources)
[04/11/2023, 15:22:58] [deCONZ] Phoscon-GW: warning: BJ Wandsender 2: exposed by draft ddf
[04/11/2023, 15:22:58] [deCONZ] Phoscon-GW: BJ Wandsender 2: add accessory
[04/11/2023, 15:22:58] [deCONZ] BJ Wandsender 2: Busch-Jaeger RB01 v0.0.0 (4 resources)
[04/11/2023, 15:22:58] [deCONZ] Phoscon-GW: dresden elektronik deCONZ / ConBee II gateway v2.24.1 (2 accessories for 6 devices, 8 resources)
[04/11/2023, 15:22:58] [deCONZ] Phoscon-GW: warning: recommended version: deCONZ v2.23.2
[04/11/2023, 15:22:58] [deCONZ] Phoscon-GW: migration: /resourcelinks/1: 8 resources
[04/11/2023, 15:22:58] [deCONZ] 1 gateways
[04/11/2023, 15:22:58] [deCONZ] created debug dump file /var/lib/homebridge/homebridge-deconz.json.gz
[04/11/2023, 15:22:59] [HomebridgeAlexaSmartHome] Initialize Devices - UnsupportedDeviceError(Unsupported device: EG Wohnen with type: TEMPERATURE_SENSOR. Currently supported device types are: LIGHT,SWITCH,SMARTLOCK,SMARTPLUG,THERMOSTAT,ALEXA_VOICE_ENABLED,AIR_QUALITY_MONITOR.)
[04/11/2023, 15:22:59] [HomebridgeAlexaSmartHome] Initialize Devices - UnsupportedDeviceError(Unsupported device: OG Kind with type: TEMPERATURE_SENSOR. Currently supported device types are: LIGHT,SWITCH,SMARTLOCK,SMARTPLUG,THERMOSTAT,ALEXA_VOICE_ENABLED,AIR_QUALITY_MONITOR.)
[04/11/2023, 15:22:59] [HomebridgeAlexaSmartHome] Initialize Devices - UnsupportedDeviceError(Unsupported device: UG Bad with type: TEMPERATURE_SENSOR. Currently supported device types are: LIGHT,SWITCH,SMARTLOCK,SMARTPLUG,THERMOSTAT,ALEXA_VOICE_ENABLED,AIR_QUALITY_MONITOR.)
[04/11/2023, 15:22:59] [HomebridgeAlexaSmartHome] Initialize Devices - UnsupportedDeviceError(Unsupported device: OG Bad with type: TEMPERATURE_SENSOR. Currently supported device types are: LIGHT,SWITCH,SMARTLOCK,SMARTPLUG,THERMOSTAT,ALEXA_VOICE_ENABLED,AIR_QUALITY_MONITOR.)
[04/11/2023, 15:22:59] [HomebridgeAlexaSmartHome] Initialize Devices - UnsupportedDeviceError(Unsupported device: UG Gast with type: TEMPERATURE_SENSOR. Currently supported device types are: LIGHT,SWITCH,SMARTLOCK,SMARTPLUG,THERMOSTAT,ALEXA_VOICE_ENABLED,AIR_QUALITY_MONITOR.)
[04/11/2023, 15:22:59] [HomebridgeAlexaSmartHome] Initialize Devices - UnsupportedDeviceError(Unsupported device: EG HWR with type: TEMPERATURE_SENSOR. Currently supported device types are: LIGHT,SWITCH,SMARTLOCK,SMARTPLUG,THERMOSTAT,ALEXA_VOICE_ENABLED,AIR_QUALITY_MONITOR.)
[04/11/2023, 15:22:59] [HomebridgeAlexaSmartHome] Initialize Devices - UnsupportedDeviceError(Unsupported device: OG Bad HK with type: TEMPERATURE_SENSOR. Currently supported device types are: LIGHT,SWITCH,SMARTLOCK,SMARTPLUG,THERMOSTAT,ALEXA_VOICE_ENABLED,AIR_QUALITY_MONITOR.)
[04/11/2023, 15:22:59] [HomebridgeAlexaSmartHome] Initialize Devices - UnsupportedDeviceError(Unsupported device: EG Flur with type: TEMPERATURE_SENSOR. Currently supported device types are: LIGHT,SWITCH,SMARTLOCK,SMARTPLUG,THERMOSTAT,ALEXA_VOICE_ENABLED,AIR_QUALITY_MONITOR.)
[04/11/2023, 15:22:59] [HomebridgeAlexaSmartHome] Initialize Devices - UnsupportedDeviceError(Unsupported device: OG Arbeit with type: TEMPERATURE_SENSOR. Currently supported device types are: LIGHT,SWITCH,SMARTLOCK,SMARTPLUG,THERMOSTAT,ALEXA_VOICE_ENABLED,AIR_QUALITY_MONITOR.)
[04/11/2023, 15:22:59] [HomebridgeAlexaSmartHome] Initialize Devices - UnsupportedDeviceError(Unsupported device: OG Schlafen with type: TEMPERATURE_SENSOR. Currently supported device types are: LIGHT,SWITCH,SMARTLOCK,SMARTPLUG,THERMOSTAT,ALEXA_VOICE_ENABLED,AIR_QUALITY_MONITOR.)
[04/11/2023, 15:22:59] [HomebridgeAlexaSmartHome] Initialize Devices - UnsupportedDeviceError(Unsupported device: EG WC with type: TEMPERATURE_SENSOR. Currently supported device types are: LIGHT,SWITCH,SMARTLOCK,SMARTPLUG,THERMOSTAT,ALEXA_VOICE_ENABLED,AIR_QUALITY_MONITOR.)
[04/11/2023, 15:23:01] [HarmonyHub] INFO - stopping hub discovery, hubs found : 192.168.178.25|Harmony Hub|17095773

Plugin Config:

{
    "bridge": {
        "name": "Homebridge A981",
        "username": "0E:24:41:4A:A9:81",
        "port": XYZXY,
        "pin": "[296-28-413](tel:296-28-413)",
        "advertiser": "avahi"
    },
    "accessories": [
        {
            "name": "Fenstersensor",
            "stateful": true,
            "dimmer": false,
            "reverse": false,
            "time": 10000,
            "random": false,
            "resettable": false,
            "brightness": 0,
            "disableLogging": false,
            "accessory": "DummySwitch"
        },
        {
            "name": "WW Danfoss",
            "stateful": true,
            "dimmer": false,
            "reverse": false,
            "time": 1000,
            "random": false,
            "resettable": false,
            "brightness": 0,
            "disableLogging": false,
            "accessory": "DummySwitch"
        },
        {
            "name": "WW Timer 10 Minuten",
            "stateful": true,
            "dimmer": false,
            "reverse": false,
            "time": 1000,
            "random": false,
            "resettable": false,
            "brightness": 0,
            "disableLogging": false,
            "accessory": "DummySwitch"
        },
        {
            "name": "Jemand zuhause",
            "stateful": true,
            "dimmer": false,
            "reverse": false,
            "time": 1000,
            "random": false,
            "resettable": false,
            "brightness": 0,
            "disableLogging": false,
            "accessory": "DummySwitch"
        }
    ],
    "platforms": [
        {
            "name": "Config",
            "port": XYZY,
            "platform": "config"
        },
        {
            "platform": "Shelly Switch",
            "name": "Warmwasser",
            "notification_port": XYZXY,
            "devices": [
                {
                    "name": "WW Pumpenrelais",
                    "ip": "XYZ.XYZ.XYZ.XY",
                    "authetification": "xyzxyzxyz"
                }
            ]
        },
        {
            "name": "Wetterstation",
            "ttl": 540,
            "extra_co2_sensor": false,
            "weatherstation": true,
            "airquality": false,
            "co2_alert_threshold": 2000,
            "log_info_msg": true,
            "auth": {
                "client_id": "XYZXYZ",
                "client_secret": "XYZXYZXYZ,
                "grant_type": "refresh_token",
                "refresh_token": "XYZXYZ"
            },
            "platform": "eveatmo"
        },
        {
            "name": "deCONZ",
            "platform": "deCONZ"
        },
        {
            "name": "HarmonyHub",
            "hubIP": "XYZ.XYZ.XYZ.XY",
            "DELAY_BEFORE_RETRY_AFTER_NETWORK_LOSS": 60000,
            "HUB_CONNECT_TIMEOUT": 10000,
            "HUB_SEND_TIMEOUT": 30000,
            "TVAccessory": false,
            "sortInput": 0,
            "switchAccessories": true,
            "showTurnOffActivity": "inverted",
            "otherPlatforms": [
                {
                    "TVAccessory": false,
                    "sortInput": 0
                }
            ],
            "platform": "HarmonyHubWebSocket"
        },
        {
            "devices": [],
            "auth": {
                "refreshInterval": 4,
                "proxy": {
                    "clientHost": "homebridge.local",
                    "port": 9000
                }
            },
            "amazonDomain": "amazon.de",
            "language": "de-DE",
            "performance": {
                "cacheTTL": 30,
                "backgroundRefresh": false
            },
            "debug": true,
            "platform": "HomebridgeAlexaSmartHome"
        }
    ]
}

Screenshots: image

Environment:

MortenLue commented 8 months ago

I just tried to add the Danfoss Thermostats as well and I'm running into the exact same bug.

patrickkuhl commented 6 months ago

After updating to version v2.0.8 and v2.1.0 I see additional logs during the startup process (screenshot see below). Maybe they can help to solve the issue with the Danfoss Link thermostats. For me it seems that each thermostat will be recognized as a temperature sensor AND as a thermostat. Here one example out of the log for one thermostat "OG Bad":

"SKILL_eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLmE5Y2U3ZjU4LTZkZjAtNDAwMi1hOTMzLTM5OTI3MjhmYTBmYSIsInN0YWdlIjoibGl2ZSJ9_Room:7": {
                  "applianceId": "SKILL_eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLmE5Y2U3ZjU4LTZkZjAtNDAwMi1hOTMzLTM5OTI3MjhmYTBmYSIsInN0YWdlIjoibGl2ZSJ9_Room:7",
                  "endpointTypeId": "",
                  "driverIdentity": {
                    "namespace": "SKILL",
                    "identifier": "eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLmE5Y2U3ZjU4LTZkZjAtNDAwMi1hOTMzLTM5OTI3MjhmYTBmYSIsInN0YWdlIjoibGl2ZSJ9"
                  },
                  "manufacturerName": "Danfoss A/S",
                  "friendlyDescription": "Thermostat connected via Danfoss",
                  "modelName": "",
                  "deviceType": "CLOUD_DISCOVERED_DEVICE",
                  "version": "0",
                  "friendlyName": "OG Bad",
                  "friendlyNameModifiedAt": 1696876100839,
                  "capabilitiesModifiedAt": 1696876100839,
                  "ipAddress": "",
                  "port": "",
                  "entityId": "ad1263af-bace-49a9-85ae-ce2eadfd1c64",
                  "applianceNetworkState": {
                    "reachability": "REACHABLE",
                    "lastSeenAt": 1704362660245,
                    "createdAt": 1696876100839,
                    "lastSeenDiscoverySessionId": {
                      "value": "c932f1d2-6d13-47fd-b3c9-1e5c19dbb8d9"
                    }
                  },
                  "tags": {
                    "tagNameToValueSetMap": {}
                  },
                  "additionalApplianceDetails": {
                    "additionalApplianceDetails": {}
                  },
                  "firmwareVersion": "0",
                  "actions": [],
                  "capabilities": [
                    {
                      "capabilityType": "AVSInterfaceCapability",
                      "type": "AlexaInterface",
                      "version": "3",
                      "interfaceName": "Alexa"
                    },
                    {
                      "capabilityType": "AVSInterfaceCapability",
                      "type": "AlexaInterface",
                      "version": "3",
                      "properties": {
                        "supported": [
                          {
                            "name": "temperature"
                          }
                        ],
                        "proactivelyReported": true,
                        "retrievable": true,
                        "readOnly": false
                      },
                      "interfaceName": "Alexa.TemperatureSensor"
                    },
                    {
                      "capabilityType": "AVSInterfaceCapability",
                      "type": "AlexaInterface",
                      "version": "3",
                      "properties": {
                        "supported": [
                          {
                            "name": "targetSetpoint"
                          }
                        ],
                        "proactivelyReported": true,
                        "retrievable": true,
                        "readOnly": false
                      },
                      "interfaceName": "Alexa.ThermostatController"
                    },
                    {
                      "capabilityType": "AVSInterfaceCapability",
                      "type": "AlexaInterface",
                      "version": "3",
                      "properties": {
                        "supported": [
                          {
                            "name": "connectivity"
                          }
                        ],
                        "proactivelyReported": true,
                        "retrievable": true,
                        "readOnly": false
                      },
                      "interfaceName": "Alexa.EndpointHealth"
                    }
                  ],
                  "applianceTypes": [
                    "TEMPERATURE_SENSOR",
                    "THERMOSTAT"
                  ],
                  "isEnabled": true,
                  "aliases": [],
                  "connectedVia": "",
                  "alexaDeviceIdentifierList": [],
                  "applianceKey": "ad1263af-bace-49a9-85ae-ce2eadfd1c64",
                  "identifiers": {
                    "networkInterfaceIdentifiers": []
                  },
                  "applianceDriverIdentity": {
                    "namespace": "SKILL",
                    "identifier": "eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLmE5Y2U3ZjU4LTZkZjAtNDAwMi1hOTMzLTM5OTI3MjhmYTBmYSIsInN0YWdlIjoibGl2ZSJ9"
                  },
                  "ipaddress": "",
                  "applianceLambdaControlled": true,
                  "mergedApplianceIds": [
                    "SKILL_eyJza2lsbElkIjoiYW16bjEuYXNrLnNraWxsLmE5Y2U3ZjU4LTZkZjAtNDAwMi1hOTMzLTM5OTI3MjhmYTBmYSIsInN0YWdlIjoibGl2ZSJ9_Room:7"
                  ]
                }
joeyhage commented 5 months ago

@patrickkuhl thanks for providing the additional logs! I will work on adding support for this and let you know once it can be tested.