Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

[bug] Z2M recreates devices, creating duplicates #514

Open
1 of 3 tasks
LordMike opened this issue May 23, 2020 · 5 comments
Open
1 of 3 tasks

[bug] Z2M recreates devices, creating duplicates #514

LordMike opened this issue May 23, 2020 · 5 comments
Assignees
Labels
bug Something isn't working no-stale Do not mark as stale

Comments

@LordMike
Copy link

LordMike commented May 23, 2020

Version

Build/Run method

  • Docker
  • PKG
  • Manually built (git clone - npm install - npm run build )

Zwave2Mqtt version: 3.2.1
Openzwave Version: 1.6.1123

Describe the bug
When using the new ability to disable HASS discovery for devices (great addon), and changing the object_id of a device .. I eventually get a new device that i also need to disable discovery for. I guess Z2M checks if a device exists, by checking for a name/object_id combo?..

It's slightly cumbersome, and potentially a bug.

To Reproduce
Steps to reproduce the behavior:

  1. Change a HASS device to ignoreDiscovery
  2. Change the object_id of the HASS device (store the doc inbetween)
  3. Do a node refresh / restart Z2M
  4. Observe that Z2M creates a new device

Expected behavior
That devices did not get created again, at least not with discovery enabled..

I'm unsure how to resolve this.. maybe a different way to uniquely identify if a device has been created? Maybe let disabling discovery be for the node, and not a specific device?

Additional context
N/A

@LordMike LordMike added the bug Something isn't working label May 23, 2020
@LordMike LordMike changed the title [bug] [bug] Z2M recreates altered devices May 23, 2020
@LordMike LordMike changed the title [bug] Z2M recreates altered devices [bug] Z2M recreates devices, after changing their object_id May 23, 2020
@LordMike LordMike changed the title [bug] Z2M recreates devices, after changing their object_id [bug] Z2M recreates devices, creating duplicates May 25, 2020
@LordMike
Copy link
Author

I now have this. :)

I was clearing up leftovers (I thought) in MQTT, that HASS was re-discovering on every restart. While doing that, I checked up on the nodes in Z2M, and then I found the below. Note how the first half is disabled discovery, but the second half isn't... and that the second half has names with "_N" suffixes.

image

@robertsLando
Copy link
Member

I guess Z2M checks if a device exists, by checking for a name/object_id combo

That should be unique and never be touched by the user

@LordMike
Copy link
Author

Yea, but I kinda needed to modify it to rid myself of the scaling that Z2M does.. :P

Anyhoo. Having one duplicate is fine.. but my last image shows that this happens for other devices as well, some I haven't modified.

@robertsLando
Copy link
Member

robertsLando commented May 25, 2020

Yea, but I kinda needed to modify it to rid myself of the scaling that Z2M does.. :P

I will fix this in #516 if you tell me what I have to fix. Like I said I don't have many devices to test and I would not break things

Having one duplicate is fine.. but my last image shows that this happens for other devices as well, some I haven't modified.

That's strange... I haven't edited anything in that part

@LordMike
Copy link
Author

Yea, but I kinda needed to modify it to rid myself of the scaling that Z2M does.. :P

I will fix this in #516 if you tell me what I have to fix. Like I said I don't have many devices to test and I would not break things

Oh, do note that #516 doesn't resolve this issue :).. #516 fixes a bug where only the first "rgb_dimmer" receives scaling - my issue here (and really always) is that they're scaled at all - but that we can't fix without breaking stuff. Sorry about the confusion ... :/

Having one duplicate is fine.. but my last image shows that this happens for other devices as well, some I haven't modified.

That's strange... I haven't edited anything in that part

I'll have to do more tests, rediscoveries, to see when they appear.

@robertsLando robertsLando added the no-stale Do not mark as stale label Oct 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working no-stale Do not mark as stale
Projects
None yet
Development

No branches or pull requests

2 participants