Release Candidate and Support: Amazon Echo Control Binding

Tags: #<Tag:0x00007f745530b850> #<Tag:0x00007f745530b698> #<Tag:0x00007f745530b5d0>

Could you please further explain that?
What do i need to do to achieve this?

When using TTS_Volume and TTS afterwards it´s still using the global volume.
I can´t find any explanation how to use the TTS_Volume correctly.

Example:

echoArbeit_TTSVolume.sendCommand(100)
echoArbeit_TTS.sendCommand('Test')

Hi, good news, the forum has a history function and so I got back my change log.
I have added it on the end of the top most posting in the Version History section.
Best,
Michael

1 Like

I checked it out, it works as expected! This is great work. There only was one plug left i did not have the motiviation to flash it yet. And it works fine. This is great news for beginners or people who are less in tinkering. love it.

Thats true for tts only, but not for announcements.

But if you have more alexas, you have to catch the current volume for each of them and after the announcement you have to put it back.

So, I still like the idea of changing the volume tomporary using a json parameter :wink:

As promised… Here is the code I am using

I have a choice of two styles of announcement. 1 Mode for user changes. 2 Status for automated announcements.

In some rule somewhere when I want an announcement…

Example of mode announcement. Snow mode…(Sets up monitoring of freezing conditions for downspout heaters… in case anyone was wondering Snow mode huh?)

AlexaModeAnnouncement.postUpdate('<speak> Snow mode is set </speak>')
rule 'Alexa group TTS broadcast. Mode change with attention tone'
when 
  Item AlexaModeAnnouncement changed
then
if (AlarmArmed_Sensor.state==OFF && now.getHourOfDay >= 05 && now.getHourOfDay <= 23){
  //start atention tone
  gAlexaAttentionTone.sendCommand('system_alerts_melodic_07')
  //end atention tone
  Thread::sleep(8200)
  gAlexaAttentionTone.sendCommand('')
  Thread::sleep(1000)
  gAlexaTTS.sendCommand(AlexaModeAnnouncement.state.toString)
  logInfo("Alexa" , 'Mode announcement:  '+ AlexaModeAnnouncement.state.toString)
}
end

rule 'Echo group TTS broadcast. Status change with attention tone'
when 
  Item AlexaStatusAnnouncement received update
then
if (AlarmArmed_Sensor.state==OFF && now.getHourOfDay >= 05 && now.getHourOfDay <= 23){
  //start attention tone
  gAlexaAttentionTone.sendCommand('system_alerts_soothing_01')
  //end atention tone
  Thread::sleep(8200)
  gAlexaAttentionTone.sendCommand('')
  Thread::sleep(1000)
  gAlexaTTS.sendCommand(AlexaStatusAnnouncement.state.toString)
  logInfo("Alexa" , 'Status announcement:  '+ AlexaStatusAnnouncement.state.toString)
}
end

I only set the volume on startup

rule "On restart"
when 
    System started
then
    Thread::sleep(10000)
    Echo_TTSVolume.sendCommand(40)
    Echo_NotificationVolume.sendCommand(40)
    EchoDot_TTSVolume.sendCommand(80)
    EchoDot_NotificationVolume.sendCommand(80)
    EchoShow_TTSVolume.sendCommand(30)
    EchoShow_NotificationVolume.sendCommand(30)
    logInfo("Startup" , "Startup time = " + now.toString("HH:mm dd-MM-yyyy"))
end

I haven’t found option to check if a flash briefing is currently running. Did I overlook something?

My vote; consistent then.

Best, Jay

Is it possible to add the newest release to OH 2.3?
I get this…
2019-09-17 15:05:19.230 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing ‘openhab-binding-amazonechocontrol’: Error restarting bundles:
Could not resolve module: org.openhab.binding.amazonechocontrol [236]
Another singleton bundle selected: osgi.identity; osgi.identity=“org.openhab.binding.amazonechocontrol”; type=“osgi.bundle”; version:Version=“2.5.0.RC_3”; singleton:=“true”

Hi!

I am using alexa groups in the app and wonder if it is possible to do this with this binding instead.
I have 6 Echos. Is it possible to identify which one triggered?
I am thinking about creating a light switch item that gets triggered when i say „lights off“ and then a switch case or if statement to switch lights off in the room where alexa triggered.

It’s working now with OH 2.5 M3! :slight_smile:

is there any way to make my echo speak using URL’s so i can work it into bash scripts easily

Hi,

I have the binding configured and all the controls (TTS,alarms,music etc) are working, but when I try to send a TTS command with SSML tags Alexa just read the tags and the text (even the simplest example does’t work)

<speak> A test command </speak>

