itchannel / apex-ha

Local Neptune Apex HA Integration (Aquarium Controller)
GNU General Public License v3.0
19 stars 3 forks source link

Strange log error #24

Open brettonw opened 1 year ago

brettonw commented 1 year ago

When restarting HA:

Platform apex does not generate unique IDs. ID 10.0.5.85-apex_Leak already exists - ignoring sensor.apex_leak

itchannel commented 1 year ago

Interesting, i'm guessing you don't have 2 inputs on your apex both called apex_Leak?

It does create a unique ID based upon the controller IP/DNS and the input/output name. I guess one way to handle potential conflicts is to create the entity name based upon the DID instead of the name as the DID should always be unique. Will have to run some tests.

brettonw commented 1 year ago

indeed:

{
did: "1_I1",
name: "Leak",
type: "digital",
value: 0
},
{
did: "1_I2",
name: "Leak",
type: "digital",
value: 0
}
itchannel commented 1 year ago

Ok will mean adapting another breaking change but in the next update I'll change the entity ID to use the DID but keep the name as the name. So theoretically automations shouldn't need changing but will need to reload the integration to remove duplicate sensors.

New Id will be:

10.0.5.85-apex_1_I2
brettonw commented 1 year ago

I looked at changing this to use the did instead of the name, but instead I went into the Apex and made sure all my devices were uniquely named. It felt like a better interface to have the names show up in the HA entity id than just the did. HA warned adequately of the problem, so I don't think the integration needs to change here.