HELP - Harmony remote / OpenElec Custom Buttons?
#16
Hi

I enabled the Sony protocol along with the others in ir-keytable and now when I press that new custom button that was learnt from the old Sony TV remote I get a response, see screen shot. So what next?

Image

I looked at the MCE Extender device in the Harmony software I don't think there is enough unused buttons to use. Id much rather be able to create my own new ones and not be limited if at all possible.

I am willing to PayPal some cash to anyone who can assist me. Ideally I'd like to use the default IR stuff in OpenElec i.e. eventlircd as my ultimate goal is to use irexec with Curl to send http commands to my home automation system. This works as described here And I was able to assign two existing MCE buttons on the remote control handset, to turn on / off my lights. However I really need to be able to create my own new custom buttons, what are not used for normal functions in XBMC.

Thanks
Reply
#17
I found an interesting thread about the MCE IR Keyboard

mce keyboard is by default disabled as a input device
/sys/class/rc/rc0/protocols protocol mce_kbd (disabled)

enabling device with
echo +mce_kbd > /sys/class/rc/rc0/protocols

brings it up, but very soon the input of the mce keyb. (harmony profile) is getting uncontrollable
the pressed keys will be repeated several times.

more about this problem on:

http://forum.stmlabs.com/showthread.php?...9#pid41559

If I run that command to enable mce_kbd then my Harmony remote control handset programmed as the MCE Keyboard device, kinda works in XBMC but I have the issue of the repeated presses / commands. Also IRW and ir-keytable -t don't show any response for the QWERTY buttons / commands but do for the MCE commands.

But I am wondering if it would then be possible to use these Keyboard QWERTY commands being send from the IR remote, like F1,F2, or Letters A-Z etc to do stuff in XBMC, or to run my irexec / curl commands for the home automation system.

So I then copied the default Keyboard.xml file and placed it in my Userdata\keymaps folder. I then added this line in to the Global section:

<F1>XBMC.UpdateLibrary(video)</F1>

Now when I press F1 on the Harmony remote control handset (MCE Keyboard) the Video library update routine is run in XBMC ! So it appears to work.

Next I need to figure out how to use a keyboard shortcut such as F5 to run a CURL / http command ?

EDIT: The F1 command is sent multiple times due to this repeating issue, so the Update Video Library command is also sent over and over to XBMC.
Reply
#18
OK I am making some progress I think.

I have one of these IR MCE Keyboards which are highly recommended for any Logitech Harmony owner as you can use this IR keyboard to teach your Harmony any keyboard shortcut combination.

I just taught my Harmony remote control handset the Ctrl+Alt+A command under the "Windows Media Center SE" device.

In the XBMC keyboard.xml file I added this line:

<A mod="ctrl,alt">XBMC.UpdateLibrary(video)</A>

So when Ctrl+Alt+A is pressed either on an actual keyboard or when this command is sent from the Harmony IR remote control handset the Video Library will be updated. Which now works perfectly no multiple commands / presses being sent as with the "MCE Keyboard" device which I have now removed from the Harmony software.

So I can now use any keyboard shortcut such as Ctrl+Alt+A or Ctrl+Alt+Z and using the XBMC keyboard.xml file I can run any of the available functions of XBMC.

I also added this line: echo +mce_kbd > /sys/class/rc/rc0/protocols in to my OpenElec autostart.sh file, to enable the MCE KBD protocol each time.

So far so good!

So now I need a way to be able to run a curl / http command when I use one of these new Ctrl+Alt+(Letter) keyboard shortcuts, to in-turn send http commands to my Home Automation system, for actions like turning lights on and off in the house. Which will turn a bog standard IR Harmony remote in to a Z-wave remote via the XBMC HTPC.
Reply
#19
My Linux skills are not great but I just created two shell scripts in this folder:

/storage/.xbmc/userdata/vera

mbed-lightson.sh
mbed-lightsoff.sh

In side the Lights On script I have this code, which uses Curl to send a http request to the Home Automation system (Vera) to turn ON some lights.

Code:
#!/bin/sh
curl "http://192.168.1.100:3480/data_request?id=lu_action&output_format=xml&DeviceNum=16&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1"

In side the Lights Off script I have this code, which uses Curl to send a http request to the Home Automation system (Vera) to turn OFF some lights.

Code:
#!/bin/sh
curl "http://192.168.1.100:3480/data_request?id=lu_action&output_format=xml&DeviceNum=16&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0"

I made these scripts executable with the chmod +x command.

In terminal I can now run these two scripts and the lights turn on or off

Image

Now how can I run the mbed-lightson.sh script when I press a keyboard shortcut Ctrl+Alt+A and run the other mbed-lightsoff.sh script when I press a keyboard shortcut Ctrl+Alt+B ?

That is the final step to solve.

Thanks
Reply
#20
I just tried adding these two lines in to the keyboard.xml file

<A mod="ctrl,alt">System.Exec(/storage/.xbmc/userdata/vera/mbed-lightson.sh)</A>
<B mod="ctrl,alt">System.Exec(/storage/.xbmc/userdata/vera/mbed-lightsoff.sh)</B>

But nothing happens and the script(s) are not run when I initiate the keyboard shortcuts.

I asked the question here on a new thread.
Reply
#21
Hi

I've just uploaded a blog post titled: XBMC OpenElec / Logitech Harmony / Micasaverde Vera integration

The Media Center Blog
The Digital Lifestyle

Turn your bog standard Logitech Harmony IR remote control in to a Home Automation controller via your XBMC PC. Wink
Reply
#22
don't want to highjack this topic,
but i got a question about how you've set it up.

i want to make a switch from windows to openelec.
under windows everything works great with my Logitech Harmony Ultimate/900+ MCE Reciever and XBMC with my custom keyboard.xml
but when switching to openelec all my custom edits in the keyboard.xml don't work anymore.
under windows i use the mce remote + mce keyboard as devices,
this way i can make use of extra keys.

i now understand from your post that when you enable the mce keyboard in openelec (echo +mce_kbd > /sys/class/rc/rc0/protocols)
i would be able to use keyboard commands.
but i read on the openelec forum that people got issues like double key press when enabling the mce keyboard.
LibreElec Kodi | Aeon MQ ?
Reply

Logout Mark Read Team Forum Stats Members Help
HELP - Harmony remote / OpenElec Custom Buttons?0