Release Turn Off screensaver
#16
(2018-04-18, 23:14)dag- Wrote: Hi dag,
I have used Turn Off on my raspi3 for a long time without any problems. Now I needed to reinstall Libreelec, cause it didn't starts any more. But now, Turn Off only works in idle mode, when kodi has nothing to do. If music is played, it won't turn off the display. My raspi works only as a music player togeher with a dac and a NAS. I have tried everything in the configuration but nothing helps, any idea?
Thanks
Reply
#17
I'm using a Shield TV and none of the power options seem to work for me to power off the Shield TV when it turns of the screen.
I tries all the options but at my set timer the screen goes black but the Shield TV remains powered on forever.

I remember Kodi had some built in option before to power off because I remember using it but it's no longer available.
Reply
#18
I  currently use Android Power Options screensaver add-on which turns my android box off after 10 minutes of inactivity. The add-on does not work with Kodi v19 so while looking for an alternative I came across Turn Off screensaver. Using Turn Off, I have set Display method to Do nothing and set Power method to Android Power key event (using input) but the kodi log shows an error when Turn Off runs and the box stays on.

The kodi log file shows :-
2020-12-31 17:13:22.079 T:17546   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.IndexError'>
                                            Error Contents: list index out of range
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/screensaver.turnoff/screensaver.py", line 259, in onInit
                                                self.power = POWER_METHODS[power_method]
                                            IndexError: list index out of range
                                            -->End of Python script error report<--

Am I misunderstanding how the Android Power Key setting should work? Is there any way to use the Turn Off add-on to turn the box off?
Reply
#19
Hi dag,

Your screensaver is exactly what I've been looking for. If I understood it correctly it could be used to cut off the video signal coming from a Raspi and so would not prevent devices such as AV receivers from turning off. The AV receiver would simply assume the Raspi no longer present as a source.

Unfortunately the screensaver doen't work in this way on my Raspi 2 and Kodi 18.9. If I select as method "No Signal from Raspberry Pi (using vgencmd)" Kodi displays the following error message: "Exception running 'vgencmd': [Error 2] No such file or directory". However I checked and vgencmd is present at its usual location (/opt/vc/bin) and /opt/vc/bin is included in the PATH variable.

Is this a knows issue? Do you have any hint how to fix it?

Thank you in advance for your help.

Kind regards,
Harald
Reply
#20
(2021-02-18, 16:20)harry72 Wrote: Hi dag,

Your screensaver is exactly what I've been looking for. If I understood it correctly it could be used to cut off the video signal coming from a Raspi and so would not prevent devices such as AV receivers from turning off. The AV receiver would simply assume the Raspi no longer present as a source.

Unfortunately the screensaver doen't work in this way on my Raspi 2 and Kodi 18.9. If I select as method "No Signal from Raspberry Pi (using vgencmd)" Kodi displays the following error message: "Exception running 'vgencmd': [Error 2] No such file or directory". However I checked and vgencmd is present at its usual location (/opt/vc/bin) and /opt/vc/bin is included in the PATH variable.

Is this a knows issue? Do you have any hint how to fix it?

Thank you in advance for your help.

Kind regards,
Harald
Does it work manually from ssh?

Code:
vcgencmd display_power 0
Code:
vcgencmd display_power 1
Reply
#21
(2021-02-18, 23:32)mariofenech Wrote:
(2021-02-18, 16:20)harry72 Wrote: Hi dag,

Your screensaver is exactly what I've been looking for. If I understood it correctly it could be used to cut off the video signal coming from a Raspi and so would not prevent devices such as AV receivers from turning off. The AV receiver would simply assume the Raspi no longer present as a source.

Unfortunately the screensaver doen't work in this way on my Raspi 2 and Kodi 18.9. If I select as method "No Signal from Raspberry Pi (using vgencmd)" Kodi displays the following error message: "Exception running 'vgencmd': [Error 2] No such file or directory". However I checked and vgencmd is present at its usual location (/opt/vc/bin) and /opt/vc/bin is included in the PATH variable.

Is this a knows issue? Do you have any hint how to fix it?

Thank you in advance for your help.

