Screensaver\Keymap\Runscript problem on Raspberry Pi3 (osmc)
#1
Hello All

Long time fan, first time poster....

I have a raspberry Pi 3 setup with osmc and have been using these setups for years now but I've run into an minor problem that I just can't seem to solve.

In my office\guest room I have a very basic 32 inch monitor for work, but I have been working on a little project to set it up as a smart TV for any guests that stay (so it needs to be very simple to operate - think mother-in-law!).
To switch the monitor off or on, I have a python script that detects the state of a smart plug and turns it off if currently on, or on if currently off. I trigger the script via the power button on one of those very basic RF Kodi remotes using keymap.
It all works well apart from one frustrating problem: If the screensaver has kicked in, the script just isn't triggered! I can press the Home button on the remote to get out of the screensaver and can then turn the monitor on\off (but that is not gonna fly with Mother).

Any thoughts on what could be happening here? Runscript is obviously working, cuz as soon as I exit screensaver it triggers successfully... I've scoured the Kodi.log intently and don't see any clue there - just nothing happens, nothing logged when in screensaver, script is logged when not in screensaver. I've also tried multiple global\fullscreenvideo\visualisation XML setups in the keymap file all to no avail.

Any help is appreciated!
Reply
#2
I suggest you post on osmc forums as there may be some special actions due to screensaver which have to be worked around.
Derek
Reply
#3
You got me thinking that I wasn't wedded to OSMC so I just put a fresh build of LibreELEC on it and it has exactly the same problem.

I feel like I could be missing some simple keymap entry? I know the the Global settings in keymap are a fallback and don't trigger in every circumstance (I've had to add FullScreenVideo and PVR keymap section to combat this in the past)... Am I missing a screensaver window setting somehow? I can't see anything obvious!
Reply
#4
Are you sure, the script isn't triggered or is it just the fact the it doesn't turn the monitor off?

Could you try sending some actions to Kodi while using that script? something like that Action(Back) and probably sending it twice (noticed myself that I need to do that twice with Yatse to get out of the screensaver-mode) and then let the rest of the script run? probably with a "sleep" of a second in between?!
Reply
#5
Hi DaVu
Yes, the script is definitely NOT triggered because there is silence in the Kodi.log at the exact time that I press the button (no lines in the log at or near the time). Conversely, at other times - when not in Screensaver - the script triggers and you can clearly see the runscript details at the exact time in kodi.log.
What I do notice in the log is that the screensaver seems to have no window name - it states "Window Init ()". So I can't help but feel the Keymap "Global" fallback is not working in the screensaver window, but also no other window is initiated either so there is no known window for keymap to trigger?
Thoughts anyone?
Reply
#6
could you show us the script you've written?

If I try to activate the screensaver I see that Window() is initialized. Using a kodi-send command (kodi-send --action=Up) is directly interpreted then. Using Yatse or a IR remote, those commands are triggered as well. So I'm really wondoring what's different on your side. Probably it's related to RF remotes?!
Reply
#7
(2018-03-06, 07:41)DaVu Wrote: could you show us the script you've written?

If I try to activate the screensaver I see that Window() is initialized. Using a kodi-send command (kodi-send --action=Up) is directly interpreted then. Using Yatse or a IR remote, those commands are triggered as well. So I'm really wondoring what's different on your side. Probably it's related to RF remotes?!
"kodi-send --action=Up" brings Kodi out of the screensaver just fine but I'm not trying to exit the screensaver with this script - the script turns the smart plug on\off to turn the (power to the) monitor off... My problem is that it just does not trigger when the screensaver is on. 

I also replaced the runscript entry in the Keymap file with ActivateWindow(Home) and that did nothing also (again nothing in the Kodi.log)... I know the RF remote works because the other buttons on it bring Kodi out of screensaver but as soon as I customise them via Keymap they fail in screensaver.

I feel like I'm probably not explaining myself very well.... My basic requirement is I want the power button on my remote to toggle my smart plug. I have a python script that works flawlessly to do that, and Keymap successfully triggers that script in every window except screensaver.
Reply

Logout Mark Read Team Forum Stats Members Help
Screensaver\Keymap\Runscript problem on Raspberry Pi3 (osmc)0