MQTT Client written in Python for turning HDMI screen power on and off. Made for the Rapsberry Pi 3B+ which is using a third-party touch screen which does not completely switch off the screen with screensaver / power saving
-
Copy
config.template.py
toconfig.py
and change the properties to your MQTT setup/preferences -
Install
paho-mqtt
pip install paho-mqtt
-
Run
python paho-mqtt
Example use in Home Assistant
switch:
- platform: mqtt
name: "Touch Panel"
icon: mdi:tablet
command_topic: "screen/rpi"
payload_on: 'on'
payload_off: 'off'