executeCommandline with recieved Command?

Hi folks,

Trying to remote control my new Philips TV, I sufferings some problems.

Switching it On and Off works like charm, but now i’m trying to switch the Ambilight and it doesn’t work.

This is my Setup:

Sitemap:

Selection item=Philips_Ambi_FollowVideo mappings=["COMFORT"="Komfort","RELAX"="Relax","IMMERSIVE"="Intensiv","NATURAL"="Natürlich","STANDARD"="Standard","GAME"="Spiel","VIVID"="Lebhaft","OFF"="Aus"]

Items:

String Philips_Ambi_FollowVideo "Ambilight [%s]"

Rules:

rule "Philips_TV Ambilight Follow Video"

when Item Philips_Ambi_FollowVideo recieved command

then 

executeCommandLine("sudo /etc/openhab2/scripts/philips.py --host 192.168.178.103 --command set_followvideo --value " + receivedCommand)

end

How the f*** can i pass the recieved command? In the event.log all status changes and recieved commands seem to be right. But the execution of the script doesn’t work.

Somebody any idea?

Greetings Michael

As recievedCommand isn’t necessarily a string for all Item types, maybe it needs a .toString

Thank you for the solution, but after some tests and your suggestion, i figured out, the rule is never triggered!

Changed it to this and now everything works fine:

rule "Philips_TV Ambilight Follow Video"

when Item Philips_Ambi_FollowVideo changed

then 

executeCommandLine("sudo /etc/openhab2/scripts/philips.py --host 192.168.178.103 --command set_followvideo --value " + Philips_Ambi_FollowVideo.state)

end

.state did the trick :wink:

Greetings Michael