pschroeder89 / homebridge-levoit-humidifiers

Levoit Humidifiers Plugin for Apple HomeKit via Homebridge
Apache License 2.0
70 stars 9 forks source link

Humidifier disappearing from Home app #44

Closed danfratamico closed 1 year ago

danfratamico commented 1 year ago

Describe The Bug:

If I have my Dual 200S connected in Homebridge and Apple Home, if my humidifier loses network connectivity, it will disappear from the Apple Home app and Homebridge accessories entirely. I need to reboot Homebridge to discover the device again and add to Apple Home. Even then, it adds it to Default Room and does not remember the room I selected. It is as if it's adding a completely new device.

To Reproduce:

  1. Unplug humidifier
  2. Device disappears from Homebridge and Apple Home app
  3. Restart Homebridge
  4. Devices appears in Homebridge and Apple Home as a brand new device and loses its saved room selection

Expected behavior:

Device should be cached in Homebridge and not cause issues when it loses network connectivity or unplugged.

Logs:

[1/2/2023, 8:36:12 PM] [Levoit Humidifiers] Initializing LevoitHumidifiers platform...
[1/2/2023, 8:36:12 PM] [Levoit Humidifiers] Loading accessory from cache: Bedroom Humidifier
[1/2/2023, 8:36:12 PM] [Levoit Humidifiers] Connecting to the servers...
[1/2/2023, 8:36:12 PM] [Levoit Humidifiers] Discovering devices...
[1/2/2023, 8:36:13 PM] [Levoit Humidifiers] [UPDATED INFO RESPONSE] {"traceId":"*removed*","code":0,"msg":"request success","module":null,"stacktrace":null,"result":{"traceId":"*removed*","code":0,"result":{"enabled":true,"mist_virtual_level":1,"mist_level":1,"mode":"auto","water_lacks":false,"water_tank_lifted":false,"humidity":42,"humidity_high":false,"display":true,"automatic_stop_reach_target":false,"configuration":{"auto_target_humidity":40,"display":true,"automatic_stop":true},"extension":{"schedule_count":0,"timer_remain":0},"rgbNightLight":{"action":"on","colorMode":"color","speed":0,"brightness":91,"red":20,"green":232,"blue":181,"colorSliderLocation":89}}}}
[1/2/2023, 8:36:13 PM] [Levoit Humidifiers] Restoring existing accessory from cache: Bedroom Humidifier
[1/2/2023, 8:36:13 PM] [homebridge-levoit-humidifiers] This plugin generated a warning from the characteristic 'Brightness': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info.

Plugin Config:

{
    "name": "Levoit Humidifiers",
    "email": "example@gmail.com",
    "password": "password",
    "accessories": {
        "cool_mist": true,
        "warm_mist": true,
        "sleep_mode": true,
        "display": true,
        "night_light": true
    },
    "options": {
        "showOffWhenDisconnected": false
    },
    "platform": "LevoitHumidifiers"
}

Screenshots:

Environment:

pschroeder89 commented 1 year ago

Hey @danfratamico , this is documented in the Note to Seasonal Humidifier Users section of the README. There were users that requested a "remove from HomeKit when disconnected" feature, and others that wanted an option to "keep in HomeKit but display Off when disconnected".

I do agree that the behavior you want should be included, though. I'm going to make the default behavior to "show in HomeKit as Not Responding", as it originally was. Then I will add a new removeWhenDisconnected config option for those that want that.

I'll probably get to this later this week, but for now, you could set showOffWhenDisconnected to true to keep them in HomeKit when disconnected.

danfratamico commented 1 year ago

Apologies, I should have read the documentation. Enabling that setting resolved the issue!

pschroeder89 commented 1 year ago

Going to close this, since changing the behavior would be a big lift and it doesn't seem necessary