Skip to content
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

Can you provide message filtering function? #103

Open
darcyg opened this issue Dec 28, 2022 · 7 comments
Open

Can you provide message filtering function? #103

darcyg opened this issue Dec 28, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@darcyg
Copy link

darcyg commented Dec 28, 2022

hi @EdJoPaTo .
The payload of mqtt messages. A lot is a json or msgpack of arbitrary structure.
For example, the cmnd information of tasmota returns stat/xxxxxx/RESULT

Since the message structure can be various data, such as {"ModbusSend":"done"}
or {"Status":{....}}

Since ModbusSend is relatively frequent (1-3 times per second), other data are easily swiped and cannot be seen.

It is hoped that a filtering function can be provided to support the filtering format of jsonpath data. Filter and display the data, such as keeping only xxx or keeping everything except xxx.

thanks for your work

@EdJoPaTo
Copy link
Owner

Just to be sure I understand this correctly: on the same topic is different JSON content multiple times a second?

When that’s the case I’m not sure that’s something I would want to address. That sounds like bad design on the Tasmota MQTT interface then.
Without having thought much about it yet (partially because I am not sure I understood you correctly) it sounds like some overly specific feature which might not be as nice to use/maintain in the long run.

I am also thinking about other possible ideas to filter messages. Maybe mqttui log could be piped into jq? Currently it wouldn’t work as the output is not payload only and I also don’t know if jq has a 1 json per line mode. Just throwing in random ideas currently.

@darcyg
Copy link
Author

darcyg commented Dec 29, 2022

on the same topic is different JSON content multiple times a second?
yes

I know there are many mqtts with similar design.
The reason is that part of the cloud is a pub/sub message center for post-processing. Not suitable for mass themes. For example kafka. Therefore, many platforms will be internally identified by the payload in a theme. Load json with different structures. Then this design will also affect the data bridge with mqtt. And then affect the mqtt communication protocol design of the terminal
I've seen some finished IoT products that are similar.
tasmota has a configuration switch that maps different data to private topics for their respective commands

Personally, I hope that the json filter of a theme load can be configured in the UI. I have found various command line and GUI mqtt client software for this function, but almost none of them support it.

I think if mqttui can support this function. I think it will make mqttui more popular.

thanks

@EdJoPaTo
Copy link
Owner

EdJoPaTo commented Jan 7, 2023

Personally most of the devices I am working with don't use JSON in the first place as plain values are easier to handle on embedded devices. Having other peoples use cases helps with understanding what might be useful to others too. Thanks for providing ideas and views!

After thinking a bit about this I am still not sure how to proceed in a good way.
One idea I had is to allow for selection of the message in the message history.
That way a specific message payload can be viewed more easily. That is probably also helpful for other kinds of payloads, not only JSON payloads.

Then the JSON selection needs to be more useful than it is currently. Currently only the index and not the key is used which is not very helpful for varying JSON payloads of different kinds.

When both is in place the current JSON selection could also be used to filter the history. But first the other two thingies are more important and probably somewhat helpful for your use case already. That might change what would be both helpful and easy to use.

What do you think about that? Also feel free to keep me updated about what helps when I update mqttui / you get other ideas!

@darcyg
Copy link
Author

darcyg commented Jan 11, 2023

@EdJoPaTo thank you for your reply

thank you for your reply
I think your idea is great. I am not familiar with rust, I mainly use C/CPP, PYTHON, and I am currently in touch with GO, I will follow your revisions and learn rust. Contribute code.

@EdJoPaTo
Copy link
Owner

I will follow your revisions and learn rust. Contribute code.

Just to say it: there is no requirement in code contributions. There are a other ways to contribute like ideas, testing, issue reporting and so on. Do what you like but don't feel pressured to contribute code :)

Having these ideas in the back of my mind while using mqttui makes me already miss them. I hope to find some time to work on these improvements as I would like to see them too!

@arturxedex128
Copy link

Filtering of topics and current-payloads would be nice:

like:

press "f" -> type what you are searching for -> the Topics-tab now displays only the topic with "searchword" in topic or payload.

I think thats enough for most cases.

Greeets
Artur

@EdJoPaTo
Copy link
Owner

Selecting history entries from the table is possible with v0.20.0 now. It also includes a topic search.

Searching for topic payloads is currently not possible. Thinking about it, I am not sure how useful / easy it is to use. Is this still of interest?

@EdJoPaTo EdJoPaTo added enhancement New feature or request and removed pinned labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants