Git Product home page Git Product logo

Comments (8)

zuckschwerdt avatar zuckschwerdt commented on June 30, 2024 1

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.
E.g. -F json -F json:log.json might be useful.

from rtl_433.

zuckschwerdt avatar zuckschwerdt commented on June 30, 2024

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: -f 868350000 is -f 868.35M and -F mqtt://192.168.100.100:1883 is -F mqtt://192.168.100.100

Note that, as per MQTT recommendations, topics do not start with a slash.

from rtl_433.

rct avatar rct commented on June 30, 2024

though I'd say specifying three topics is not that bad.

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.

from rtl_433.

zuckschwerdt avatar zuckschwerdt commented on June 30, 2024

Not sure if it's sufficient, but -v will log the topics:

$ rtl_433 -v -F mqtt
...
MQTT: Publishing MQTT data to localhost port 1883
MQTT: Publishing device info to MQTT topic "rtl_433/HOSTNAME/devices[/type][/model][/subtype][/channel][/id]".
MQTT: Publishing events info to MQTT topic "rtl_433/HOSTNAME/events".
MQTT: Publishing states info to MQTT topic "rtl_433/HOSTNAME/states".

from rtl_433.

rct avatar rct commented on June 30, 2024

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:

-F mqtt://mqtthost:mqttport,user=mqttuser,pass=mqttpass,devices=rtl_433/HOSTNAME/INSTANCE/devices[/type][/model][/subtype][/channel][/id] \
-F mqtt://mqtthost:mqttport,user=mqttuser,pass=mqttpass,events=rtl_433/HOSTNAME/INSTANCE/events \
-F mqtt://mqtthost:mqttport,user=mqttuser,pass=mqttpass,states=rtl_433/HOSTNAME/INSTANCE/states \

Is that correct?

from rtl_433.

zuckschwerdt avatar zuckschwerdt commented on June 30, 2024

That would open multiple connections. Better use just one -F mqtt with all args appended.

from rtl_433.

jhj1974 avatar jhj1974 commented on June 30, 2024

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: -f 868350000 is -f 868.35M and -F mqtt://192.168.100.100:1883 is -F mqtt://192.168.100.100

Note that, as per MQTT recommendations, topics do not start with a slash.

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.

from rtl_433.

rct avatar rct commented on June 30, 2024

That would open multiple connections. Better use just one -F mqtt with all args appended.

Didn't realize that bit of flexibility existed. So is this the correct way to change the base?

-F mqtt://mqtthost:mqttport,user=mqttuser,pass=mqttpass,devices=rtl_433/HOSTNAME/INSTANCE/devices[/type][/model][/subtype][/channel][/id],events=rtl_433/HOSTNAME/INSTANCE/events,states=rtl_433/HOSTNAME/INSTANCE/states

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.

from rtl_433.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.