libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Questions and comments specific to a particular plugin should go here.

libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby kasinator » Thu Dec 12, 2013 7:11 pm

I've stumbled upon this hardware for below 40€
http://www.pulse-eight.com/store/produc ... apter.aspx
With it, I'm able to control my home cinema like with an ir control and! get status information back, even those that were not requested like somebody turned off tv via local standby button.
I myself plan to use it to redirect windows audio out to either amp or tv whether amp is on or off.
And everything neatly integrated into the hdmi cable without additional visible cabling.
It's also in principle possible to control media center by tv remote.
As there was no plugin available I created a wrapper plugin for the client application that was delivered with the hardware.
Under http://www.cec-o-matic.com you can analyze what traffic is flying around and what commands you would like to send.

Working
-Start stop plugin
-Control volume on Samsung amp connected via tv
-turn on or off amp
-turn on LG tv. Off is not possible due to LG bug
-Transmit virtual Ir commands
-send commands to client app
-Send any command over cec bus
-get events from cec traffic
-parameterized client path
-link to this thread for support
-added parameters to use persistant settings in usb adapter
-added logging for the libCEC client version (easier visible now)
-added config option to create events during init-phase
-added Error events and full logging
-added Onkyo TX-SR578 events (in AVR group)

Open
nothing planned so far

I started to communicate over this plugin here:
http://forums.pulse-eight.com/yaf_posts ... x#post9348
http://www.thegreenbutton.tv/forums/vie ... hp?p=66729

My Config:
Software
Program Version: 0.4.1.r1640
Build Time: Di, 03 Sep 2013 06:05:09
Python Version: Stackless Python 2.6.5 final 0
wxPython Version: 2.8.12.0

System
Operating System: Microsoft Windows 7 Ultimate SP1, 64-bit (build 7601)
CPU: AMD Athlon(tm) X2 Dual Core Processor BE-2350
RAM: 4063 MB

USB-Devices
X10 USB Wireless Transceiver (ACPI-compliant): USB\VID_0BC7&PID_0006
Pulse-Eight USB to HDMI CEC Adapter (rev.2): USB\VID_2548&PID_1002&MI_00

libCEC 2.1.3
Attachments
__init__.py
Put to eventghost plugin directory libCEC, version 0.3
(11.97 KiB) Downloaded 712 times
__init__.py
Unpack to eventghost plugin directory libCEC . version 0.2 <outdated
(6.21 KiB) Downloaded 316 times
Last edited by kasinator on Thu Feb 13, 2014 4:35 am, edited 7 times in total.
kasinator
 
Posts: 14
Joined: Tue Dec 10, 2013 7:43 am

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby Livin » Sat Dec 14, 2013 4:50 pm

fyi... correct link... http://www.cec-o-matic.com/
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 790
Joined: Wed Oct 08, 2008 4:56 am

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby kasinator » Mon Dec 16, 2013 10:43 am

millab from PulseEight forum posted:
Code: Select all
Here are the Onkyo AVR ( TX-SR578 ) codes I added into the plugin on my PC :)
It would probably be better to replace the 'Select Input' descriptions with just 'Input 1, Input 2' etc. rather than the actual labels on the Onkyo amp. These may work with other brands?

