Http rule

help me figure out where I’m wrong, this works:

rule "casa1 preset"
when
Item casa1_preset received command	
then
switch
sendHttpGetRequest("http://ipaddress:port/decoder_control.cgi?command=31&user=username&pwd=password" )
end

but needing more presets, and this does not work:

rule "casa1 preset"
when
Item casa1_preset received command	
then
switch(receivedCommand) {
case 0: sendHttpGetRequest("http://ipaddress:port/decoder_control.cgi?command=31&user=username&pwd=password" )
case 1: sendHttpGetRequest("http://ipaddress:port/decoder_control.cgi?command=33&user=username&pwd=password" )
}
end

sitemap: Switch item=casa1_preset mappings=[0=“door”, 1=“windows” ]
item: String casa1_preset “preset”

Hi, maybe try to add quotes around the 0 and 1 values, since the item is a string

I think this would be working …

rule "casa1 preset"
when
  Item casa1_preset received command	
then
  switch(receivedCommand.toInteger) {
    case 0: sendHttpGetRequest("http://ipaddress:port/decoder_control.cgi?command=31&user=username&pwd=password" )
    case 1: sendHttpGetRequest("http://ipaddress:port/decoder_control.cgi?command=33&user=username&pwd=password" )
  }
end

ok, now works!
thanks