Harmony and SiteMap - Help with SiteMap Buttons and Mappings Needed

I have some IR LED strip lights that I use a Harmony Hub to control. Currently I have individual buttons for each color - red, green and blue, each displaying on a separate line in the iOS/Web GUI. What I would like to see is one line with “LED COLOR” and “RED”, “BLUE”, “GREEN” as buttons on the same line.

Is that possible to use “mappings” similar to the Activity example?

String LEDBLUE “LEDBLUE” { harmonyhub=">[press:LED:Blue]", autoupdate=“false” }
String RGBLEDGREEN “LEDGREEN” { harmonyhub=">[press:LED:Green]", autoupdate=“false” }
String LEDRED “LEDRED” { harmonyhub=">[press:LED:Red]", autoupdate=“false” }

Frame label=“LIGHTS” {
Switch item=LEDBLUE mappings=[ON=“Power”]
Switch item=LEDGREEN mappings=[ON=“Power”]
Switch item=LEDRED mappings=[ON=“Power”]

I think I’m close. I got it to display, but need help with the items definition… I have the below, but it’s not working.

String LEDCOLOR “LEDCOLOR” { harmonyhub=">[RED:press:LED:Red]", harmonyhub=">[BLUE:press:LED:Blue]", harmonyhub=">[GREEN:press:LED:Green]" }

Switch item=LEDCOLOR label=“LED COLOR [%s]” mappings=[‘RED’=‘RED’, ‘BLUE’=‘BLUE’, ‘GREEN’=‘GREEN’]

Thank you.


Get rid of the quotes on the left side of the equals sign in your mappings. You also might need to use double quotes:

Switch item=LEDCOLOR label="LED COLOR [%s]" mappings=[RED="RED", BLUE="BLUE", GREEN="GREEN"]

That appears to be the only difference between how I’ve done mappings in my working sitemap and this one. I’ve no experience with Harmony so I can’t help if the problem lies there.

Thank you @rlkoshak for the reply. The mappings/buttons works correctly (event is being raised when pressed).

I guess, what I’m saying is I need help with the Harmony binding part.

Is this what you want?

String LEDCOLOR “LED COLOR” { harmonyhub=">[press:LED]", autoupdate=“false” }

Switch item=LEDCOLOR mappings=[‘RED’=‘RED’, ‘BLUE’=‘BLUE’, ‘GREEN’=‘GREEN’]

with press actions, if you just specify just the device in the item file (LED), any String passed to it will be interpreted as the button to press (RED, BLUE, GREEN). This is case sensitive, so make sure its really RED and not Red.

1 Like


Thanks! I think this is exactly what I’m looking for. I’ll give it a test tonight and will report back.


@digitaldan you the man! It worked. This will make it so much easier to program all my buttons on the sitemap!

Awesome, glad I could help.