My echo device is using portuguese (Brazil) as language. I did tried to change to English US but the read tags thing keep happening. Any advice?

I am trying to use Alexa as a TTS device to speak
A Flash Briefing Profile has been set through Inbox and is online, but it only contains Save and Active

Amazon Echo Control – Amazon show one online device of type VOX and one of type unknown

Alexa is installed on a Raspberry Pi 3 running Stretch
(https://developer.amazon.com/docs/alexa-voice-service/register-a-product.html)

alexa.items
String Echo_Living_Room_TTS “Text to Speech”
Switch Test2 “Test switch” (GF_LivingDining)

Alexa.rules
rule “Test switch Alexa speak”
when Item Test2 changed
then
sendCommand(Echo_Living_Room_TTS,“Hello World”)
end

When switch the switch Test2 I get a message saying
Offline: waiting for connection to become available
Oh and I am using OpenHAB 2.4

What am I doing wrong?

If you restart openhab ( sudo systemclt stop openhab2 then sudo systemctl start openhab2) and watch the logs do you see where your echo/Amazon device changes from offline to online? If not you may need to check your setup my reviewing the steps in first post.

I am not sure I have configured all correctly.
In Paper UI my Amazon account shows online and I have add a thing Amazon Echo it shows online
Is a Raspberry Pi with the Amazon AVS Sample to be configured as an Amazon Echo?

amazonechocontrol:account:385cc033’ changed from OFFLINE (CONFIGURATION_PENDING): Wait for login to ONLINE

If setup is correct something like this will be in the logs when Amazon goes online:
‘amazonechocontrol:account:account1’ changed from OFFLINE (COMMUNICATION_ERROR): alexa.amazon.com to ONLINE

Notice the difference in your log vs this one? “Wait for login to ONLINE” vs"changed from OFFLINE to ONLINE.

Check that you have completed the logon steps.

1 Like

Thank you for your time and reply.
This is my log when I reboot OpenHAB. I think maybe I did the configuration wrong.
Can you point me to an easy to understand guide.

2019-10-15 17:41:34.666 [vent.ItemStateChangedEvent] - AmazonEcho_MusicVoiceCommand changed from NULL to

2019-10-15 17:41:34.670 [vent.ItemStateChangedEvent] - AmazonEcho_Start changed from NULL to

2019-10-15 17:41:34.673 [vent.ItemStateChangedEvent] - AmazonEcho_Title changed from NULL to

2019-10-15 17:46:23.430 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:flashbriefingprofile:385cc033:1’ changed from ONLINE to UNINITIALIZED

2019-10-15 17:46:23.434 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:flashbriefingprofile:385cc033:1’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

2019-10-15 17:46:23.437 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:echo:76ecc72a’ changed from ONLINE to UNINITIALIZED

2019-10-15 17:46:23.441 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:echo:76ecc72a’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

2019-10-15 17:46:23.443 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:flashbriefingprofile:e7331fe7’ changed from ONLINE to UNINITIALIZED

2019-10-15 17:46:23.447 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:flashbriefingprofile:e7331fe7’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

2019-10-15 17:46:23.450 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:account:385cc033’ changed from ONLINE to UNINITIALIZED

2019-10-15 17:46:23.469 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:account:385cc033’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

2019-10-15 17:46:25.038 [temChannelLinkRemovedEvent] - Link ‘AmazonEcho_Start => amazonechocontrol:echo:76ecc72a:startCommand’ has been removed.

2019-10-15 17:46:25.074 [temChannelLinkRemovedEvent] - Link ‘AmazonEcho_MusicVoiceCommand => amazonechocontrol:echo:76ecc72a:playMusicVoiceCommand’ has been removed.

2019-10-15 17:46:25.116 [temChannelLinkRemovedEvent] - Link ‘FlashBriefing1_Save => amazonechocontrol:flashbriefingprofile:385cc033:1:save’ has been removed.

2019-10-15 17:46:25.176 [temChannelLinkRemovedEvent] - Link ‘AmazonEcho_Title => amazonechocontrol:echo:76ecc72a:title’ has been removed.

2019-10-15 17:46:25.227 [temChannelLinkRemovedEvent] - Link ‘FlashBriefing1_Active => amazonechocontrol:flashbriefingprofile:385cc033:1:active’ has been removed.

2019-10-15 17:47:37.346 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘amazonControls.items’

2019-10-15 17:47:57.847 [.ItemChannelLinkAddedEvent] - Link ‘AmazonEcho_Start-amazonechocontrol:echo:76ecc72a:startCommand’ has been added.

2019-10-15 17:47:57.892 [.ItemChannelLinkAddedEvent] - Link ‘AmazonEcho_MusicVoiceCommand-amazonechocontrol:echo:76ecc72a:playMusicVoiceCommand’ has been added.

2019-10-15 17:47:57.965 [.ItemChannelLinkAddedEvent] - Link ‘FlashBriefing1_Save-amazonechocontrol:flashbriefingprofile:385cc033:1:save’ has been added.

2019-10-15 17:47:58.053 [.ItemChannelLinkAddedEvent] - Link ‘AmazonEcho_Title-amazonechocontrol:echo:76ecc72a:title’ has been added.

2019-10-15 17:47:58.139 [.ItemChannelLinkAddedEvent] - Link ‘FlashBriefing1_Active-amazonechocontrol:flashbriefingprofile:385cc033:1:active’ has been added.

2019-10-15 17:48:01.908 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:account:385cc033’ changed from UNINITIALIZED to INITIALIZING

2019-10-15 17:48:01.971 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:account:385cc033’ changed from INITIALIZING to OFFLINE (CONFIGURATION_PENDING): Wait for login

2019-10-15 17:48:02.032 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:flashbriefingprofile:385cc033:1’ changed from UNINITIALIZED to INITIALIZING

2019-10-15 17:48:02.045 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:flashbriefingprofile:e7331fe7’ changed from UNINITIALIZED to INITIALIZING

2019-10-15 17:48:02.061 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:flashbriefingprofile:385cc033:1’ changed from INITIALIZING to UNKNOWN

2019-10-15 17:48:02.074 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:flashbriefingprofile:e7331fe7’ changed from INITIALIZING to UNKNOWN

2019-10-15 17:48:02.179 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:echo:76ecc72a’ changed from UNINITIALIZED to INITIALIZING

2019-10-15 17:48:02.189 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:echo:76ecc72a’ changed from INITIALIZING to UNKNOWN

2019-10-15 17:48:04.888 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:flashbriefingprofile:e7331fe7’ changed from UNKNOWN to ONLINE

2019-10-15 17:48:04.959 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:flashbriefingprofile:385cc033:1’ changed from UNKNOWN to ONLINE

2019-10-15 17:48:05.172 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:echo:76ecc72a’ changed from UNKNOWN to ONLINE

2019-10-15 17:48:05.427 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:account:385cc033’ changed from OFFLINE (CONFIGURATION_PENDING): Wait for login to ONLINE

2019-10-15 17:48:08.738 [vent.ItemStateChangedEvent] - AmazonEcho_MusicVoiceCommand changed from NULL to

2019-10-15 17:48:08.751 [vent.ItemStateChangedEvent] - AmazonEcho_Start changed from NULL to

2019-10-15 17:48:08.754 [vent.ItemStateChangedEvent] - AmazonEcho_Title changed from NULL to

Are you setting this up all via PaperUI or using text files? Sorry I haven’t reviewed the setup sets in some time so not sure what’s recommended but I use text files.

For text you will need a Things file with your Amazon info like this:

Bridge amazonechocontrol:account:account1 "Amazon Account" [amazonSite="amazon.com", email="youremail@yahoo.com", password="YOUR Secret Password ", pollingIntervalInSeconds=30]
{
    Thing echo    Echo_Plus      "Alexa Living Room" [serialNumber="G090LA097387653v2"]
}

I will take a look through the setup again and see what’s new. If your usesing Paper UI look for a place to enter password and such.

EDIT:
Looks like a Things file may not be needed and everything can be done via PaperUI but not 100% sure b/c scrolling down it show’s a Things file example.

Are you getting to the Amazon account login page, after creating the Amazon Thing Account, (where it allows you to log in and shows your devices with serial numbers and such)? You may need to enter the local IP address of your OH server for this page to open, e.g. http://10.0.1.20:8080/amazonechocontrol/account1

I am setting Amazon up via Paper UI and I was getting the Amazon account login page and found the serial number
Amazon Echo Control - Amazon

App name: Henrik’s Open HAB Alexa Binding
Connected to: https://alexa.amazon.com Change
Check Thing in Paper UI

Device Serial Number State Thing Type Family
Henrik’s Alexa through Cortana 4ca16d670cea471cbcf549eed49*** Offline Not defined HALO A2R2GLZH1DFYQO
This Device c17215bb3b5c4bdd9d7a2f0d7c*** Online Not defined VOX A2TF17PFR55MTB
Henrik’s AVS Tutorials Project b78d6e58d4474afeac324d5d83*** Online [Amazon Echo]serialNumber=b78d6e58d4474afeac324d5d83***) UNKNOWN A16T4CDGXSPJ3B

There is no feedback from amazon, so the binding can not show the state for running flash briefing