Nooby needs help with a rule

Hello, i am new in this communty and i have a problem with my first rule.
i found a rule for my project but a have follow error:

i hope anywhere can help me

[ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Toggle Tuya light/switch on/off via MQTT’: An error occurred during the script execution: index=0, size=0

Rule:

rule “Licht/switch on/off via MQTT”
when
Item Wohnwand received command
then
switch(receivedCommand) {
case ON : actions.publishMQTT(“tuya/socket/02200490dc4f2215bd31/xxxxxxxxxxxx/192.168.1.147/command/on”,"")
case OFF : actions.publishMQTT(“tuya/socket/02200490dc4f2215bd31/xxxxxxxxxxxx/192.168.1.147/command/off”,"")
}
end

You have to set actions:

  val actions = getActions("mqtt","mqtt:systemBroker:embedded-mqtt-broker")

This is an example! Please set the broker to the correct one (i.e. get the ThingUID from your Bridge)

This rule is exactly like a command binding

rule “Licht/switch on/off via MQTT”
when
Item Wohnwand received command
then
switch(receivedCommand) {
case ON : actions.publishMQTT(“tuya/socket/02200490dc4f2215bd31/xxxxxxxxxxxx/192.168.1.147/command/on”,"")
case OFF : actions.publishMQTT(“tuya/socket/02200490dc4f2215bd31/xxxxxxxxxxxx/192.168.1.147/command/off”,"")
}

Why don’t you use the binding directly?
Create a Generic MQTT thing
Add a switch channel
Command topic = tuya/socket/02200490dc4f2215bd31/xxxxxxxxxxxx/192.168.1.147/command
And an outgoing value transformation with a map file: MAP:ONonOFFoff.map

ONonOFFoff.map

ON=on
OFF=off

Then add your channel to the item: Wohnwand

Switch Wohnwand {channel="mqtt:topic:thing:channel"}