(hotKeys, 'avr.end', 'AVR End Keypress', 'Signals that the button has stopped being pressed. Use if you find the button being pressed multiple times', u'tx 15:45'),
(hotKeys, 'avr.up', 'AVR Up', 'Press up button or Tuner Up', u'tx 15:44:01'),
(hotKeys, 'avr.down', 'AVR Down', 'Press down button or Tuner down', u'tx 15:44:02'),
(hotKeys, 'avr.left', 'AVR Left', 'Press left button', u'tx 15:44:03'),
(hotKeys, 'avr.right', 'AVR Right', 'Press right button', u'tx 15:44:04'),
(hotKeys, 'avr.setmenu', 'AVR Setup Menu', 'Open Setup Menu', u'tx 15:44:0A'),
(hotKeys, 'avr.exit', 'AVR Exit', 'Exit from Menu', u'tx 15:44:0D'),
(hotKeys, 'avr.enter', 'AVR Enter', 'Enter or Select Item', u'tx 15:44:2B'),
(hotKeys, 'avr.soundfield', 'AVR Sound Field Toggle', 'Toggle between sound fields', u'tx 15:44:33'),
(hotKeys, 'avr.input', 'AVR Input Toggle', 'Toggle between AV inputs', u'tx 15:44:34'),
(hotKeys, 'avr.osd', 'AVR OSD', 'On Screen Display', u'tx 15:44:35'),
(hotKeys, 'avr.volumeup', 'AVR Volume Up', 'Volume Up', u'tx 15:44:41'),
(hotKeys, 'avr.volumedown', 'AVR Volume Down', 'Volume Down', u'tx 15:44:42'),
(hotKeys, 'avr.mute', 'AVR Mute Toggle', 'Toggle between Mute and Un-Mute', u'tx 15:44:43'),
(hotKeys, 'avr.muteon', 'AVR Mute On', 'Turn On Mute', u'tx 15:44:65'),
(hotKeys, 'avr.muteoff', 'AVR Mute Off', 'Turn Off Mute - Restore volume', u'tx 15:44:66'),
(hotKeys, 'avr.input1', 'AVR BD/DVD Select', 'Select Input - BD/DVD', u'tx 15:44:69:01'),
(hotKeys, 'avr.input2', 'AVR VCR/DVR Select', 'Select Input - VCR/DVR', u'tx 15:44:69:02'),
(hotKeys, 'avr.input3', 'AVR CBL/SAT Select', 'Select Input - CBL/SAT', u'tx 15:44:69:03'),
(hotKeys, 'avr.input4', 'AVR GAME Select', 'Select Input - GAME', u'tx 15:44:69:04'),
(hotKeys, 'avr.input5', 'AVR AUX Select', 'Select Input - AUX', u'tx 15:44:69:05'),
(hotKeys, 'avr.input6', 'AVR TUNER Select', 'Select Input - TUNER', u'tx 15:44:69:06'),
(hotKeys, 'avr.input7', 'AVR TV/CD Select', 'Select Input - TV/CD', u'tx 15:44:69:07'),
(hotKeys, 'avr.input8', 'AVR PORT Select', 'Select Input - PORT', u'tx 15:44:69:08'),
(hotKeys, 'avr.input1on', 'AVR BD/DVD Power', 'Select Input - BD/DVD', u'tx 15:44:6A:01'),
(hotKeys, 'avr.input2on', 'AVR VCR/DVR Power', 'Select Input - VCR/DVR', u'tx 15:44:6A:02'),
(hotKeys, 'avr.input3on', 'AVR CBL/SAT Power', 'Select Input - CBL/SAT', u'tx 15:44:6A:03'),
(hotKeys, 'avr.input4on', 'AVR GAME Power', 'Select Input - GAME', u'tx 15:44:6A:04'),
(hotKeys, 'avr.input5on', 'AVR AUX Power', 'Select Input - AUX', u'tx 15:44:6A:05'),
(hotKeys, 'avr.input6on', 'AVR TUNER Power', 'Select Input - TUNER', u'tx 15:44:6A:06'),
(hotKeys, 'avr.input7on', 'AVR TV/CD Power', 'Select Input - TV/CD', u'tx 15:44:6A:07'),
(hotKeys, 'avr.input8on', 'AVR PORT Power', 'Select Input - PORT', u'tx 15:44:6A:08'),
(hotKeys, 'avr.power', 'AVR Power Toggle', 'Toggle Power', u'tx 15:44:6B'),
(hotKeys, 'avr.poweroff', 'AVR Power Off', 'Power Off', u'tx 15:44:6C'),
(hotKeys, 'avr.poweron', 'AVR Power On', 'Power On', u'tx 15:44:6D'),

I plan to include it in V0.3 under group Onkyo when I have enough changes to create another Release.
Other Changes would be: Error-Handler when Adapter is Lost, Client died etc.
Last edited by kasinator on Mon Dec 16, 2013 8:21 pm, edited 1 time in total.
kasinator
 
Posts: 14
Joined: Tue Dec 10, 2013 7:43 am

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby Livin » Mon Dec 16, 2013 3:53 pm

kasinator,
great, looking forward to trying it!
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 790
Joined: Wed Oct 08, 2008 4:56 am

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby millab » Tue Dec 17, 2013 1:51 am

Thanks Kasinator, As I said on the Pulse Eight forum, very happy with how the plugin is working!

I now have my Lenovo bluetooth remote set up to control my entire system, including PS3, PC, Onkyo AVR and Epson projector.

I was even got the Pule Eight to detect when the PS3 turns on (it transmits a code), then eventghost changes the AVR to the GAME input, and pauses anything playing on the PC. When the PS3 turns off again (it transmits another code), then the AVR switches back to the original input and the playback resumes. Works great!

I will be looking at the control codes for the Epson projector tonight, and will also see what codes the PS3 will accept when I get a chance.
millab
 
Posts: 6
Joined: Mon Dec 16, 2013 12:25 am

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby kasinator » Wed Dec 18, 2013 7:15 am

Hi Millab,

It's exactly that kind of automation i had in mind when i bought the adapter and what is impossible with an ir only solution.
Couldn't say it better.
Thanks for the nice reply.

Kasinator
kasinator
 
Posts: 14
Joined: Tue Dec 10, 2013 7:43 am

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby Phileh » Mon Jan 06, 2014 12:32 am

many thanks for the work on this kasinator, i've been watching the forums on and off since the device was launched. i just have one quick question regarding functionality though. i currently have a rainshadowtech usb cec with the rcaware plugin, with this i can control the media centre with my Samsung TV remote (by selecting the media centre as an anynet device) is this something that is supported in this version of the EG plugin?

looking forward to the response and hopefully ordering one of these!
Phileh
 
Posts: 5
Joined: Fri Jun 24, 2011 10:19 pm

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby barnabas1969 » Sun Jan 26, 2014 2:58 am

Kasinator,

Thanks for your work on this. I am finally getting around to testing this. So far, results look good.

One thing though, the way you are starting the cec-client.exe program, all of the persisted settings in the CEC device are getting erased.

I changed your Python script so that it sends the -r argument to cec-client.exe, which causes the persisted settings to be preserved and utilized. Here's the code:

Code: Select all
self.process = Popen( ["c:\Program Files (x86)\Pulse-Eight\USB-CEC Adapter\cec-client.exe", "-r"], stdin=PIPE, stdout=PIPE,startupinfo=info)


Then, I closed EventGhost (completely, not just minimized to the notification area), and opened a command prompt. I executed the cec-client.exe program interactively with the following commands:

Code: Select all
cec-client.exe -o MediaCtr
pa 2200
p 5 2
<wait for libCEC to write new settings to the EEPROM on the device>
q


The commands above set the OSD display name to "MediaCtr", then they set the physical address to 2200, and tell the CEC device that it is connected to port 2 of my audio receiver (device 5, which is in turn connected to port 2 of my TV... hence the physical address of 2200). The "p" command will cause all of the settings to be written to the EEPROM in the device. For some reason, the cec-client program waits a random number of seconds before updating the EEPROM, so you must wait before typing the "q" (quit) command.

Then, the next time EventGhost starts, the libCEC plugin will use the persisted settings in the EEPROM.
barnabas1969
Experienced User
 
Posts: 131
Joined: Sat Feb 04, 2012 1:42 am

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby barnabas1969 » Sun Jan 26, 2014 4:11 am

I found a quirk, and also a nice feature when sending the -r argument to cec-client.exe.

The quirk is that, even though the physical address of the HTPC is already stored in the EEPROM, when the TV asks the CEC device for its physical address, the CEC device responds with an error.

So, as a work-around, I made the plugin send the "pa 2200" and "p 5 2" commands whenever the TV is turned on. This sets the correct physical address in the CEC device, and also causes it to broadcast its physical address immediately... which seems to make the TV acquire the OSD info faster.

The nice feature of using the -r argument is that none of the commands sent by the plugin will cause the cec-client.exe program to write to the device's EEPROM. This is good because an EEPROM has a limited number of write cycles in its lifetime.
barnabas1969
Experienced User
 
Posts: 131
Joined: Sat Feb 04, 2012 1:42 am

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby barnabas1969 » Mon Jan 27, 2014 5:23 am

I am having so much fun with this! I am currently working on emulating my Roku 3 with the CEC plugin for EG! I'm planning to keep my HTPC running 24 hours a day, and I will make the HTPC emulate the Roku. When the TV sends a CEC command to the emulated Roku device, EventGhost will "relay" the message to the Roku device over the network using the plugin I've created (see below).

To do this, I've written a new plugin that sends commands to the Roku via Ethernet/WiFi. I'll create some EG macros and events that cause the libCEC device to respond to the TV as if the Roku actually has CEC capability.

The Roku plugin can be found here:
viewtopic.php?f=9&t=5995#p29548
barnabas1969
Experienced User
 
Posts: 131
Joined: Sat Feb 04, 2012 1:42 am

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby Livin » Mon Jan 27, 2014 3:05 pm

barnabas1969 wrote:I found a quirk, and also a nice feature when sending the -r argument to cec-client.exe.

The quirk is that, even though the physical address of the HTPC is already stored in the EEPROM, when the TV asks the CEC device for its physical address, the CEC device responds with an error.

So, as a work-around, I made the plugin send the "pa 2200" and "p 5 2" commands whenever the TV is turned on. This sets the correct physical address in the CEC device, and also causes it to broadcast its physical address immediately... which seems to make the TV acquire the OSD info faster.

The nice feature of using the -r argument is that none of the commands sent by the plugin will cause the cec-client.exe program to write to the device's EEPROM. This is good because an EEPROM has a limited number of write cycles in its lifetime.


Can you please post your updated libCEC plugin?

thanks
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 790
Joined: Wed Oct 08, 2008 4:56 am

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby barnabas1969 » Mon Jan 27, 2014 7:56 pm

Livin wrote:Can you please post your updated libCEC plugin?

thanks

I could, but all I changed was one line (line # 66).

I changed this:
Code: Select all
self.process = Popen( ["c:\Program Files (x86)\Pulse-Eight\USB-CEC Adapter\cec-client.exe"], stdin=PIPE, stdout=PIPE,startupinfo=info)


to this:
Code: Select all
self.process = Popen( ["c:\Program Files (x86)\Pulse-Eight\USB-CEC Adapter\cec-client.exe", "-r"], stdin=PIPE, stdout=PIPE,startupinfo=info)


The other commands that set the physical address and port are just actions in my EG configuration. They are triggered 5 seconds after EG starts (5 seconds to give the plugin time to connect to the CEC device), and also whenever the TV turns on.

I plan to post my EG configuration tree when I'm finished with the setup. Of course, it will only help someone get started because some of the commands are specific to my setup (Samsung PN64D8000, Yamaha RX-A2010, Roku 3).

I wrote a new plugin yesterday to control the Roku 3 over the network. I am going to work on my EG configuration today. I want to setup EG so that EG will emulate the Roku, so that the TV thinks that the Roku is a CEC device. This will enable control of the Roku with the TV remote, and will add the Roku to the OSD source menu on the TV. The reason for doing this is to make it as simple to operate as possible for my wife, kids, and visitors.
barnabas1969
Experienced User
 
Posts: 131
Joined: Sat Feb 04, 2012 1:42 am

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby barnabas1969 » Tue Jan 28, 2014 1:09 am

In order to get the Roku to work as a playback device (logical device 4), I had to change the libCEC plugin again. I set the "-t" argument to "r" and "p" (recording device, and playback device). This makes the CEC device respond with an ACK when the TV polls either logical device (recorder=1, playback=4).

So, here's the code for line 66 of the libCEC plugin:
Code: Select all
self.process = Popen( ["c:\Program Files (x86)\Pulse-Eight\USB-CEC Adapter\cec-client.exe", "-r", "-t", "r", "-t", "p"], stdin=PIPE, stdout=PIPE,startupinfo=info)


And, now I can control my Roku using the original TV remote. That's cool! I can also select the Media Center PC, or the Roku via the TV's "source" menu. The TV automatically changes the HDMI input on the audio receiver to the correct input.

Here's my EG configuration. Keep in mind, that this may not work with your components. Some of the commands are specific to Samsung TV's.

main.xml
(16.79 KiB) Downloaded 337 times
barnabas1969
Experienced User
 
Posts: 131
Joined: Sat Feb 04, 2012 1:42 am

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby barnabas1969 » Tue Feb 04, 2014 8:32 pm

Kasinator,

This plugin and the CEC device have been 100% reliable for me so far. Thank you for the great work!
barnabas1969
Experienced User
 
Posts: 131
Joined: Sat Feb 04, 2012 1:42 am

Re: libCEC plugin for Pulse Eight HDMI-CEC usb adapter

Postby techoguy » Wed Feb 05, 2014 8:14 pm

This is great, thanks!
I plan on getting a Roku soon and will definitely be using this.

I actually want to do something similar for the Chromecast. I want to be able to at least send pause/play/next from an IR remote and have thought about doing something like this.
The Latest SONOS Plugin:
Latest version can be found here: http://eventghost.org/forum/viewtopic.php?f=9&t=6078&p=30309&sid=4f6791969f7a4d8650729fd01db1f05f#p30309

EventGhost Lets me automate my home the way I want it, I love using it!
User avatar
techoguy
Experienced User
 
Posts: 157
Joined: Mon Mar 18, 2013 1:32 am

Next

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 2 guests