Hi, i’m looking to have many command on a single item. i want to use it with harmony binding so on item tv it could have the command : on, off volume up, volume down, etc… it would be so much simpler with rule after that if i could do something like : sendCommand ( TV, VolumeUp ) or sendCommand ( TV, ON) instead of having a different item for each button
is it possible ? I think we could map many button on a single item on sitemap but i need to do that in item file to re use it in rule !
I don’t completely know if I understand what you are asking for but if I do understand, you can get the behavior you want using a String or Number Item and a Switch element with Mappings on your Sitemap. Then, as suggest, have a Rule that interprets the value and sends the command.
rule "Process TV commands"
when
Item TV_Control received command
then
switch(receivedCommand){
case "VUP": TV.sendCommand(VolumeUp)
case "VDOWN": TV.sendCommand(VolumeDown)
case "CHUP": TV.sendCommand(ChannelUp)
case "CHDOWN": TV.sendCommand(ChannelDown)
}
end