So I send notification from OH to my mobile devices with Pushover, and send to my TVs with Notifications for Android but I’ve run into an issue sending notifications to my Linux desktop.
I’m running my main OH install on an RPI and have a separate Linux desktop on the same LAN running Ubuntu. On that desktop, I’ve also installed OH and do a few things on it by connecting via MQTT to my main OH install.
My idea was to send an MQTT message from my main server to my desktop and use the exec binding to run a program on the desktop to send the notification to Gnome. I’ve tried using notify-send, which does exactly what I’m looking for (sending a popup notification directly into my Gnome desktop), however there doesn’t seem to be a reasonable way to get my “openhab” user to be able to send a notification using notify-send to my desktop user’s desktop without defeating a bunch of security.
So: Since I cannot be the only person trying to send notifications to a Linux desktop on the same LAN as my OH server, wondering what others are doing to accomplish this?
I use Pushover for notifications on my Linux desktop using a pinned browser tab. The first thing I do is open a browser after logging in. The browser will restore the pinned tab. After that I never close the browser… until the computer is shut down again.
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
4
Do you guys remember the old active background option in Windows XP?
Where you could set the desktop picture as a website?
Apparently, there’s a way to do something similar in Linux.
(I haven’t tried this, but I like the idea of using a desktop background as a permanent status monitoring / messaging method)
It would be easy enough to create a Dashboard within openHAB2.
Thanks for the ideas. I took a look at the wall command and it seems that it can only sends messages to users logged directly into an actual terminal session on a TTY and does not affect GUI users even when running a virtual terminal in a GUI.
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
12
Sorry Tom
It read at first glance like it created a pop up in a GUI.
There must be something out there that does what you want, surely you’re not the first person to want this kind of pop-up in Linux.
Out of curiosity, do you want a pop-up on top of whatever the user is doing, or do you want a monitoring window that you can push alerts / updates into?
Update
I’ve found this in a thread from 2010, so it might not be valid anymore.
According to the man pages, wall only accept the content of a file or input after wall command.
It depends on the window manager if the message is displayed, you need to have notifications enabled.
The thread goes on in more detail about the Wall command, comment #13 might be of use to you.
The more I think about what you’re trying to achieve, the more I like the idea of being able to push popups to Windows and Linux users on a LAN from openHAB2.
I can think of a number of serious and playful uses for it.
This is the build in notification from Gnome and is accessed by the super simple command:
notify-send -i /etc/openhab2/icons/classic/oh.jpg "openHAB" "The Washing Machine has completed a cycle"
The issue is that this typically only works when sent by the currently logged in user. there are many scripts out there to also make this work form the root user, but there doesn’t seem to be a way to do this from the user that OH is running under without disabling some security.
I took a look at that thread and I think it is going to have the same issue, where this scheme would work as the root user, but I don’t think the OH user is going to have permission to do this.
2 Likes
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
14
Unfortunately this doesn’t help. In this example the user could send messages to his desktop running notify-send as sudo but not as his regular user. That isn’t the issue I have. For me, notify-send either as my desktop user or using it with sudo (as root) sends messages to my desktop without issue.
What I cannot do is have my openhab user send a desktop message with notify-send to my desktop user’s desktop.
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
16
How frustrating.
There must be a solution that those pesky IT administrators use…
Well, I think I just found a path to do what I wanted, it is a MQTT to notify-send bridge. Its gets around the issue of running as a different user because it runs as your desktop user… I did a little testing and this will do exactly what I was looking for. Just stinks that it is 'yet another program" I have to maintain. too bad OH cannot do this on its own.