Closed tommy86geis closed 4 years ago
Hi yes this works. Please check
screenConfig
toggleMonitor
turnOnHour
turnOffHour
in config\config.json
You can check what toggles your display (trace down the toggleMonitor key, kris711 mentioned above) and execute these commands as an admin action. This is what I did
ok, how can i check that out? can you give me your code? i don't know how the admin action is working.
providing my code would not help, since I use a very special display, that works a little different (Sunfounder 10.1")
Have a look at the files in /config/screens/
. I guess, you're using a default HDMI screen (i.e. using hdmi_default.js
). There you find the bash commands for turning on and off the screen's backlight (cmdBacklightOff
and cmdBacklightOn
). With these commands you can add two admin actions to your config file. See the readme for how to use admin actions or look at the examples in the /js/defaultConfig.js
. Your config should be extended with something like this:
whitelistAdmins: [YOUR CHAT ID],
adminAction: {
//Global Switch to enable the Admin-Actions
allowAdminAction: true,
//Defines an array of action-objects
actions: [
// Admin-Action for starting the OpenVPN-Client
{name: "turnDisplayOff", command: "tvservice -o", enable: true},
// Admin-Action for stoping the OpenVPN-Client
{name: "turnDisplayOn", command: "tvservice --preferred && sudo chvt 6 && sudo chvt 7", enable: true}
]
}
maybe its easier: Which hardware (Monitor) do you use?
I use a normal Monitor over HDMI. Only Switch Signal Off and on. So the Monitor switch off If there is no Signal
Good. In this case, the config lines I suggested above should work for you. To toggle your monitor, send "/turnDisplayOff" or "/turnDisplayOn" to your bot
It is working perfectly. Thanks a Lot
Is ist possible to switch Display on and off over telegram?