Help with a CURL command for SAPHI Philips TV, please

This command works via command line to turn off Ambilight;

curl -X POST -d ‘{“values”:[{“value”:{“Nodeid”:100,“Controllable”:true,“Available”:true,“string_id”:“Ambilight Style”,“icon”:“null”,“data”:{“activenode_id”:110 }}}]}’

In HASSIO I changed to ‘curl -X POST -d “{“values”:[{“value”:{“Nodeid”:100,“Controllable”:true,“Available”:true,“string_id”:“Ambilight Style”,“icon”:“null”,“data”:{“activenode_id”:110 }}}]}”

BUT, it doesn’t work and throws an error. Any help appreciated!

Please post the error :blush:


Here is the error, not very clear though;

Logger: homeassistant.components.command_line.switch
Source: components/command_line/
Integration: command_line (documentation, issues)
First occurred: 6:33:37 PM (2 occurrences)
Last logged: 6:33:40 PM

  • Command failed: ‘curl -X POST -d “{“values”:[{“value”:{“Nodeid”:100,“Controllable”:true,“Available”:true,“string_id”:“Ambilight Style”,“icon”:“null”,“data”:{“activenode_id”:120 }}}]}”’

If you press the button Full Home assistant Logs at the bottom, you can see more elaborate error messages. :blush:

Actually i think I can see what is wrong. You have to replace the first " with ’ and last " with ’ just af -d like this:

'{"values":[{"value":{"Nodeid":100,"Controllable":true,"Available":true,"string_id":"Ambilight Style","icon":"null","data":{"activenode_id":120}}}]}'

OK, I’ll give it a try. The error log entry is this;

2021-04-07 18:39:51 ERROR (SyncWorker_5) [homeassistant.components.command_line.switch] Command failed: ‘curl -X POST -d “{“values”:[{“value”:{“Nodeid”:100,“Controllable”:true,“Available”:true,“string_id”:“Ambilight Style”,“icon”:“null”,“data”:{“activenode_id”:120 }}}]}”’

No errors now but not working with this;

‘curl -X POST -d ‘{“values”:[{“value”:{“Nodeid”:100,“Controllable”:true,“Available”:true,“string_id”:“Ambilight Style”,“icon”:“null”,“data”:{“activenode_id”:110}}}]}’’

Why do you want to use curl and command line? :smiley:

It is easier to just use the build in rest_command. Put this in you configuration.yaml

    url: "’"
    method: post
    content_type: "application/json"
    payload: '{"values":[{"value":{"Nodeid":100,"Controllable":true,"Available":true,"string_id":"Ambilight Style","icon":"null","data":{"activenode_id":110}}}]}'

You can then access this service as any other service in HA. (Like lights.turn_off)

This is a much better way then using curl on HA OS (It’s name is not HASSIO any more).

I don’t know why I used it to be honest, I have other switches like that so copied them.

Anyway, your answer works. THANK YOU!

I’ve been trying to control the Ambilights on my TV for around a year now and your solution was the final piece of the jigsaw.

Absolutely brilliant, cheers!

Glad to here it works! And thanks for marking my answer as the solution! :smiley:

1 Like