Req API command to turn HDMI-CEC TV off
#1
Hi,

It would be good to have API commands to turn on and off the TV (and just the TV, not the HDMI adapter nor the Kodi system).

I'm already able to do so trough the terminal on the RaspberryPi, with the following commands:
Code:
[email protected]:~$ echo "on 0" | cec-client -d 1 -s #turn TV on
log level set to 1
opening a connection to the CEC adapter...
[email protected]:~$ echo "standby 0" | cec-client -d 1 -s #turn TV off
log level set to 1
opening a connection to the CEC adapter...
[email protected]:~$

And I believe Kodi already has some internal function to do so (I don't know if it uses cec-client), since it is already able to turn my TV off after a predetermined time of inactivity, and turn on when I do any keyboard/mouse/API input. I just want a direct way to turn off trough the JSON-RPC API, basically.

Thanks!
Reply
#2
Hello,

It exist some JSON-RPC API, but It would be great to have more options, like switch ON/OFF a TV/AMP/VP, UP/DOWN volume for TV/AMP...

Sound like everything is already there, only JSON API need to be done...

Thank's a lot.

Regards,

Big
Reply
#3
Take a look
Sadly unsuccessful so far...
Reply
#4
Yes, but all the command exist by now.

Only the JSON API is not complete for receiving these commands...

Don't think it will take a lot amount of time for having some more commands with somes parameters...
Hope someone can give it to us quickly! Smile

Regards,

Big
Reply
#5
(2014-11-19, 12:55)bigbig6 Wrote: Yes, but all the command exist by now.

I don't think so. Here is a list with all commands. As you can seen, currently they are only pretty basic stuffs for CEC.
You could try "CECToggleState"
Reply
#6
Your right for the system commands usable.

But XBMC is already able to start your TV on start up, or even the amp. It can change the default entry of your TV, ...

So the CEC engine of XBMC (sorry, Kodi for now) is ready for this new commands.

I think it wouldn't be a hard word to give us these system commands! Smile

Big
Reply
#7
Your right, Kodi can already manage your CEC-Devices through CEC. But this behavior is statically and can't be manipulated with unknown commands.
At the moment there is no way to pass custom commands to the system. But there is a need for it, if you wish to use json or and another plugin(s) (whatever) to switch CEC.
At this time, only built in commands can be called. I miss for everything else the API. And that's what we talk about.

I don't know how costly it is to integrate such a API, but i hope some Developer can help here.

So long i use a custom script to control my Devices - Take a look
Reply
#8
Yes...

No developer or team member to help us?

Big
Reply
#9
I assume you are creating some sort of addon and want to be able to switch the TV on and off with it.

Why can't you simply use the commands from post 1?

Or use a python library like https://github.com/trainman419/python-cec
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#10
Hi,

an addon already exist in order to call some XBMC commands via JSON-RPC.

But theses command are too simply, we need some more possibilities...

And your python libraries, I don't think we can use it via a Kodi addon.

Big
Reply
#11
Whatever.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#12
We don't need a separate API at all!
All we need is the possibility to open the cec-hardware in shared mode. If the shared mode is enabled, cec-client will be able to send the custom commands, and cec-client is then the api.
If the cec-hardware is opened in exclusive mode, the hardware is reserved fore one client/program.
In shared mode, two clients/programs can access to it, like kodi/xbmc and cec-client at the same time!
I think this is related to libcec?!
Reply
#13
I still can't see what is wrong with using the commands in post #1 or the python library I pointed to.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#14
They aren't native commands, and we can't use them at the same time XBMC is running...

Almost all the code is done in the engine of XBMC, we just would like to have some more commands in order to use theses functionnalities...

Regards,

Big
Reply
#15
So does xbmc take exclusive use of the cec device?

Sounds like you need to get coding.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
 
Thread Rating:
  • 1 Vote(s) - 3 Average



Logout Mark Read Team Forum Stats Members Help
API command to turn HDMI-CEC TV off31
This forum uses Lukasz Tkacz MyBB addons.