koying / openrgb_ha

OpenRGB integration for Home Assistant
110 stars 18 forks source link

Duplicate client connections to Open RGB causing problems #26

Open amaisano opened 1 year ago

amaisano commented 1 year ago

I am getting multiple client connections to my pc Open RGB SDK server from Home Assistant. Each time my PC sleeps and resumes, a new connection (client) is made, and Home Assistant is creating duplicate devices and entities for my Open RGB devices.

image

image

I am receiving many of these errors which could be part of the problem. I think it is two things:

1) When we re-connect, we are spawning a new instance (the disconnect is not cleanly terminated) 2) We need to set unique IDs for home assistant so it finds the same devices again and doesn't duplicate them

Logger: homeassistant.components.light
Source: helpers/entity_platform.py:520
Integration: Light (documentation, issues)
First occurred: December 19, 2022 at 2:31:27 PM (259 occurrences)
Last logged: 6:27:13 AM

Platform openrgb does not generate unique IDs. ID openrgb_192.168.86.71_6742_light.candy_companion_chip_3_led_0 already exists - ignoring light.candy_companion_chip_3_led_0
Platform openrgb does not generate unique IDs. ID openrgb_192.168.86.71_6742_light.g502_lightspeed_wireless_gaming_mouse_4 already exists - ignoring light.g502_lightspeed_wireless_gaming_mouse_4
Platform openrgb does not generate unique IDs. ID openrgb_192.168.86.71_6742_light.g502_lightspeed_wireless_gaming_mouse_4_led_0 already exists - ignoring light.g502_lightspeed_wireless_gaming_mouse_4_led_0
Platform openrgb does not generate unique IDs. ID openrgb_192.168.86.71_6742_light.g502_lightspeed_wireless_gaming_mouse_4_led_1 already exists - ignoring light.g502_lightspeed_wireless_gaming_mouse_4_led_1
Platform openrgb does not generate unique IDs. ID openrgb_192.168.86.71_6742_light.evga_geforce_rtx_3080_xc3_ultra_12g_0 already exists - ignoring light.evga_geforce_rtx_3080_xc3_ultra_12g_0

And:

Logger: homeassistant.helpers.dispatcher
Source: helpers/dispatcher.py:54
First occurred: 12:57:05 AM (26 occurrences)
Last logged: 6:26:42 AM

Unable to remove unknown dispatcher <bound method OpenRGBLight._update_callback of <Entity G502 LIGHTSPEED Wireless Gaming Mouse 4: on>>
Unable to remove unknown dispatcher <bound method OpenRGBLight._delete_callback of <Entity G733 Gaming Headset 0: on>>
Unable to remove unknown dispatcher <bound method OpenRGBLight._update_callback of <Entity G733 Gaming Headset 0: on>>
Unable to remove unknown dispatcher <bound method OpenRGBLight._delete_callback of <Entity ASUS ROG STRIX Z690-E GAMING WIFI 1: on>>
Unable to remove unknown dispatcher <bound method OpenRGBLight._update_callback of <Entity ASUS ROG STRIX Z690-E GAMING WIFI 1: on>>
amaisano commented 1 year ago

Temporary workaround has been to disable the "Allow newly discovered entities" option for this HA integration. I'm still getting multiple client connections however.