homebridge-plugins / homebridge-ewelink

Homebridge plugin to integrate eWeLink devices into HomeKit.
MIT License
387 stars 126 forks source link

'Hide Light Switch' on iFan03 Not Working? #380

Closed NeilJonesOnline closed 2 years ago

NeilJonesOnline commented 2 years ago

Hi, and thanks for this great plugin!

I have it running my Sonoff iFan03. I set it up on HOOBS with the default configuration (i.e. exposing the light switch), but then changed the configuration page to 'Hide Light Switch' under 'Fan Devices'. However, the light switch still showed in Apple Home. Thinking this might be a HomeKit artefact, I deleted the entire bridge from Home, checked the fan and light had gone from Home, and then re-added the bridge. However, once I'd 'split' the combined fan device in Home, it still shows as the Fan and Light, i.e. I still can't hide the light switch. I'm trying to hide the light switch as I've installed Hue bulbs so want them permanently switched on so they're controllable.

Looking at the HOOBS logs, the plugin seems to be throwing an error which I'd guess is linked to this (4th line):

22/06/2022, 10:57:41HOOBS (eWeLink)Loaded plugin 'homebridge-ewelink'
22/06/2022, 10:57:41HOOBS (eWeLink)Loading 1 platforms...
22/06/2022, 10:57:41HOOBS (eWeLink)eWeLinkundefined v9.0.1 | System linux | Node v16.15.1 | HB v1.4.1 | HAPNodeJS v0.10.2...
22/06/2022, 10:57:41HOOBS (eWeLink)eWeLinkWARNINGConfig entry [fanDevices] has an invalid entry which will be ignored.
22/06/2022, 10:57:41HOOBS (eWeLink)eWeLinkPlugin initialised. Setting up accessories....
22/06/2022, 10:57:41HOOBS (eWeLink)Bridge is running on port 51856.
22/06/2022, 10:57:43HOOBS (eWeLink)eWeLinkFetching devices from eWeLink home/id [My Home] [62aa1b001920eb0009bc35e9].
22/06/2022, 10:57:47HOOBS (eWeLink)eWeLinkLAN monitoring started.
22/06/2022, 10:57:47HOOBS (eWeLink)eWeLink[iFan03] initialising with options {"logging":"standard"}.
22/06/2022, 10:57:47HOOBS (eWeLink)eWeLink[iFan03] initialised and found locally with IP [192.168.1.150] [34:iFan03].
22/06/2022, 10:57:49HOOBS (eWeLink)eWeLink✓ Setup complete. Have time to give this plugin a review? https://bit.ly/hb-ewelink-review

For reference, my HOOBS config for the plugin is:

{
    "platform": "eWeLink",
    "name": "eWeLink",
    "username": "xxx@xxxx.com",
    "password": "xxxxxxxx",
    "mode": "auto",
    "language": "en",
    "fanDevices": [
        {
            "deviceModel": "ifan",
            "hideLight": true
        }
    ]
}
bwp91 commented 2 years ago

Hi @NeilJonesOnline

Please change your config to this:

{
    "platform": "eWeLink",
    "name": "eWeLink",
    "username": "xxx@xxxx.com",
    "password": "xxxxxxxx",
    "mode": "auto",
    "language": "en",
    "fanDevices": [
        {
            "label": "%%SOME LABEL FOR DEVICE%%",
            "deviceId": "DEVICE_ID_LIKE_1000abcdef",
            "deviceModel": "ifan",
            "hideLight": true
        }
    ]
}

with the label field doing nothing but letting you know which device this is in the config, and more importantly the device id of this specific iFan. This can be found in the ewelink app and also in the homebridge log when the plugin loads.

The reason the log is saying invalid entry is because the label and the device id are missing!

NeilJonesOnline commented 2 years ago

Perfect, all good now. Thanks!