HomebridgeMagicHome-DynamicPlatform icon indicating copy to clipboard operation
HomebridgeMagicHome-DynamicPlatform copied to clipboard

[Feature Request] Report offline bulbs as "No Response"

Open muzzymate opened this issue 4 years ago • 12 comments

I have several A19/E26 MagicHome controllable RGBW bulbs around the house that are installed on old-style light switches or desk lamps. This plugin controls those bulbs fantastically but if someone turns off the light switch, a couple undesirable things occur:

  • In the Home app, the bulb will continue to report it's previous state: either on or off and whatever color the bulb was at the time it lost power/network/communication. This could lead to someone thinking a light is on but it in reality, not.
  • The bulb is no longer controllable because physics... but the user in the Home app is not made aware of this. The light state in the Home app can be changed but it's not apparent that this action is not possible/successful.

I've seen with the homebridge-tuya plugin that bulbs that are offline due to being electrically switched off are reported in the Home app as "No Response" / "This accessory is not responding.". This gives a visual indicator to the user that the bulb is not controllable at this time (either because of a current network issue/the bulb being turned off electrically/etc). This to me seems like a better user experience, IMO.

If this is more of a bug (not currently expected behavior), then I can rewrite utilizing the Bug Report template or if this has already been considered and not possible/wanted for reasons, than I can close it out. Just wanted to drop the suggestion based on how I've seen other plugins work.

Thanks for the work on the plugin! It's among some of the easiest to get up and running, but it still highly configurable.

muzzymate avatar Jan 26 '21 17:01 muzzymate

Thank you for this detailed explanation. In fact we are aware of this and our solution will be to simply turn the device in an off state if it's detected to have no response.

We decided against "no response" as turning light switches on/off is a normal occurrence for many users. This would cause Siri to complain and possibly HomeKit to become in a weird state.

I will link the pull request here when that feature has been implemented.

Thank you for the kind words. That's one of plugin's core values, to be as easy to setup as possible. I'm glad that you find it that way.

Zacknetic avatar Jan 26 '21 17:01 Zacknetic

@muzzymate I've just implemented the feature into 1.9.3-beta.5. By default, a controller's status, when offline, will be set to off. You can change this to "No Response" by setting "displayUnresponsive" under "advancedOptions" to true. Reference: https://github.com/Zacknetic/HomebridgeMagicHome-DynamicPlatform/commit/c4d2285ab397ab5a453245aaf8d5977f56090643

tom-23 avatar Feb 05 '21 21:02 tom-23

Reopening for user feedback.

Zacknetic avatar Feb 06 '21 00:02 Zacknetic

@muzzymate, let me know if that update helps you out.

Zacknetic avatar Feb 06 '21 02:02 Zacknetic

Thanks @tom-23 & @Zacknetic. I just installed the 1.9.3-beta.5 version and will report back.

muzzymate avatar Feb 10 '21 18:02 muzzymate

Working great so far. I love the configuration option for either "report off" or "report not responding". Thanks for implementing that! After switching back and forth between the two, I still do think "Not Responding" is the way to go since it implies that the light bulb is not available and can not be controlled. I do have my bulbs configured as static IP addresses assigned via DHCP so that they'll always get the same IP address when they are turned back on at the switch. I haven't tried what happens if they would acquire a new IP (a little nervous based on the Readme.md note "If a device has changed its IP Address, such as after a power outage, this plugin will update that device with the new IP on the next restart"). If I run into anything before 1.9.3 goes live, I'll update the issue report here.

muzzymate avatar Feb 11 '21 22:02 muzzymate

@muzzymate Great to hear that! There is no need to set your bulbs to have a static IP address. IP address discrepancy resolving was one of the first features I implemented. But I absolutely understand your skepticism.

Let's keep this open for now, and I will close it when 1.9.3 is released. Thanks for the feedback!

Zacknetic avatar Feb 12 '21 00:02 Zacknetic

Ah interesting. Ok, I'll try without static IP addresses and see how it goes.

muzzymate avatar Feb 12 '21 14:02 muzzymate

@tom-23 & @Zacknetic - I've noticed since upgrading Homebridge to version 1.3.1, my bulbs that are powered off at the mains no longer show "No Response" but instead will show in the Home app as off. This is despite what the displayUnresponsive flag is set to (but I have it set to true). I had upgraded to beta.6 version of the plugin a few days ago but the issue is present with beta.5 as well.

When I revert to Homebridge 1.3.0, bulbs that are switched off at the mains report as "No Response". When using 1.3.1 using the same config.json parameters, the bulb will instead report as off.

I run Homebridge from the Homebridge-VM-Image, which is basically a Boot to Docker running Homebridge image. Node.js Version is at v14.15.5 and Npm Version is 6.14.11. OS reports as Ubuntu Bionic Beaver (18.04.5 LTS). But the change in behavior seems to be related to whatever changed between Homebridge 1.3.0 and 1.3.1. If there is any logs or debug info I can relay that would be helpful, let me know.

Thanks!

Edit: Not sure if it's related, but I'm noticing now that this is occasionally logged to the Homebridge output log:

[2/25/2021, 4:26:23 PM] [homebridge-magichome-dynamic-platform] This plugin generated a warning from the characteristic 'On': Unhandled error thrown inside read handler for characteristic: Error: characteristic value expected boolean and received object
    at On.Characteristic.validateUserInput (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1885:17)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1490:24
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:9:18
    at RGBWWBulb.getOn (/homebridge/node_modules/homebridge-magichome-dynamic-platform/src/platformAccessory.ts:320:5)
    at On.emit (events.js:315:20)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1466:14
    at new Promise (<anonymous>)
    at On.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1464:12)
    at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27)
    at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57) See https://git.io/JtMGR for more info.

muzzymate avatar Feb 25 '21 16:02 muzzymate

Quick update, since Homebridge 1.3.2 update was released a few hours ago. The issue reported when using Homebridge 1.3.1 above continues in 1.3.2. Despite specifying in configuration to have the offline bulbs to report as 'No Response', they are instead reporting as off.

Rolling back to Homebridge 1.3.0, offline bulbs will report as 'No Response' when specified to do so in the config file.

muzzymate avatar Mar 04 '21 13:03 muzzymate

Thanks for the update. I'll let you know when we have a beta for you to try. Should be one of, if not the first thing that gets worked on.

Zacknetic avatar Mar 04 '21 13:03 Zacknetic

Has this been implemented?

jamie-2bit avatar Nov 03 '22 04:11 jamie-2bit