MQTT Notification MacOSX, Automator and Login Item

I use MQTT to control a lot of things in my apartment, but I also want to send some Notification to my Macbook, for this i wrote a small Python script and add some automagic.

First I nedd a way to show Notifications from the Terminal, therfor I use the Terminal Notifier. The Script don't use the installed Version, to have control over the path of it I add the app File in my Projektfolder. After it I write a small Python-Script which connect to the MQTT-Broker, get the incomming Messages and pars the JSON. The Python script calls the Terminal Notifier with the given information from the MQTT-Message.

You can find the Script at Github.

After this i need to create a Application from this Python script. I use Automator and add a Shell scipt as action.

After testing I create a Application File based on the Script.  Maybe you need first to convert it to a "Application" ("File" -> "Convert To" -> choose "Apllication"). After it you can save it ("File" -> "Save") and choose "Application" as "File Format" at the bottom of the PopUp.

Now you can set this Application as Login Script ("System Setttings" -> "User and Group", choose your Username, click "Login Items" and add the Application you create before).

 More Infos:




Veröffentlicht: 17.01.2018