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

[feat] More customisable MQTT topics #790

Closed
1up-exe opened this issue Oct 15, 2020 · 8 comments · Fixed by #796
Closed

[feat] More customisable MQTT topics #790

1up-exe opened this issue Oct 15, 2020 · 8 comments · Fixed by #796
Assignees
Labels
enhancement New feature or request

Comments

@1up-exe
Copy link

1up-exe commented Oct 15, 2020

Is your feature request related to a problem? Please describe.
I do have the problem of using the right topics. I would expect to have more flexibility choosing the topic of each node at least in the Configured Manually - mode. At the moment it possible because of the restriction of the node location.

Describe the solution you'd like
As HIVEMQ suggests I would like to have an additional option to add a groundfloor or firstfloor topic level. At the moment I'm able to enter a location/topic in the node and a value topic in the configuration of MQTT. I suggest to have to suffix topic right after the main prefix or you can add something like a node group in the node configuration
An example would be
home/groundfloor/<node_id>/status
or
home/firstfloor/<node_name>/level

Thanks!

@1up-exe 1up-exe added the enhancement New feature or request label Oct 15, 2020
@robertsLando
Copy link
Member

robertsLando commented Oct 15, 2020

@PhiSDev use location? If you set a location to a node that will be added to the topic (also check mqtt settings if this is enabled)

Alternatively you can also add a name like: firstfloor/nodename

@1up-exe
Copy link
Author

1up-exe commented Oct 15, 2020

@robertsLando Enter the name or location like this is not possible:
Only a-zA-Z0-9_- chars are allowed

newName (val) {
var match = val
? val.match(/[a-zA-Z\u00C0-\u024F\u1E00-\u1EFF0-9_-]+/g)
: [val]
this.nameError =
match[0] !== val ? 'Only a-zA-Z0-9_- chars are allowed' : null
},
newLoc (val) {
var match = val
? val.match(/[a-zA-Z\u00C0-\u024F\u1E00-\u1EFF0-9_-]+/g)
: [val]
this.locError =
match[0] !== val ? 'Only a-zA-Z0-9_- chars are allowed' : null
},

@robertsLando
Copy link
Member

@PhiSDev Ok sorry forgot about that regex, I could allow the / chars, but I would also like to know if you tried to add a location to the node, that should work. I mean if you add a location firstfloor and a node name device the topic will be

<prefix>/firstfloor/device/<valueId>

@1up-exe
Copy link
Author

1up-exe commented Oct 16, 2020

@robertsLando
No problem :)
This way of using the location does work. I prefer to group my devices into rooms as well. When I add firstfloor to location I have your solution. Do I wanna have a room as group as well I'm not able, because the value topic I can modify would end in a solution like <prefix>/firstfloor/device/bath/level in case of a value topic bath/level.

Do you know what I mean?

@robertsLando
Copy link
Member

I understand. I will submit a pr for this

@robertsLando
Copy link
Member

Done

@1up-exe
Copy link
Author

1up-exe commented Oct 19, 2020

Thank you very much!

@robertsLando
Copy link
Member

You welcome 😄

ahochsteger pushed a commit to ahochsteger/Zwave2Mqtt that referenced this issue Nov 9, 2020
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

Successfully merging a pull request may close this issue.

2 participants