asednev / homebridge-plugin-govee

Govee H-series Thermometer Hygrometer plugin for Homebrige.
Apache License 2.0
53 stars 9 forks source link

Remove Device from Homekit #42

Closed MrFly72 closed 2 years ago

MrFly72 commented 2 years ago

Describe Your Problem: I am seeing 3 devices with different names instead of 2. My believe is, that one of my neighbors has on of the H5075, which will show in my Govee Pluign.

Logs: [12/11/2021, 10:56:51] [Govee] Adding new accessory: GVH50753B9C [12/11/2021, 10:56:54] [Govee] Adding new accessory: GVH507552D0 [12/11/2021, 10:57:06] [Govee] Adding new accessory: GVH50759447

the one with 2D0 is not mine.

I tried to disable it on the Homebridge GUI by hiding it, but it will end up in homekit anyhow and cannot delete it in homekit. Is there any way to configure the Govee Plugin to not deliver this device anymore. And if not, I believe it would be a needed enhancement.

MrFly72 commented 2 years ago

I was able to produce a temporary solution for myself to ignore the device: image

asednev commented 2 years ago

@MrFly72 that's fantastic. Homebridge supports configurations for plugins which can be used to maintain the list of ignored devices outside of code: https://developers.homebridge.io/#/config-schema

MrFly72 commented 2 years ago

Ok, i know have it quite nice setup, I believe. As said, I am not a great Java developer..... Added this to the config: "IgnoreDeviceNames": { "title": "Ignored DeviceNames", "type": "array", "items": { "title": "DeviceName", "type": "string" } } and this to the code: const displayName = ${this.sanitize(reading.model)}; //this.log.info("Current List of Ignored Devices: ",this.config.IgnoreDeviceNames); const IgnoredDeviceNames = this.config.IgnoreDeviceNames; if( IgnoredDeviceNames.includes(displayName)) { // it will return true if you foo is one of array values else false this.log.debug("Device in Ignore List", displayName," skipping the device!"); return; } This is the config dialog: 2021-11-23 10_07_24-Homebridge

Works great so far.....

asednev commented 2 years ago

Thanks for your contribution in PR https://github.com/asednev/homebridge-plugin-govee/pull/48. This has been published in version 1.1.4

sdiegel commented 2 years ago

I'm having this issue on v1.1.6. I have five devices that don't match any of my devices' serial numbers. I added each value to the Ignored DeviceNames list one at a time, and restarted Homebridge and the Home app and they aren't going away. Any advice?

MrFly72 commented 2 years ago

ONCE found they don't disappear. You have to delete them through homebridge as they are cached.

sdiegel commented 2 years ago

ONCE found they don't disappear. You have to delete them through homebridge as they are cached.

Thanks for the quick response! I wasn't aware of this functionality. It worked perfectly.

MrFly72 commented 2 years ago

I only have 2 devices I have to ignore and 4 to be mine ;-) Maybe you are my neighbor and see my 4 + the one in my campingcar 😂😂😂