sanjoyg / dirigera_platform

HomeAssistant Integration for Dirigera Platform
MIT License
71 stars 8 forks source link

Duplicate SOMRIG devices created during import #24

Closed bjorncs closed 2 months ago

bjorncs commented 3 months ago

I have 3 SOMRIG button devices in my smart home setup. During the inital setup I've ended up with 6 devices in total in HA. The duplicates are all named IKEA Dirigera Hub : 10.0.0.3 and do not have any entities.

Screenshot 2024-03-29 at 19 36 49

dirigera-devices.json

sanjoyg commented 2 months ago

Can you check with the latest release again.

bjorncs commented 2 months ago

Duplicates still there with 1.3.5.1. I removed the devices and re-paired with Dirigera. The duplicates reappeared once again.

sanjoyg commented 2 months ago

I got some time to look at the JSON. The hub returns two devices with different id but same serial number. For example the first SOMRIG with name EntranceButton has two entries with almost same id except _1 and _2 at end. Same serial number but different attribute "switchLabel".

In one case the attribute value is "Shortcut 1" and other has "Shortcut 2"

Can you tell me how this is related to the physical device as I dont have one

bjorncs commented 2 months ago

The SOMRIG remote control consist of two buttons, each button supports single/double/long click as separate triggers.

After investigating the scene configuration dump I created fromthe https://github.com/Leggin/dirigera library it's clear that the two "devices" actually represents the two buttons of a single remote. The devices having suffix _1 represents the top button (the one with a single dot imprinted), while _2 represents the lower button.

The latter always has an empty customName and missing the attributes batteryPercentage and room. Otherwise identical.

sanjoyg commented 2 months ago

Closing this Issue, we shall track with the issue #29

bjorncs commented 2 months ago

Not sure how this relates to #29. I'll working a on contribution that will remove the duplicate devices.

sanjoyg commented 2 months ago

My bad, will get to fix this once we fix the empty scene creation that @slajob is working on.

bjorncs commented 2 months ago

I drafted https://github.com/sanjoyg/dirigera_platform/pull/33. @slajob will hopefully be able to reuse most of the additional code introduced in his solution.