I optimized the Script a little bit 
rule"Set Volume Philips TV"
when
Item Volume_Philips_TV received update
then
//Check if TV is Online eg. Ping the Device with Network Binding
if (TV.state == ON){
executeCommandLine("/etc/openhab2/scripts/tv_volume.sh " + "set_volume " + "Volume_Philips_TV " + Volume_Philips_TV.state)
}
else{
if (Volume_Philips_TV.state != 0) sendCommand.Volume_Philips_TV(0)
}
end
rule"Get Volume Philips TV at StartUp"
when
Item TV changed from OFF to ON
then
//Perhaps set a short Sleep ... give JointSpace time to start up ;-)
//Try it for yourself ;-)
executeCommandLine("/etc/openhab2/scripts/tv_volume.sh "+ "get_volume " + "Volume_Philips_TV")
end
#!/bin/sh
###################################
openhab_url="0.0.0.0"
openhab_port="8080"
tv_ipadresse="0.0.0.0"
###################################
case $1 in
key)
#Key => Standby , VolumeUp , VolumeDown , Mute , Back , Find , RedColour , GreenColour , YellowColour , BlueColour ,
# Home , Options , Dot , Digit0-9 , Info , CursorUp , CursorDown , CursorLeft , CursorRight , Confirm , Next ,
# Previous , Adjust , WatchTV , Viewmode , Teletext , Subtitle , ChannelStepUp , ChannelStepDown , Source ,
# PlayPause , Pause , FastForward , Stop , Rewind , Record , Online
curl -H "Content-Type: application/json" -X POST -d '{"key": "'$2'"}' http://$tv_ipadresse:1925/1/input/key
;;
set_source)
#Sources => tv , sat , hdmi1 , hdmi2 , hdmi3 , hdmiside , ext1 , ypbpr , vga
curl -H "Content-Type: application/json" -X POST -d '{"id": "'$2'"}' http://$tv_ipadresse:1925/1/sources/current
;;
get_source)
current_scource="$(curl -H "Content-Type: application/json" -s GET http://$tv_ipadresse:1925/1/sources/current | jq -r '.id')"
curl -X PUT --header "Content-Type: text/plain" --header "Accept: application/json" -d "$current_scource" "http://$openhab_url:$openhab_port/rest/items/$2"
;;
get_volume)
tv_max_volume="$(curl -H "Content-Type: application/json" -s GET http://$tv_ipadresse:1925/1/audio/volume | jq -r '.max')"
volume_state="$(curl -H "Content-Type: application/json" -s GET http://$tv_ipadresse:1925/1/audio/volume | jq -r '.current')"
transform=`echo "scale=2; $tv_max_volume / 100 * $volume_state" | bc | awk '{print int($1+0.5)}'`
curl -X PUT --header "Content-Type: text/plain" --header "Accept: application/json" -d "$transform" "http://$openhab_url:$openhab_port/rest/items/$2"
;;
set_volume)
tv_max_volume="$(curl -H "Content-Type: application/json" -s GET http://$tv_ipadresse:1925/1/audio/volume | jq -r '.max')"
transform=`echo "scale=2; $tv_max_volume / 100 * $2" | bc | awk '{print int($1+0.5)}'`
echo $transform
curl -H "Content-Type: application/json" -s POST -d '{"current": '$transform} http://$tv_ipadresse:1925/1/audio/volume
;;
get_mute)
mute_state="$(curl -H "Content-Type: application/json" -s GET http://$tv_ipadresse:1925/1/audio/volume | jq -r '.muted')"
if [[ $mute_state == false ]]; then
curl -X PUT --header "Content-Type: text/plain" --header "Accept: application/json" -d "OFF" "http://$openhab_url:$openhab_port/rest/items/$2"
elif [[ $mute_state == true ]]; then
curl -X PUT --header "Content-Type: text/plain" --header "Accept: application/json" -d "ON" "http://$openhab_url:$openhab_port/rest/items/$2"
fi
curl -X PUT --header "Content-Type: text/plain" --header "Accept: application/json" -d "$mute_state" "http://$openhab_url:$openhab_port/rest/items/$2"
;;
set_mute)
#true/fasle
curl -H "Content-Type: application/json" -X POST -d '{"muted": "'$2'"}' http://$tv_ipadresse:1925/1/audio/volume
;;
esac
Next step ist to control this and upcoming Script with NodeJS … 