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

MQTT-support for alerts. Proof-of-concept implemented. Feedback requested #2493

Open
insensitiveclod opened this issue Aug 29, 2019 · 4 comments · May be fixed by #3560
Open

MQTT-support for alerts. Proof-of-concept implemented. Feedback requested #2493

insensitiveclod opened this issue Aug 29, 2019 · 4 comments · May be fixed by #3560
Labels

Comments

@insensitiveclod
Copy link

insensitiveclod commented Aug 29, 2019

TLDR:

I have implemented a method to get LGSM alerts to be distributed via the MQTT protocol.
I am looking for feedback on it , review the implementation AND on guidance on how to get it prepped for inclusion into the base LGSM package.

A proof of concept is in 'insensitiveclod/LinuxGSM'

Long version:

I have implemented:
alert_mqtt.sh

And altered:
alert_sh (to know what to do)
core_functions.sh (to know about it)
core_dl.sh (to define mqttpubpath... Is possibly not the right place ?)

Also, an example config has been made for rust:
rustserver/_default.cfg

Since I only started using LGSM about a month ago, and I just checked out the source 4 days ago, I dont know if there's particular requirements/ideas that I am missing in my implementation.

I aim to re-write json-format of the alert_mqtt.sh message somewhat to more correspond to something that'll be easily parseable by something like NodeRed
I am thinking of doing this with a 'mqttjsontemplate' config-param that'll allow formatting things from the config-file, as it would be quite a pain to have to edit alert_mqtt.sh for most users.

The config currently knows about:
mqttalert on/off
mqtthost server-name/ip
mqttport service-port
mqttuser user to login with (anonymous-user support coming)
mqttpassword password for user (see above)
mqtttopic mqtt 'topic' name.

The mqtttopic is currently 'fixed'. That is, '/lgsm/rustserver' for the rust-server example.
I am thinking of changing it to "mqtttopicbase" instead, so the full topic of any alert will be in the form of /lgsm/rustserver/$instancename/
If you know how MQTT works, this will mean you can subscribe to /lgsm/rustserver/# and get messages from ALL instances; of /lgsm/rustserver/rustserver1 for the 'rustserver1' instance , only.

Comments very welcome.
Keen to have this be available for anyone/everyone.

@issue-label-bot issue-label-bot bot added the type: feature request New feature or request label Aug 29, 2019
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label type: feature request to this issue, with a confidence of 0.81. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@BrutalBirdie
Copy link

BrutalBirdie commented Aug 30, 2019

I am looking for feedback on it

IMHO
MQTT is a nice addition. Some people won't know what do with it.
I like it! With MQTT enabled for LGSM I can add my Server(s) to my SmartHome via. openHAB.
If I get time I will test and check your code.

@insensitiveclod
Copy link
Author

Cheers, thanks for your response.

The nice thing is that it integrates with quite a few services 'under the hood' as well.
A lot of the Internet of Things infrastructure has chosen MQTT as it's default method of communication. ITTT, TheThingsNetwork (Lorawan), etc.. So that makes it nice to be able to recieve these kinds of game-server messages on your devices OR remix them in other ways.

Lemme know what changes/modifications might be useful to have it be ready for inclusion or a pull-request.

@noldona
Copy link

noldona commented Jul 11, 2022

+1 for this feature. I use Home Assistant would would love to be able to automatically report the server's status to it.

@h3o66 h3o66 linked a pull request Aug 23, 2022 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants