-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Topic underscore are replaced by spaces #15
Comments
Would it be possible to add an option to switch on/off the replacement of underscores? I'd prefer underscores in MQTT topics, too... |
Same problem here |
This was implemented due to ioBroker not allowing underscores in state ids. We need some clarification on how to modify and validate ioBroker state ids. |
Underscores are fully allowed characters for state ids (just not for adapternames) ... so I would not see any issue here? IF a state contains an "Invalid charccter" iobrokr even replace these by an underscore :-) SO have fun using underscores, but this might be a breaking change |
According to this underscores are not allowed, this documentation might be outdated tho. As you said this change might be breaking, this change should happen in a major release. |
WTF, I will fix it. Infact the "reality" is a big different in the meantime
or make a settings for users to switch with a note that it then is breaking PS: Also / is basically allowed |
Replacing / with . and vise versa is mendatory since both are mostly equivalent (level seperator).
These cases have to be handled somehow. |
Then do a major upgrade ... think best idea. If you like you could add a "message" to be shown in admin as soon as someone does such an upgrade?? |
I will do a minor release before merging this so we have a working non breaking version. |
What is the current status ? The MQTT state contains spaces!? Thank you |
I accidentally posted this "bug" in another repo (ioBroker/ioBroker.mqtt#362). |
NO, the mentioned regex starts with an ^, so it listes the allowed characters. An underscore is fully valid as part of an id. |
Hey all,
i just found out that some of my topics changed since I use MQTT client instead of MQTT Broker/client.
Example:
in the objects following date with 2 underscores
mihome.0.devices.sensor_ht_158d000241bdaa.temperature
is offered in MQQT Client tool/option as
mihome/0/devices/sensor ht 158d000241bdaa/temperature
without underscores (replaced by spaces).
Maybe there is a wrong conversion :(
You are able to manually change it in the options, but maybe this bug could be fixed
I use following config on the raspian image
iobroker admin 3.6.0
npm 6.4.1
node v8.12.0
nodejs v8.12.0
just had a look into the code... and it seems to be a feature.... why??
//replace dots with slashes and underscores with spaces
topic = topic.replace(/./g, '/').replace(/_/g, ' ');
The text was updated successfully, but these errors were encountered: