Change TV input if XBMC is already running.
#1
Hey, Sorry in advance if this has been covered. I've tried searching and haven't found anything usefull.

I have a pulse-eight (amazing little box btw) and a have it set up almost perfectly. The one downside is i'm not sure how to easily pull the input back to XBMC if it's already on and the tv is on a different input.

If I start XBMC it will automatically do this. Also If I start playing a video, again it change the input. Is there a way I can remap a key on keyboard.xml to a function that does this?


Thanks,
Tom

Edit: I've found CECActivateSource as a function, not quite sure how I can use that. Maybe map it to a key?
Reply
#2
I've tried:
Code:
<y>Activate(CECToggleState())</y>
<y>Activate(CECToggleState)</y>
<y>CECToggleState()</y>
<y>CECToggleState</y>

None of those seem to work.
Reply
#3
Just tried:
Code:
<y>XBMC.CECActivateSource</y>

I'm not sure if i'm incorrectly trying to map the function, or if those functions don't do what I think they do.

Do I have to call the peripheral device?
Reply
#4
Did you ever work this out? I'm having exactly the same issue.

Code:
ERROR: Keymapping error: no such action 'xbmc.cectogglestate' defined
Code:
ERROR: Keymapping error: no such action 'cectogglestate' defined
Reply
#5
Nope. I kinda gave up. It's frustrating because it really looks like it can be done.
Reply
#6
I asked elsewhere, and found out that it's a new feature in Gotham. The documentation has been updated to reflect this.

In other words;

Code:
<y>CECToggleState</y>

This works. But you need to be using the beta.
Reply
#7
If you're pushing a button on the remote to change the input... why wouldn't you push the button that tells the TV to switch to AV/HDMI1/whatever? With focus on the television, the remote commands aren't going to XBMC anyway, are they, since CEC isn't active?

Maybe I'm missing something, it wouldn't be the first time!
Reply
#8
My use case involves removing the TV remote from the picture, and using Yatse to turn the TV on and off (though you could use any remote/keyboard that directly talks to the computer)
Reply
#9
I've installed script.json-cec to be able send a JSON command to activate the various functions.
Code:
http://192.168.1.100:8081/jsonrpc?request={"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.json-cec","params":{"command":"activate"}},"id":1}

However, despite confirming JSON works (via test messages (GUI.ShowNotification), Player.PlayPause, etc.), this script doesn't seem to work despite returning:
Code:
{"id":1,"jsonrpc":"2.0","result":"OK"}

I'm running v16.1 on Ubuntu on an oDroid C2 (built in CEC). Is there something I'm missing? I've also:
  • changed the CEC Adapter configuration (System / Input Devices / Peripherals) to override the various HDMI ports
  • different HDMI ports on my Sony KDL-65W850A
  • confirmed that Kodi does successfully switch the TV to the proper input when it starts up initially (from Linux or a cold boot with the TV on another input)
I keep the oDroid running 24/7 because it runs other apps so I'd like to be able to send a command to activate the TV and switch to the proper input.
Reply

Logout Mark Read Team Forum Stats Members Help
Change TV input if XBMC is already running.0