jvmahon / Homebridge-HomeSeer4

Homebridge Plugin for HomeSeer 3 and 4
28 stars 8 forks source link

MultilevelFan not reflecting On/Off status if external modified #181

Closed RB72 closed 2 years ago

RB72 commented 2 years ago

Hi, I have noticed since plugin 1.0.31 and 1.0.32 that the MultilevelFan On/Off status is not updated when the fan state is externally changed. My MultilevelFan has four states; Off, 1, 2, 3. I can change it via the Apple Home app or via the Homebridge interface. Then the state is Off, or On (1,2,3). When the fan state is modified externally then the Fan status remains Off, but when I press and hold the fan icon (Apple Home) I can see it is set to 1, 2 or 3. It seems that the On/Off status is not synchronized anymore.

dibble9012 commented 2 years ago

These seem to be bugs in iOS/Homekit. If a "fan" service is set, the icons can be customized but instant status is broken. If a "fanv2" service is set, icons cannot be customized but instant status works. I've submitted a bug report to Apple, recommend everyone else do the same.

jvmahon, you can revert my pull request changing fanv2 to fan if you'd like. Hopefully this gets fixed by Apple.

jvmahon commented 2 years ago

These seem to be bugs in iOS/Homekit. If a "fan" service is set, the icons can be customized but instant status is broken. If a "fanv2" service is set, icons cannot be customized but instant status works. I've submitted a bug report to Apple, recommend everyone else do the same.

jvmahon, you can revert my pull request changing fanv2 to fan if you'd like. Hopefully this gets fixed by Apple.

I don't think its a bug in homekit - rather, its a bug in the code edits..

I just checked - fanv2 uses the characteristic "Active", while "fan" uses "On". I think the fix is just to change the "Active" characteristics to "On".

For example, where the code originally read:

var thisService = new Service.Fanv2();
var onControl   = thisService.getCharacteristic(Characteristic.Active)

it got changed to:

var thisService = new Service.Fan();
var onControl   = thisService.getCharacteristic(Characteristic.Active)

But it should have been changed to:

var thisService = new Service.Fan();
var onControl   = thisService.getCharacteristic(Characteristic.On)

I've now made this change.

Try updating to version 1.0.33 and let me know if it is working correctly.

RB72 commented 2 years ago

Yes, that was the problem, 1.0.33 fixed the issue. Thank you very much for fixing this!