thanks for your replies.
I tried @opus solution which I had to modify to get it work. instead of
say (VoiceCommand.state.toString, "voicerss:deDE", AudioSink)
I have to use
say (VoiceCommand.state.toString, "voicerss:deDE", ""+AudioSink)
that lead me to the idea to experiment with the “” inside the transformation file and var string instead of val. but still, I do not get my original code running.
the rule:
rule "talk via openhab app"
when
Item VoiceCommand received command
then
var AudioSink = transform("MAP", "squeezebox.map", ""+TalkToSqueezebox.state)
logInfo("talk to openhab app", "device: "+AudioSink)
say (VoiceCommand.state.toString, "voicerss:deDE", ""+AudioSink)
end
squeezebox.map:
1 ="squeezebox:squeezeboxplayer:6f32999c:0021ccd59076"
2 ="squeezebox:squeezeboxplayer:6f32999c:70f3950c9d11"
3 = "squeezebox:squeezeboxplayer:6f32999c:bda49be73f87"
4 = "squeezebox:squeezeboxplayer:6f32999c:bda49be73xxx"
5 = "squeezebox:squeezeboxplayer:6f32999c:bda49be73xxx"
the log
2018-10-27 18:03:28.295 [ome.event.ItemCommandEvent] - Item 'VoiceCommand' received command Hallo Test
2018-10-27 18:03:33.207 [INFO ] [ome.model.script.talk to openhab app] - device: "squeezebox:squeezeboxplayer:6f32999c:0021ccd59076"
and thats it, no more entries, no squeeze that sounds.
the rule that works:
rule "talk squeeze"
when
Item VoiceCommand received command
then
var string AudioSink
switch AudioSink {
case TalkToSqueezebox.state == 1 : AudioSink = "squeezebox:squeezeboxplayer:6f32999c:0021ccd59076"
case TalkToSqueezebox.state == 2 : AudioSink = "squeezebox:squeezeboxplayer:6f32999c:70f3950c9d11"
case TalkToSqueezebox.state == 3 : AudioSink = "squeezebox:squeezeboxplayer:6f32999c:bda49be73f87"
default:AudioSink = "squeezebox:squeezeboxplayer:6f32999c:0021ccd59076"
}
say (VoiceCommand.state.toString, "voicerss:deDE", ""+AudioSink)
logInfo("talk to openhab app", "device: "+AudioSink)
end
2018-10-27 18:09:12.128 [ome.event.ItemCommandEvent] - Item 'VoiceCommand' received command howdy
2018-10-27 18:09:12.143 [vent.ItemStateChangedEvent] - VoiceCommand changed from Hallo to howdy
2018-10-27 18:09:17.940 [vent.ItemStateChangedEvent] - Player_homeserver changed from PAUSE to PLAY
2018-10-27 18:09:22.019 [vent.ItemStateChangedEvent] - Player_homeserver changed from PLAY to PAUSE
2018-10-27 18:09:22.031 [vent.ItemStateChangedEvent] - SqueezeboxVolume1 changed from 100 to 0
2018-10-27 18:09:23.622 [INFO ] [ome.model.script.talk to openhab app] - device: squeezebox:squeezeboxplayer:6f32999c:0021ccd59076
maybe it`s just a little thing I do not see…
thanks