WIthin openhab I send the correct MQTT messages to my broker either via switch or e.g. via my motion detector. Depending on your system you may need to use a different command to turn on/off the screen (e.g. tvservice).
I’m not sure if RPi 4 has already WoL. The RPi 3 doesn’t so I have no way to put it to sleep and wake it up via a trigger (switch/motion detector). Except of course you can control the power supply or power outlet. For me this is not big issue since the power consumption of the PI is very low and I turn off the monitor anyway.
In my system I react on different events from openHab published on the Event Bus. Not sure if this is the most elegant solution but it works. Depending on those events, I trigger different states on my application (e.g. switch the view).
Thank you very much for the great, fast and detailed response Wolfgang! I will directly start to implement it.
WoL in not implemented in the RPi4. There is an hardware extension for RPI available but as you mentioned the power consumption is not a big deal.
the „launcher.conf“ I copied in basic folder (not in root):
**pi@fullpageos** : **~ $** ls
**Downloads** launcher.conf mosquitto-repo.gpg.key mqtt_test.py **scripts**
and looks like:
mqtt_broker = '192.168.xxx.xx' # here I put IP of my Rasp (FullscreenOS)
mqtt_port = 1883 # default: 1883
mqtt_clientid = 'mqtt-wallpanel'
mqtt_username = 'pi' # here I put user („pi“) of my Rasp (FullscreenOS)
mqtt_password = 'xxx' # here I put user pw of my Rasp (FullscreenOS)
topiclist = {
# topic payload value program & arguments
"wallpanel/monitor" : {
'off' : [ 'vcgencmd display_power 0' ],
'on' : [ 'vcgencmd display_power 1' ]
},
"wallpanel/system" : {
'reboot' : [ 'sudo reboot' ],
},
}
The mqtt command I sent in MQTT.fx application was "cmd/wallpanel/monitor“ and „on“ /„off“ => THIS DOES NOT WORK SO FAR!
I guess it is a simple beginner failure…hope you can help…
Finally the OH settings:
The broker with the following Thing in OH is online:
Do your files really have the lower speech marks: „ and ‚ ? I’ve never seen these used before - perhaps they are the issue? Try changing them to " and ’
Didn’t see your mqtt broker config, but as for me, I’m using the eclipse-mosquitto docker image for my broker. There I don’t provide a user/pwd because everything is running in my local network on a separete LAN anyway. Maybe that’s the issue already, because you write you are provding the user/pwd of the Pi? The broker user/pwd does not necessarily be the same as the Pi user (depends on your config).
For testing I’m using this http://workswithweb.com/mqttbox.html here to connect and send/receive messages. Works quite well. You will see there immediately if you have e.g. a connection issue or something else. Just create a MQTT client, enter your settings and connect. If it is connected you can try out to send messages to your fullscreen OS without openHAB to test that direction first.
Thank you for the quick response. You are right! The speeck marks in my original code is ok (as you mentioned). It was a “copy-past” error from my side when I prepared this post in my mail program and past it here. I corrected my post.
when I put in the “off” / “on” command in MQTT-Box after running “mqtt-launcher.py” manually (in Terminal). That indicate for me, that mqtt-lancher is running!? The monitor does not react
When I put in the “vcgencmd display_power 0/1” command directly (in Terminal)…the monitor switched OFF/ON.
It is internal of android but…
I’ve had hook and old android box to a HDMI touch panel and the android box Android is not able to shut DowN display by an MQTT order…
Maybe my android version is too old to have this right or it can’t drive the HDMI box components…
I described my way a few posts up: Self made wall touch panel project - #41 by sheppard
Basically I run a MQTT service on my FullPageOS (it’s just Linux under the hood) and subscribe to specific events. Those are triggering some scripts or linux commands.
I have similar project, however I am still searching a way to configure wifi over UI without needing to use the text file in order to change the wifi credentials. Do you have a suggestions ?