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

[feat] Do not automatically add HA discovery data upon include #465

Open
magpern opened this issue May 10, 2020 · 7 comments
Open

[feat] Do not automatically add HA discovery data upon include #465

magpern opened this issue May 10, 2020 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@magpern
Copy link

magpern commented May 10, 2020

Is your feature request related to a problem? Please describe.
When you include a node, the node gets a id number. Eg. NodeID_16
If HASS Discovery is true, this entity will get written to MQTT as NodeID_16 the same instance it is included.

If you later change the name of the device in zwave2mqtt (or location) a new MQTT discovery topic is posted.
This results in a lot of manual cleaning of MQTT.

Describe the solution you'd like

  • Alternative 1: A question after include. "Do you want to send Home Assistant MQTT Discovery topics?"

  • Alternative 2: Simply, do not send the topics. One have to manually request it, which is already available

  • Alternative 3: Clean up MQTT. If a node name changes, rename it and delete the old entries in MQTT, including the HASS Discovery topics

Describe alternatives you've considered
One could disable the "HASS Discovery" temporarily, include, change name, enable again, and press the "re-discover device"
But it is ease to forget this every time.

@magpern magpern added the enhancement New feature or request label May 10, 2020
@magpern magpern changed the title [feat] No not automatically add HA discovery data upon include [feat] Do not automatically add HA discovery data upon include May 11, 2020
@robertsLando
Copy link
Member

robertsLando commented May 11, 2020

Alternative 2: Simply, do not send the topics. One have to manually request it, which is already available

I think I could add an option like manual discovery that will allow you to manually send discovery once you are ready.

Usually I suggest to don't enable gateway once your entire configuration is ok to avoid this kind of issues

@magpern
Copy link
Author

magpern commented May 11, 2020

I think I could add an option like manual discovery that will allow you to manually send discovery once you are ready.

This option is already there and works
image

Usually I suggest to don't enable gateway once your entire configuration is ok to avoid this kind of issues
Makes sense. However, I always remember this after I have included or changed a device :)

It is not a big deal, since it is fairly easy to remove the HASS topics with MQTT Explorer, but since, device is just included and name will change it feels like an unnecessary step to add the HASS topics, just to manually delete them in the next step (if you forget to set the MQTT Discovery to false).

So, it is not a bug, there is plenty of workarounds, but it feels like an extra step that could easily avoided, but like say a popup after the include. "Send Home assistant discovery topics now" (Yes / No)

@robertsLando
Copy link
Member

robertsLando commented May 11, 2020

This option is already there and works

Maybe I have explained it wrong, with manual discovery I mean, it doesn't discover nodes automatically once nodes are detected but you always have to press that button in order to discover them

@LordMike
Copy link

@robertsLando I had some of these thoughts too, as this issue has. I resigned myself to just cleaning up in MQTT on renaming, but my comment can actually apply here too. If the default was to not do discovery, a button could instead be added to actually do it (push it to MQTT).

@travisghansen
Copy link

I don’t use the location names for the topics and enjoy the fact that it automatically discovers when I add a new device. Just an alternative voice :)

@vvuk
Copy link

vvuk commented Dec 4, 2020

I'm about to add a whole pile of devices to my z-wave network, and would like to have them have somewhat sane names on the HA side. One idea would be to add an additional configuration option, basically "only send hass discovery if node has a name". If you have "use node names" AND "hass discovery" AND the new "only discover named nodes" enabled, the discovery will be created once the node gets a name, but not before. @robertsLando what do you think? I'm happy to put together a PR for this if that sounds like a useful approach.

@robertsLando
Copy link
Member

@vvuk I would be happy to review a PR for this. Anyway I suggest to add new features to: https://github.com/zwave-js/zwavejs2mqtt. That will be the future of this project. I will continue maintain this but would like to add features there and only fix bugs here. If you are asking for a 'why?' : https://github.com/zwave-js/zwavejs2mqtt#why-zwavejs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants