danmed
26 February 2018 14:16
1
Does anyone have an explanation of why i can’t turn off my TV using the JSON-CEC plugin?
I can turn it on no problem using “activate” but “Standby” and “Toggle” do nothing.
This works perfectly using LibreElec on other hardware so i can only assume it’s either OSMC or the Vero that’s not allowing it to work…
There’s no standby / suspend support at this time, but it’s coming.
There’s a difference between standbying the Vero 4K and turning off the external display however. Do you mean to just output no signal so the TV turns itself off?
Sam
danmed
26 February 2018 14:31
3
The JSON-CEC addon for Kodi enables JSOn API for CEC control… at the moment i can point my browser at a URL (IP of the VERO 4K box) and turn on the TV… and it should do the same to turn off the TV… but it doesn’t work…
I’m just reading the GitHub fo rit and someone may have figured it out though…
opened 12:05PM - 19 Nov 17 UTC
Hello,
first of all - thanks for making such a great script. It looks very pr… omising. But I am not able to make it work. The following issue occurs (originally posted [here](https://github.com/Pulse-Eight/libcec/issues/123#issuecomment-345509246)):
(...) The Pi answers (get the following response) but the TV doesn't act (eg. turn on).
My Request and the Response:
- <kodi-network-ip>/jsonrpc?request={"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.json-cec","params":{"command":"standby"}},"id":1}
```json
{
"id": 1,
"jsonrpc": "2.0",
"result": "OK"
}
```
Am I missing any setting (firewall) or something? Or should it work kind of out of the box?
Edit: Taking a look into the [kodi.log](http://kodi.wiki/view/Log_file/Advanced#Location) reveals the following:
```
13:08:05.720 T:1491071984 DEBUG: CWebServer[80]: request received for /jsonrpc?request={%22jsonrpc%22:%222.0%22,%22method%22:%22Addons.ExecuteAddon%22,%22params%22:{%22addonid%22:%22script.json-cec%22,%22params%22:{%22command%22:%22standby%22}},%22id%22:1}
13:08:05.736 T:1305474032 DEBUG: Thread LanguageInvoker start, auto delete: false
13:08:05.737 T:1305474032 INFO: initializing python engine.
13:08:05.737 T:1305474032 DEBUG: CPythonInvoker(29, /home/osmc/.kodi/addons/script.json-cec/script.py): start processing
13:08:06.222 T:1305474032 DEBUG: -->Python Interpreter Initialized<--
13:08:06.223 T:1305474032 DEBUG: CPythonInvoker(29, /home/osmc/.kodi/addons/script.json-cec/script.py): the source file to load is "/home/osmc/.kodi/addons/script.json-cec/script.py"
13:08:06.224 T:1305474032 DEBUG: CPythonInvoker(29, /home/osmc/.kodi/addons/script.json-cec/script.py): setting the Python path to /home/osmc/.kodi/addons/script.json-cec:/usr/lib/python2.7:/usr/lib/python2.7/plat-arm-linux-gnueabihf:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/PILcompat:/usr/lib/python2.7/dist-packages/gtk-2.0
13:08:06.224 T:1305474032 DEBUG: CPythonInvoker(29, /home/osmc/.kodi/addons/script.json-cec/script.py): entering source directory /home/osmc/.kodi/addons/script.json-cec
13:08:06.225 T:1305474032 DEBUG: CPythonInvoker(29, /home/osmc/.kodi/addons/script.json-cec/script.py): instantiating addon using automatically obtained id of "script.json-cec" dependent on version 2.1.0 of the xbmc.python api
13:08:06.336 T:1305474032 INFO: CPythonInvoker(29, /home/osmc/.kodi/addons/script.json-cec/script.py): script successfully run
13:08:06.344 T:1305474032 INFO: Python script stopped
13:08:06.344 T:1305474032 DEBUG: Thread LanguageInvoker 1305474032 terminating
13:08:06.350 T:1958453248 DEBUG: ToggleDeviceState - putting CEC device on standby...
```
But nothing happened... Even though I see: `13:08:06.350 T:1958453248 DEBUG: ToggleDeviceState - putting CEC device on standby...`.
Any clues?
danmed
26 February 2018 14:38
4
Unfortunately the files it is referring to, i cannot find on my Vero 4k :’(
@sam_nazarko are you able to help at all with this?
danmed
26 February 2018 15:08
5
I’ve edited /usr/share/kodi/system/peripherals.xml to see if that makes any difference… wont be able to tell until i get home though
danmed
26 February 2018 15:37
6
@sam_nazarko
Initial tests (admittedly only utilising cec-client to check the power status of the TV) suggest that this may have worked…
Is this something that can be modified on your end?
The current value of “213” i believe means that there is no device to turn off… whereas changing it to “36037” refers to the TV…
I’m pretty sure all of these CEC settings can be configured under Settings → Input → Peripherals.
We do change some of the default behaviour to stop annoyances like setting the active source automatically
danmed
26 February 2018 18:34
8
hi @sam_nazarko looks like you’re right and it does fix the problem… mostly… however the power off only works if the source on the TV is set to OSMC… any ideas on if that can be fixed?
Your TV probably de-asserts when OSMC is not the active source.
Force ‘HPD Lock’ in Settings -> Display might help with this.