Kind regards,
Harald
Does it work manually from ssh?

Code:
vcgencmd display_power 0
Code:
vcgencmd display_power 1


Hi Mario,

Thanks for responding so quickly.

Yes, if I type the commands on the console via SSH they work (even without "sudo", etc.). On the console
Code:
display_power=0
and
Code:
display_power=1
is displayed then.

Perhaps it makes a difference that I am using OSMC?
Would it help to add the full path to vcgencmd in screensaver.py?

Thank you in advance for your help.

Harald
Reply
#22
(2021-02-19, 01:47)harry72 Wrote:
(2021-02-18, 23:32)mariofenech Wrote:
(2021-02-18, 16:20)harry72 Wrote: Hi dag,

Your screensaver is exactly what I've been looking for. If I understood it correctly it could be used to cut off the video signal coming from a Raspi and so would not prevent devices such as AV receivers from turning off. The AV receiver would simply assume the Raspi no longer present as a source.

Unfortunately the screensaver doen't work in this way on my Raspi 2 and Kodi 18.9. If I select as method "No Signal from Raspberry Pi (using vgencmd)" Kodi displays the following error message: "Exception running 'vgencmd': [Error 2] No such file or directory". However I checked and vgencmd is present at its usual location (/opt/vc/bin) and /opt/vc/bin is included in the PATH variable.

Is this a knows issue? Do you have any hint how to fix it?

Thank you in advance for your help.

Kind regards,
Harald
Does it work manually from ssh?

Code:
vcgencmd display_power 0
Code:
vcgencmd display_power 1


Hi Mario,

Thanks for responding so quickly.

Yes, if I type the commands on the console via SSH they work (even without "sudo", etc.). On the console
Code:
display_power=0
and
Code:
display_power=1
is displayed then.

Perhaps it makes a difference that I am using OSMC?
Would it help to add the full path to vcgencmd in screensaver.py?

Thank you in advance for your help.

Harald
I m not sure how OSMC works but it might be that you need to send the command as root user as you r saying but that might need a bit more fiddling then just changing command and adding path...but you can always try.
Saying that i use Turn Off all the time and it's incorporated in my power button script and works fine on LibreElec via CEC turn off and on..now i just tried screen power off and it also works without any errors..
I would open a ticket on Github perhaps Dev can help you..
Reply
#23
(2020-12-31, 19:23)tt4079 Wrote: I  currently use Android Power Options screensaver add-on which turns my android box off after 10 minutes of inactivity. The add-on does not work with Kodi v19 so while looking for an alternative I came across Turn Off screensaver. Using Turn Off, I have set Display method to Do nothing and set Power method to Android Power key event (using input) but the kodi log shows an error when Turn Off runs and the box stays on.

The kodi log file shows :-
2020-12-31 17:13:22.079 T:17546   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.IndexError'>
                                            Error Contents: list index out of range
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/screensaver.turnoff/screensaver.py", line 259, in onInit
                                                self.power = POWER_METHODS[power_method]
                                            IndexError: list index out of range
                                            -->End of Python script error report<--

Am I misunderstanding how the Android Power Key setting should work? Is there any way to use the Turn Off add-on to turn the box off?

I have tried 5 android boxes and I cannot get the Android Power Key Event to work. Has anyone had any luck getting this to work on an android box?
Reply
#24
(2021-02-19, 12:51)mariofenech Wrote:
(2021-02-19, 01:47)harry72 Wrote:
(2021-02-18, 23:32)mariofenech Wrote: Does it work manually from ssh?

Code:
vcgencmd display_power 0
Code:
vcgencmd display_power 1


Hi Mario,

Thanks for responding so quickly.

Yes, if I type the commands on the console via SSH they work (even without "sudo", etc.). On the console
Code:
display_power=0
and
Code:
display_power=1
is displayed then.

Perhaps it makes a difference that I am using OSMC?
Would it help to add the full path to vcgencmd in screensaver.py?

Thank you in advance for your help.

