Activate TV over CEC with an http request
#1
Is it somehow possible to send a CEC signal to TV so it activates ?
At moment, I advise Kodi to play a video-clip. Playing that automatic activates the TV if it is powered off.
Is it possible to do it better without such a hacky way?
Reply
#2
CEC remains a tricky subject, as most/all TV manufacturers have their own thoughts on how CEC is supposed to work. Hence all the different names for the same technology at all the TV companies.

Afaik, the Kodi API does not support CEC commands.
Got a Kodi problem? Provide us with a full Debug log (wiki) || Usefull pages: First time user (wiki) || Troubleshooting (wiki) || Free content (wiki) || Forum rules (wiki) || VPN policy (wiki)
Reply
#3
CEC (wiki) The Pulse Eight might offer a solution https://www.pulse-eight.com/p/104/usb-hdmi-cec-adapter
Reply
#4
(2020-07-24, 11:40)Mannshoch Wrote: Is it somehow possible to send a CEC signal to TV so it activates ?
At moment, I advise Kodi to play a video-clip. Playing that automatic activates the TV if it is powered off.
Is it possible to do it better without such a hacky way?
What device is Kodi running on?
HTPCs: RPI 2B & 3B+ running LibreELEC 9.x.x
Control: Google Home + RPIB HA Server + OSMC Remote
Audio: Pioneer VSX-819HK & S-HS 100 5.1 Speakers
Server: Acer ASX3400, 3GB RAM, 7.75TB, Xubuntu 18.04, NFS, MySQL
Reply
#5
Raspberry Pi4 with libreelec

The reverse way is working. I'm able to use the tv remotecontrol to control KODI
Reply
#6
I have been able to get the Pi to turn off my projector after it has been idle for a while and to turn it on when a button is pressed (screensaver is deactivated). This worked perfectly with my 3B+, however the Pi 4 is not turning off the projector but it turns it on without fail. I assume there may some kinks to work out with the Pi 4.

My settings are:

Settings>Interface>Screensaver
  • Screensaver Mode - Black
  • Wait time - 10 mins

Settings>System>Power saving
  • Put display to sleep when idle - 20 mins

Settings>System>Input>Peripherals>CEC Adapter
  • Put devices in standby mode when activating the screensaver - Enable
  • Wake devices when deactivating screensaver - Enable

Hope that helps.

Cheers,
LongMan
Reply
#7
How do the Raspberry start the TV after wake-up? May I could use it to wake-up TV manually.

I use the TV as an alarm-clock but before playing the radio I need to modify the Volume.
Reply
#8
(2020-07-26, 19:03)Mannshoch Wrote: Raspberry Pi4 with libreelec

The reverse way is working. I'm able to use the tv remotecontrol to control KODI

You can do it with cec-client.  I use cec-client to control my TV using Google Home.
HTPCs: RPI 2B & 3B+ running LibreELEC 9.x.x
Control: Google Home + RPIB HA Server + OSMC Remote
Audio: Pioneer VSX-819HK & S-HS 100 5.1 Speakers
Server: Acer ASX3400, 3GB RAM, 7.75TB, Xubuntu 18.04, NFS, MySQL
Reply
#9
That sounds great.
how could I do that over network?
Reply
#10
(2020-07-29, 15:06)Mannshoch Wrote: That sounds great.
how could I do that over network?

SSH into your RPI and with the TV off run this command...

echo "on 0" | cec-client RPI -s -d 1

That should have turned the TV on.  If it did then try this command...

echo "standby 0" | cec-client RPI -s -d 1

Which should turn it back off again.

How you then do that over the network depends on how you want it to work over the network.
HTPCs: RPI 2B & 3B+ running LibreELEC 9.x.x
Control: Google Home + RPIB HA Server + OSMC Remote
Audio: Pioneer VSX-819HK & S-HS 100 5.1 Speakers
Server: Acer ASX3400, 3GB RAM, 7.75TB, Xubuntu 18.04, NFS, MySQL
Reply
#11
That works well. Thanks.

[EDIT]
At the moment I use this command. Kodi seems deactivating CEC receiving. So The TV remote control not any more work until I restart kodi.

I don't know how I should do it over network. My node-red is on another PC. If kodi is not able to give me the possibility to send CEC commands over his API. I need another way to do it.
Reply
#12
Write a kodi python service addon that runs a simple web server. That waits for a request and then runs the above terminal commands.
Reply
#13
You could try curl.
HTPCs: RPI 2B & 3B+ running LibreELEC 9.x.x
Control: Google Home + RPIB HA Server + OSMC Remote
Audio: Pioneer VSX-819HK & S-HS 100 5.1 Speakers
Server: Acer ASX3400, 3GB RAM, 7.75TB, Xubuntu 18.04, NFS, MySQL
Reply



Logout Mark Read Team Forum Stats Members Help
Activate TV over CEC with an http request0
This forum uses Lukasz Tkacz MyBB addons.