grzegorz914 / homebridge-melcloud-control

Homebridge plugin for Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation, publish as dynamic external platform accessory.
MIT License
49 stars 2 forks source link

I'm getting Accesory Not Supported in Homeapp #1

Closed CyberMrProper closed 2 years ago

CyberMrProper commented 2 years ago

Not sure if the plugin is finished or work in progress, but I just wanted to highlight that after configuring it and restarting homebridge the accessory is no being recognised properly in home app. IMG_8345

grzegorz914 commented 2 years ago

it is in test phase right now, 0.0.3-beta is available

CyberMrProper commented 2 years ago

Nice, for me it is not working. Even with the latest beta, I checked the log and the last line is "debug devicesListData: " + full json from the response. Then nothing, no error no additional logs.

grzegorz914 commented 2 years ago

work in progress, any test appreciated

CyberMrProper commented 2 years ago

I got what is happening, my API return json is as follows:

"Structure": { "Floors": [], "Areas": [], "Devices": [ { "DeviceID": 131935, "DeviceName": "Aire", .....

In your response parsing code, you are expecting them to be nested, buildingStructure.Floors[j].Areas[k].Devices, but in my configuration that is not the case. Let me know if you need additional info.

grzegorz914 commented 2 years ago

Please try 0.0.5-beta.11 and let me know

CyberMrProper commented 2 years ago

Still no luck:

[6/18/2022, 2:54:00 PM] [homebridge-melcloud-control] Account: Test, Update devices list error: TypeError: Cannot read properties of undefined (reading 'Model')

grzegorz914 commented 2 years ago

Ah ok, try again beta 14

CyberMrProper commented 2 years ago

I was able to add it to HK! Tried really quick, heatercooler accessory current configured temperature is not correct, also the following error is coming in the log

[6/18/2022, 4:25:21 PM] [homebridge-melcloud-control] This plugin generated a warning from the characteristic 'Heating Threshold Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info. [6/18/2022, 4:25:21 PM] [homebridge-melcloud-control] Error: at HeatingThresholdTemperature.Characteristic.characteristicWarning (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2142:105) at HeatingThresholdTemperature.Characteristic.validateUserInput (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1990:14) at HeatingThresholdTemperature.Characteristic.updateValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1457:20) at HeaterCooler.Service.updateCharacteristic (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:481:35) at melCloudDevice.updateDevicesState (/usr/local/lib/node_modules/homebridge-melcloud-control/index.js:392:8) at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5)

grzegorz914 commented 2 years ago

This error is from MELCloud service, check the setting for heating threshold in MELCloud device setting

CyberMrProper commented 2 years ago

Not sure, I think you are not picking the right param from the configured temp in the API. In cool mode: mine reports 21 in HK, but it's actually set to 24 in the device.

grzegorz914 commented 2 years ago

please try beta22 and also look here IMG_0609 :

grzegorz914 commented 2 years ago

I have set limit for CoolingThresholdTemperature min 16 and max 31, for HeatingThresholdTemperature min 10 and max 31, sam as in MELCloud settings

CyberMrProper commented 2 years ago

In my device, current configured target temperature (cool or heat) is coming in property Devices.Device.SetTemperature.

grzegorz914 commented 2 years ago

please try 0.0.5

grzegorz914 commented 2 years ago

I think all is fixed in 0.0.6

CyberMrProper commented 2 years ago

Looking much better now, thanks for your work!

Still getting warning on null value for HeatingThresholdTemperature, I think the following line:

[const value = deviceState.DefaultHeatingSetTemperature;] https://github.com/grzegorz914/homebridge-melcloud-control/blob/1bc8359d27544373a1bf1520089334850b537f0e/index.js#L767

should be [const value = deviceState.SetTemperature;] since mine devices uses the same setting for heat and cool values.

There are some additional fixes that are nice to have, such as my device has Device.SwingFunction: false, so it means heatercooler shouldn't have Oscillate characteristic in HK. Then I see some more weird behaviour with the fan function. Let me know how you prefer me to report it.

grzegorz914 commented 2 years ago

thanks fixed in 0.0.7