Getting Alexa to speak in a rule

I installed the amazonechocontrol-binding, connected the account and added an echo speaker. There seem to be two things for the same physical object. One of them (the smarthomedevice, probably the one I need?) doesn’t connect correctly:

So I use the other device which has a lot of channels for music control, but also some for commands which should make her speak: Sprich/textTo Speech and Befehl/textCommand:

I created items for all channels, then tried a bunch of javascript-lines in a rule, none of them make her speak:

                events.postUpdate("AlexaHolger_Sprich","Alexa say OK");
                AlexaHolger_Befehl.sendCommand("Alexa say OK");
                AlexaHolger_Sprich.sendCommand("Alexa say OK");    //this seems to be the German texttospeach-channel

                events.postUpdate("AlexaHolger_Sprich","<speak> Alexa say OK </speak>");
                AlexaHolger_Befehl.sendCommand("<speak> Alexa say OK </speak>");
                AlexaHolger_Sprich.sendCommand("<speak> Alexa say OK </speak>");

                events.postUpdate("AlexaHolger_Sprich",<speak> Alexa say OK </speak>);
                AlexaHolger_Befehl.sendCommand(<speak> Alexa say OK </speak>);
                AlexaHolger_Sprich.sendCommand(<speak> Alexa say OK </speak>);
                
                events.postUpdate('AlexaHolger_Sprich','Alexa say OK');
                AlexaHolger_Befehl.sendCommand('Alexa say OK');

Looking forward to your ideas :slight_smile:

My experience is that using SSML tags e.g. do not work. When I tried it the Echo stayed silent.
No messages in the log file?

That should be ok ( at least I used it in DSL rules; not sure about how it works in javascript-lines )

AlexaHolger_Befehl.sendCommand is used for routines.

Check if the TTS with item AlexaHolger_Sprich works via the karaf console.
In case it does not work there it is a more generic problem.

@JensD : No, I didn’t find any relevant messages in the log files (if you mean …:9001)

@Wolfgang_S :

  • “AlexaHolger_Befehl.sendCommand is used for routines.” ← so I guess only the “events.postUpdate”-commands work. When I run that, the text gets inserted into the item but Alexa remains silent (no matter whether with or without):

I’m still quite new to OH, so I don’t really understand what you mean by “Check if the TTS with item AlexaHolger_Sprich works via the karaf console” - probalby not this?:

Gonna check my rules quick, sure I normally use what you are…

This is mine:

KitchenAlexaTTS.sendCommand(‘Motion Detected In The Garden’)

Maybe try with single quotes

No, that didn’t make Alexa speak either. And it didn’t change the item’s value (same as posted above, and Wolfgang’s posting). Does it change your item’s value or does Alexa speak without any changes of the item’s content?

I tried different alexa-devices, same problem. However, I tested a different action (change loudness) which worked. But I want her to speak…

The syntax in the karaf console is a bit different compared to what you entered:
openhab:send AlexaHolger_Sprich “hello world”

This seems to work (but only the first word, tried different expressions). What would be the next steps?

Edit: Don’t know if it’s relevant, but the values in OH itself don’t appear to change:
item before karaf command:


and after the command:

Don’t know why, but now it works …