kongkx/homebridge-gree-air-conditioner

error subtype 'power' as another Service in this Accessory.

Closed this issue · 2 comments

Describe The Bug:
Repeated error message in Homebridge console.

To Reproduce:
Messages are repeated without user interaction.

Expected behavior:
Would expect not to have error messages.

Logs:

Preparing Advertiser for 'Gree AC 5BA4' using bonjour-hap backend!
Starting to advertise 'Gree AC 5BA4' using bonjour-hap backend!
[17/09/2021, 09:44:17] Homebridge v1.3.4 (Gree AC) is running on port 37318.
[17/09/2021, 09:44:17] [Gree AC] UDP server bind to 7002
[17/09/2021, 09:44:21] [Gree AC] handleMessage Error Error: Cannot add a Service with the same UUID '00000049-0000-1000-8000-0026BB765291' and subtype 'power' as another Service in this Accessory.
    at Accessory.addService (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:448:17)
    at PlatformAccessory.addService (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:93:41)
    at new HeaterCoolerToggleSwitch (/usr/local/lib/node_modules/homebridge-gree-air-conditioner/src/HeaterCoolerToggleSwitch.ts:17:29)
    at GreeAirConditioner.initSwitch (/usr/local/lib/node_modules/homebridge-gree-air-conditioner/src/platformAccessory.ts:802:14)
    at new GreeAirConditioner (/usr/local/lib/node_modules/homebridge-gree-air-conditioner/src/platformAccessory.ts:73:29)
    at GreePlatform.registerDevice (/usr/local/lib/node_modules/homebridge-gree-air-conditioner/src/platform.ts:149:14)
    at Socket.GreePlatform.handleMessage (/usr/local/lib/node_modules/homebridge-gree-air-conditioner/src/platform.ts:107:14)
    at Socket.emit (events.js:400:28)
    at UDP.onMessage (dgram.js:941:8)
[17/09/2021, 09:44:21] [Gree AC] [502cc6048e8e -- 10.126.1.54:7000] Device binded. XXXXXXXXXXXX
[17/09/2021, 09:44:21] [Gree AC] [502cc6048e8e -- 10.126.1.54:7000] Update Status: {"Pow":0,"Mod":0,"SetTem":25,"TemSen":65,"TemUn":1,"TemRec":0,"WdSpd":0,"SwingLfRig":0,"SwUpDn":2,"Blo":0,"Lig":1,"Quiet":0,"Tur":0,"HeatCoolType":0,"SvSt":0,"SwhSlp":0,"time":"2021-09-17 09:44:22"}
TypeError: Cannot read property 'getCharacteristic' of undefined
    at GreeAirConditioner.updateStatus (/usr/local/lib/node_modules/homebridge-gree-air-conditioner/src/platformAccessory.ts:686:25)
    at Socket.GreeAirConditioner.handleMessage (/usr/local/lib/node_modules/homebridge-gree-air-conditioner/src/platformAccessory.ts:630:16)
    at Socket.emit (events.js:412:35)
    at UDP.onMessage (dgram.js:941:8)

Plugin Config:

{
    "name": "Gree AC",
    "language": "en",
    "port": 7002,
    "scanAddress": "xxx.xxx.xxx.xxx",
    "defaultValue": {
        "statusUpdateInterval": 60,
        "sensorOffset": 40,
        "defaultSpeed": 3
    },
    "devices": [
        {
            "mac": "xxxxxxxxxxxxx",
            "name": "Master AC",
            "sensorOffset": 40,
            "defaultSpeed": 3
        }
    ],
    "_bridge": {
        "username": "xxxxxxxxxxxxxxxx",
        "port": 37318
    },
    "platform": "GreeAirConditioner"
}

Screenshots:

Environment:

  • Plugin Version: 1.2.0
  • Homebridge Version: 1.3.4
  • Node.js Version: 14.17.4
  • NPM Version: 7.20.3
  • Operating System: Raspbian Buster

Could you enable the debug mode, so I can get more information about the loaded config. It seems like the accessory initialization process has been triggered more than once.

But this may be related the cached accessory info in homebridge, so you may try to remove the accessories and the persist contents and reboot homebrige.

I removed the cached accessory and it seems to have cleared the error. Thanks.