-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MQTT option to override default base topic #2768
Comments
A sensible request, though I'd say specifying three topics is not that bad. Perhaps use a conf file, and maybe you don't even use/process all three? To terse the args: Note that, as per MQTT recommendations, topics do not start with a slash. |
One thing that would make me more comfortable with this is if there was a way to get the full current list of default topics that the current version rtl_433 would use, so I'm not trying to hunt down whether I've got the right starting point. Also, someday I'm hoping there might be more than 3 topics. |
Not sure if it's sufficient, but
|
Good to know and helps a little. It's a bit obscure, but at least it prints that out before trying and failing to open either the sdr or the MQTT connection. More useful to get all the default values with one of the help options. So if you want to change the mqtt base to include a radio or an instance name you need to do:
Is that correct? |
That would open multiple connections. Better use just one -F mqtt with all args appended. |
Thank you for your reply. I'm running my rtl_433 instances in Docker containers. Hence, supplying all the parameters through the command saves me from the "clutter" of volumes and conf files at the host system. By managing Docker from Portainer I don't even have to ssh into the host to edit the parameters. Just edit and re-deploy the container. So basically my request is based on laziness and an urge to de-clutter my rtl_433 command. The output is processed through rtl_433_mqtt_hass.py, so at least devices and events are required. But I like to keep as much default behaviour as possible, so supplying the states option feels right. Also thanks for the tips to on how to tidy up my args, and the superfluous leading slash. |
Didn't realize that bit of flexibility existed. So is this the correct way to change the base?
This wasn't obvious to me from the documentation, but does make sense now. Using env vars for host & password from a863963 will help a little. But, I agree at this point, it would be nice to have a way to just change the MQTT base part of the topic without having to recreate the full arg. |
Yes, correct. Depending on the used shell you need to quote the whole arg so brackets don't get expanded. IIRC all outputs can be used multiple times -- just be careful not to use stdout in outputs multiple times. |
Base topic currently defaults to /rtl_433/hostname. If this is to be changed one has to fully supply all three devices, events and states options. It would be a usefull feature to be able to override the default base topic without changing anything else. Especially if one is running multiple instances of rtl_433 on the same host and would like to identify the instance by topic. E.g. defining base topics as /rtl_433/receiver0 and /rtl_433/receiver1
Maybe something like this:
rtl_433 -f 868350000 -C si -F mqtt://192.168.100.100:1883,base=/rtl_433/recevier0
The text was updated successfully, but these errors were encountered: