2014-07-17, 13:18
Hi together,
I have a problem:
I'm running Raspbmc and managed to install the device to turn on remote triggered sockets (433 Mhz transmitter).
This works fine and I can trigger the sockets with the browser of mobile devices.
Because this is not really comfortable in practice I want to trigger the sockets additionally with the wireless keyboard (for example: F12 on; F10 off)
So I created a keyboard.xml in /home/pi/.xbmc/userdata/keymaps/ and added the following:
<keymap>
<global>
<keyboard>
<F12>XBMC.RunScript(/home/pi/skripte/lighton.py)</F12>
<F10>XBMC.RunScript(/home/pi/skripte/lightoff.py)</F10>
</keyboard>
</global>
</keymap>
I will only describe the lighton.py script. The other one is similar.
lighton.py:
#!/usr/bin/python
import sys
import subprocess
subprocess.call(["/home/pi/skripte/lighton.sh"], shell=True)
I applied the rights to all scripts (py and sh): chmod +x ...
lighton.sh:
cd ~
./send 11010 2 1
This is my setup.
When I run the lighon.py script with:
./lighton.py
the script calls lighton.sh and triggers the socket! It works!
But when I press the F12 button on my keyboard, nothing happens. So the problem must be between the keyboard.xml and the lighton.py script.
Does anyone have an idea what to do?
Thank you very much!
greetings,
krassor
I have a problem:
I'm running Raspbmc and managed to install the device to turn on remote triggered sockets (433 Mhz transmitter).
This works fine and I can trigger the sockets with the browser of mobile devices.
Because this is not really comfortable in practice I want to trigger the sockets additionally with the wireless keyboard (for example: F12 on; F10 off)
So I created a keyboard.xml in /home/pi/.xbmc/userdata/keymaps/ and added the following:
<keymap>
<global>
<keyboard>
<F12>XBMC.RunScript(/home/pi/skripte/lighton.py)</F12>
<F10>XBMC.RunScript(/home/pi/skripte/lightoff.py)</F10>
</keyboard>
</global>
</keymap>
I will only describe the lighton.py script. The other one is similar.
lighton.py:
#!/usr/bin/python
import sys
import subprocess
subprocess.call(["/home/pi/skripte/lighton.sh"], shell=True)
I applied the rights to all scripts (py and sh): chmod +x ...
lighton.sh:
cd ~
./send 11010 2 1
This is my setup.
When I run the lighon.py script with:
./lighton.py
the script calls lighton.sh and triggers the socket! It works!
But when I press the F12 button on my keyboard, nothing happens. So the problem must be between the keyboard.xml and the lighton.py script.
Does anyone have an idea what to do?
Thank you very much!
greetings,
krassor