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

Group topics and values. #7

Open
AnonymousWebHacker opened this issue May 13, 2024 · 6 comments
Open

Group topics and values. #7

AnonymousWebHacker opened this issue May 13, 2024 · 6 comments

Comments

@AnonymousWebHacker
Copy link

I can have 3 topics sending to topic /sensor/temp.

It is more logical to add them in a single configuration than to make a separate topic

@TheZlodziej
Copy link
Owner

It is impossible - topic name is a key in config thus you cannot have 2 with the same name. It also does not really make sense to me to have multiple ones in a simulator.

@AnonymousWebHacker
Copy link
Author

AnonymousWebHacker commented May 14, 2024

Suppose you have a circuit called JHJSAU26 which publishes data in the form circuit/JHJSSAU26/temp , circuit/JHJSSAU26/preasure , circuit/JHJSSAU26/humidity.
With your mqtt-simulator, the solution is to publish 3 separate topics and in each topic it would be generated by random number functions or pre-created functions such as gps, temp.etc. So far everything is great

But what happens when you have several circuits, for example JHJSSAU26, JHJSSAU27, JHJSSAU28 or simply Circuit1, circuit2...etc

@TheZlodziej
Copy link
Owner

All right, got you. Yeah I never needed that for my use case but sending different data to the same topic (and I might need it for my next project actually 🤪). I'll try to look into that in the near future as it's a breaking feature (current config would not work when the feature is added).

@TheZlodziej TheZlodziej pinned this issue May 14, 2024
@AnonymousWebHacker
Copy link
Author

AnonymousWebHacker commented May 15, 2024

In my case, more of a Linux user, I use a bash that generates random numbers from min to maximum in each variable and at the end, I send via mqtt a topic example, circuit1/sensors/data and a json is sent with all the data.

Maybe it will be of some use to you.

Your mqtt-simulator is very cool and more with the latest features like temp, gps...etc but it is still very... simple to use.

It is not useful when you are going to generate, for example, several circuits that send a specific topic circuit_number/sensors/data with a json of data including temp, gps ..etc

@AnonymousWebHacker
Copy link
Author

AnonymousWebHacker commented May 15, 2024

Example, an idea.

The idea would be to specify a topic, circuit1/sensors/ and in that topic:

1 - choose whether to send separate raw or json themes.

2 - Choose what data would go in that json or separately.

3 - Think about the idea that perhaps the user wants to send a json in a topic with data such as temp, gps, pressure, humidity, some name...etc.

We solved #6 y #5 5 since each theme would have its theme configuration, its broker address, credentials, etc.

@TheZlodziej
Copy link
Owner

I just added support for sending data from multiple entries to the same topic (which made more sense to me). Keep in mind that it is breaking feature, although if you look at readme.md example for "manual setup" it is easy to migrate (simply add "topic" key in your config.json and change the key in "topics" to a unique one [it is no longer displayed, used only for UI to not be generated every time you add/remove/update topic])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants