How to make a Switch item accept lower-case on/off

I am trying to use setup an IFTTT applet for Google Assistant using the “Say a phrase with a text ingredient” and of course getting an error on openHAB saying "Received invalid command ‘off ’ for item "BedroomLights’ because it is sending the ingredient as “off” instead of “OFF” that openHAB needs. So how do I make openHAB accept lower-case off/on or even the other way, make IFTTT send it as UPPER-CASE.

Thanks

1 Like

The better approach would be to make IFTTT send it uppercase if possible, but if not, you could create a String item and a rule, and send the command to the String item:

items/my.items

String MySwitchString
Switch MySwitch

rules/my.rules

rule UpperCaseSwitchCommand
when
  Item MySwitchString received command
then
  MySwitch.sendCommand(receivedCommand.toString.toUpperCase)
end

There might be a more concise solution.

Thanks for the reply, so far no luck finding a way in IFTTT to send as upper-case.

Same issue…

Any idea why transforms don’t just work here?

Same for me, it would be nice if myopenhab accepted both lowercase and uppercase.

/Mike