Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: option to switch a display #100

Open
rpring01 opened this issue Apr 21, 2024 · 7 comments
Open

Feature request: option to switch a display #100

rpring01 opened this issue Apr 21, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@rpring01
Copy link

Would it be possible to have a switch similar to the power off but only turn off/on the display. I am currently using the shell command 'xset -display :0 dpms force off' or 'xset -display :0 dpms force on'.
The mqtt option would avoid the ssh authentication issue.
I am trying to automate the touchscreen connected to the pi.
Thank you

@hjelev
Copy link
Owner

hjelev commented Apr 24, 2024

Hi,
Yes I'll add this, it also works on ubuntu out of the box.
I am doing the same but with another script and use "ddcutil --display 1 setvcp 60 17" but this needs additional software + guessing the numbers after setvcp.
Do you happen to know a command that will output the status of the monitor(s) - I am using 2 monitors and your command works for both.

@rpring01
Copy link
Author

I am not sure of the command to check monitor status, my display is connected to the dsi port not hdmi. Although if you put -q at the end of the command you can see monitor status at the end of the list.

@hjelev
Copy link
Owner

hjelev commented May 7, 2024

I have introduced the first iteration of your feature request.
If you reinstall the script it should work, else if you update you need to manually update os_user="your usedrname" this is needed as the service needs to run as root in order to shutdown/restart and to control displays it needs the user.
I plan to improve this to a switch with status, but lets see how this works.

@hjelev hjelev added the enhancement New feature or request label May 8, 2024
@rpring01
Copy link
Author

I have reinstalled the script but don't see the option in HA to switch off the display, how do I use or test the function?

@hjelev
Copy link
Owner

hjelev commented May 24, 2024

in the config.py there is a variable that is set to false by default
display_control = False
You need to change this manually to True
I'll update the installation script to ask for this or auto detect if there are monitors attached (if possible)

@rpring01
Copy link
Author

the display switch is working well thank you. is it possible to have a sensor show the status of the display to use in an automation? for the automation to work correctly I need to know if the display is on.

@hjelev
Copy link
Owner

hjelev commented Oct 18, 2024

I'll look into this - should be possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants