Posts: 3
Joined: Sep 2013
Reputation:
0
Thanks for the addon, Joshjowen. I wrote some simple bash scripts to issue the JSON commands to my RPi (Openelec - Gotham) and the 'standby' and 'toggle' command works to turn the TV off. However, I can't seem to turn the TV on with 'activate' or 'toggle' even though the command is successfully issued. Perhaps this is a limitation of my TV (Sony Bravia (KDL-40EX650); I poked around the TV settings and all CEC options were enabled. What are your CEC settings on XBMC? Thanks again for the addon.
Posts: 3
Joined: Sep 2013
Reputation:
0
I managed to get activate working now. Toggle is the same for me - turns the TV off fine but won't turn it on. It's not a big problem now that activate works. Many thanks for this addon...it's added functionality to my setup that I've been looking for for quite a while.
Posts: 7
Joined: Feb 2013
Reputation:
1
Siggi85sn when I copy and paste the URL that you have posted I get a parse error as well, but when I remove the quotation marks and retype them it works, I think it is a formatting error with the quotes.
Posts: 6
Joined: Nov 2013
Reputation:
0
I also would like to be able to use XBMC's libcec interface in an addon, so I'd like to make a suggestion for a simple way to provide such a facility.
The way libcec implements its C (as opposed to C++) API is to maintain a pointer to the C++ interface (ICECAdapter) in the global variable 'cec_parser'. The cec_initialise function creates an ICECAdapter, stores its address in cec_parser, and returns success if it worked. All the other functions just invoke the corresponding methods in that interface, using the saved pointer to it.
If a Python module had access to the address of XBMC's ICECAdapter interface, it could use ctypes to store it in cec_parser and then use libcec functions other than cec_initialise with impunity, without needing a restart to restore XBMC's CEC features. That pointer is hidden in the CEC peripheral context, so some amount of code would have to be written to expose it.
Or, the CEC peripheral initialization code could be modified to store its pointer in cec_parser when it gets it, assuming that the copy of libcec's data that the Python engine gets is the same as what the CEC peripheral gets.
Posts: 1
Joined: Dec 2011
Reputation:
0
I would also love a way to send cec commands from python.
I'm planning to write a plugin where i can write my own custom logic when to turn on/off the tv and my amp.
I currently control the amp via tcp, but i can only control the tv via cec, and xbmc is hogging the libcec-device.
Posts: 51
Joined: Aug 2010
Reputation:
0
I've been trying the script.json-cec plugin and I get it to work to turn the tv on (using a samsung tv with anynet). But no luck for turning it off (standby) or with toggle. Anyone have any ideas?