bstuff / haier-ac-remote

70 stars 15 forks source link

HomeAssistant HomeKit Controller Compatibility - might be an easy fix #29

Open Nixellion opened 3 years ago

Nixellion commented 3 years ago

Hi!

Currently it is quite easy to integrate Haier AC into HomeAssistant using this homebridge plugin, as HomeAssistant has HomeKit Controller.

However there is a very serious issue, where only one of the AC entities is properly added into HomeAssistant. I raised this issue on HomeAssistant github and they told me that the reason for that is because haier-ac-remote plugin does not set unique identifier. And looking at the code, indeed it literally manually sets it to "Undefined". It's supposedly a 1-line fix here:

https://github.com/bstuff/haier-ac-remote/blob/7276b957d356fd173ea658164526fd4071e41d23/packages/homebridge-haier-ac/src/haier.ts#L56

As Hass dev noted:

If they set the serial number to config.mac instead of 'Undefined' then it likely would work.

Here's link to discussion on HomeAssistant github: https://github.com/home-assistant/core/issues/50811

Nixellion commented 3 years ago

Went ahead and made a PR: https://github.com/bstuff/haier-ac-remote/pull/30

Jc2k commented 3 years ago

Hi, HomeAssistant dev here (specifically for the homekit_controller integration). Happy to confirm this is a correct summary of my conversations with @Nixellion - providing a unique and stable identifier like config.mac as the Serial Number will allow Home Assistant to use this Home Bridge plugin. Cheers.