Harald
I m not sure how OSMC works but it might be that you need to send the command as root user as you r saying but that might need a bit more fiddling then just changing command and adding path...but you can always try.
Saying that i use Turn Off all the time and it's incorporated in my power button script and works fine on LibreElec via CEC turn off and on..now i just tried screen power off and it also works without any errors..
I would open a ticket on Github perhaps Dev can help you..

I see your point. In my setup changing
Code:
vcgencmd
to
Code:
/opt/vc/bin/vcgencmd
in 'args_off' and 'args_on' ultimately solved the issue. Now HDMI signal turns off as expected.

Thanks for your work.

Harry
Reply
#25
So now the Raspberry PI Kodi distribution OSMC switched to Kodi 19 Matrix, and the aged "Pimon" screen saver is no longer available.
The "Turn Off" screensaver seems to be the choice for a replacement. Testing it very quickly this morning, the screen goes correctly into power saving, but unfortunately it doesn't seem to come back. The remote control seems to go to never-never-land, even if I intentionally set incorrect power saving options and the screen stays on. Anyone have good ideas what could be causing this, before I have more time to mess around with it?
Reply
#26
Hi, the only feature I wish to use is "log off user" but this seems to have no effect. I'm using OSMC on a Vero4k.
Reply
#27
(2021-08-09, 09:43)ExTechOp Wrote: So now the Raspberry PI Kodi distribution OSMC switched to Kodi 19 Matrix, and the aged "Pimon" screen saver is no longer available.
The "Turn Off" screensaver seems to be the choice for a replacement. Testing it very quickly this morning, the screen goes correctly into power saving, but unfortunately it doesn't seem to come back. The remote control seems to go to never-never-land, even if I intentionally set incorrect power saving options and the screen stays on. Anyone have good ideas what could be causing this, before I have more time to mess around with it?
I was attempting to use DPMS (built-in) and a I above said, I suspect it's also shutting down everything on Raspberry Pi 2 that is USB-powered, including the keyboard and ethernet, since the device disappeared off my network when the screen saver activated.

However, following the hints above I found out that from a ssh shell, /opt/vc/bin/vcgencmd display_power 0 does switch the display off, and parameter 1 restores it. So the issues using vcgencmd seem to only be related the path.

Editing the file .kodi/addons/screensaver.turnoff/screensaver.py I changed the vcgencmd to include the full path I've given above, so in this file you have the following:
 
Code:
22      dict(name='no-signal-rpi', title='No Signal on Raspberry Pi (using vcgencmd)',
23           function='run_command',
24           args_off=['/opt/vc/bin/vcgencmd', 'display_power', '0'],
25           args_on=['/opt/vc/bin/vcgencmd', 'display_power', '1']),

This makes the screen saver behave just fine. I'm a bit mystified, was vcgencmd somewhere else along $PATH at some point or what is going on here, how did it ever work without the complete path?
Reply
#28
first thing, nice addon. I wanted to start working on something similar, as I'm coming form old version of KODI recently that didn't have this feature, but this is almost what I needed so you saved me some time. now my question is if it's possible to implement additional feature/option.
This option would be to pause or stop (and remember the played source and position and resumed later) when power button is pushed on the remote.
the reason for this is that I use my lounge KODI box and TVH server as streaming source for wifi connected RPIs with TVH client installed.
Background reason for this is that my family tend to turn off the Lounge KODI box, preventing to use TVH client on RPI boxes in the other rooms. WOL feature is not an option. therefore if anyone pushes power button on the remote control of the lounge KODI box, it will appear as turned off and will fully come back after another power button push.
Reply
#29
Hello,

I'm not able to get something correct with the plugins, and i have doubt about my CEC settings on a rpi4 ,

can anyone share their wokring CEC settings ?

( they should be in ~/.kodi/userdata/peripheral_data/cec_2708_1001_CEC_Adapter.xml or in ~/.kodi/userdata/peripheral_data/rpi_2708_1001_CEC_Adapter.xml )

Thank you !

(NB : i'm able to drive my TV with the "cec-client" )
Reply
#30
Hi, not sure if you are still working on this at all, as it is many years later, but as of right now the add on is not working, and its EXACTLY what i need haha
Reply

Logout Mark Read Team Forum Stats Members Help
Turn Off screensaver0