Alexa TTS (Text-To-Speech) [and more] plug-in for Vera

my bad, I will push it shortly. I’m still jet-lagged after my vacation and I didn’t noticed that. I will also push a new version with announcements running on openluup (plus routines, that are already supported, and a generic way to run any command). Just wait a little bit for it :slight_smile:

1 Like

0.2.5 is on GitHub!

New features:

  • OTP support is fixed
  • auto-update of the bast script on every new version
  • Announcements: set UseAnnoucements to 1 and be sure to enable announcements on your devices (under settings). You can use groups (case sensitive!) to have sync’ed announcements. Rich SSML is supported, see below. New variable DefaultBreak (in seconds) to set the break between messages
  • Commands: any command can be now executed (see below)

Announcements and Commands will run on openluup only. They may be supported on Vera, just try them. Routines are Openluup only at the moment.

A couple of examples:

-- routines luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1", "RunRoutine", {RoutineName="cane", GroupZone="Bedroom"}, 666)

-- any command you want luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1", "RunCommand", {Command="-e weather -d 'Bedroom'"}, 666)

-- sounds - see https://developer.amazon.com/en-US/docs/alexa/custom-skills/ask-soundlibrary.html luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1", "RunCommand", {Command="-e sound:amzn_sfx_trumpet_bugle_04 -d 'Bedroom'"}, 666) -- sounds only work on device, no groups

-- different voices, SSML - see https://developer.amazon.com/en-US/docs/alexa/custom-skills/speech-synthesis-markup-language-ssml-reference.html luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1","Say", {Text='<voice name="Kendra"><lang xml:lang="en-US">Hello from Vera Alexa</lang></voice>', Volume=50, GroupZones="Bedroom", Repeat = 3}, 666)

luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1","Say", {Text='<voice name="Matthew"><lang xml:lang="en-US">Hello from Vera Alexa</lang></voice>', Volume=50, GroupZones="Bedroom", Repeat = 3}, 666)

luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1","Say", {Text='<voice name="Amy"><lang xml:lang="en-GB">Hello from Vera Alexa</lang></voice>', Volume=50, GroupZones="Bedroom", Repeat = 3}, 666)

-- different language
luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1","Say", {Text='<voice name="Carla"><lang xml:lang="it-IT">Ciao da Vera Alexa</lang></voice>', Volume=50, GroupZones="Bedroom", Repeat = 3}, 666)

Enjoy and let me know if you have any problems!

2 Likes

You are a star!

Umm, this announcements thing? Can you give an example? Also, where do we set UseAnnouncements? There appears to be no need to set it in the Vera devices, though (from the docs I’ve found). Am I right?

Cheers!

PS Get over the jet lag first!

C

Thanks, I manage jet-lag very easily, it’s just affecting my ability to write code at late night :slight_smile:

Anyway, to reply to your question:

  • announcements are opt-in and will substitute TTS. If you want to use a group instead of a device, you have to enable them
  • UseAnnouncements is a variable under the device, you’re right.

Announcements seems to be quicker and, as I already said, you have the ability to have sync’ed TTS for a group, instead of cycling every device. I must say it’s very cool.

I will probably explicitly add lastalexa in the next days and then I’ll probably declare this plug-in as stable, just waiting for 7.32 to be released for jq to be officially supported.

Sorry still not with you at all. :(. Maybe I’m jet lagged :slight_smile:
C

ok
say is working
and anouncements.

no luck with routines or commands.
just get
ERROR: No implementation

you have to choose the one using urn:bochicchio-com:serviceId:VeraAlexa1, so just move over the button, you’ll see the serviceID. Choose the correct one and it’ll work.
Oh, and code will be ok as well.

ok all working.
i do not get a hover over on my browser. There were 3 to choose from, it turned out to be the middle one. All working fine.

Is there any way to sart smarthome devices, rather than routines?

Been trying to get synced announcements to work, anyone have any luck? I enabled UseAnnouncments, and tried setting Groupzones to 2 devices no luck.

I enabled announcements and groupzone Everywhere, with no issues.
is there an alexa app setting that maybe stopping it?

im using Sonos speakers which do support announcements and have it enabled here’s my TTS code

luup.call_action(“urn:micasaverde-com:serviceId:Sonos1”, “Say”, {Text=“Hello from Vera Alexa”, Volume=50, GroupDevices=“Everywhere”, Repeat = 1}, 632)

should GroupDevices be GroupZones?

ive tried GroupZones Everywhere GroupDevices Everywhere no luck. Weirdly enough when I have UseAnnouncements enabled, any of my Alexa TTS commands, she says ‘SS’ before the speech, then at the end she says something like 'Break 3 0s"

this post here has links to ssml, i think the ss and the break are from that . May be Sonos has issues with the annoucement feature.

3 seconds is the defaultbreak variable setting

would the everywhere command work for all my devices in multiple rooms? or will it only apply to devices in one room. I have echos around too that should work if the Sonos speakers don’t, but theyre all in their own separate Alexa rooms.

Everywhere shouldn’t do all alexa devices as they are called with a different serviceId and sonos is called with another.

try just calling the alexa devices with “urn:dlna-org:serviceId:DLNAMediaController1”

luup.call_action(“urn:dlna-org:serviceId:DLNAMediaController1”, “Say”, {Text=“Hello from Vera Alexa”, Volume=50, GroupZones=“Everywhere”, Repeat = 1}, 632)

Nothing. I am able to use this service id for Sonos speakers too, just not all synced.

try
urn:bochicchio-com:serviceId:VeraAlexa1

no. You have to build routines and call them. I turn on/off a couple of things this way. just create a routine for on (let’s say turndehumon) and on for off (turndehumoff). In the corresponding routines, do what you need to do.

You don’t have to change your code. Announcements are to be used only if you want sync’ed TTS in groups. If you’re ok with the current TTS, just skip it. You have to skip it anyway on Vera, it’s only supported on openluup at the moment.

1 Like