Release Candidate and Support: Amazon Echo Control Binding

Tags: #<Tag:0x00007f2fbd8ecaf8> #<Tag:0x00007f2fbd8ec788> #<Tag:0x00007f2fbd8f3ce0>

Wait… Does that mean… You now can control every only Alexa device? Which would mean you can control and integrate eg. a Sonoff device or cheap power plug without flashing it first?
This is what I intentional wanted to with this binding back in Dec 2017! :smiley:
If so, this would be insanely huge! Like Christmas and Easter combined huge.

1 Like

Yes the Spot supports this. Until last week everything was correct…

Hi, I checked this now but I did not found any issue. The binding creates the correct json:

{  
   "behaviorId":"PREVIEW",
   "sequenceJson":"{\"@type\":\"com.amazon.alexa.behaviors.model.Sequence\",\"startNode\":{\"@type\":\"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\",\"type\":\"AlexaAnnouncement\",\"operationPayload\":{\"deviceType\":\"A3S5BH2HU6VAYF\",\"deviceSerialNumber\":\"G090L91174230075\",\"locale\":\"\",\"customerId\":\"A1DGS1OFUH1JNT\",\"expireAfter\":\"PT5S\",\"content\":[{\"locale\":\"\",\"display\":{\"title\":\"SmartHome\",\"body\":\"Dies ist ein Test\"},\"speak\":{\"type\":\"text\",\"value\":\" \"}}],\"target\":{\"customerId\":\"A1DGS1OFUH1JNT\",\"devices\":[{\"deviceSerialNumber\":\"G090L91174230075\",\"deviceTypeId\":\"A3S5BH2HU6VAYF\"}]}}}}",
   "status":"ENABLED"
}

But of course I can not verify what happens then because I only have echo dots.
But your posted request have some wrong double quotes. It should be:

{ "sound": true, "title": "SmartHome", "body": "Dies ist ein Test"}

But this seems to be not your issues, because you request will fail completely.

Could you test if the announcement works correct if you create an alexa routine for it? I know there is not split in title and body, but make a try.

And you wrote, that it has worked with an older version of the binding. Could you retest this? It would not be the fist time, the the problem is on the amazon site…

Best,
Michael

Not yet every, but a lot of them depending on the capabilities :sunglasses:

No, not at the moment. I’am not sure if I should create a own channel for this. So I see 3 possibilities:

  1. Using the volume channel from TTS
  2. Adding a volume property to the JSON format syntax of the channel
  3. Own volume channel

You and all other users are welcome to discuss this!

This never worked for me.
I can change the TTS Volume channel to 100 and the Echo still uses the global volume :frowning:

Thank you for the quick answer.
Will you add a changelog again in future ?

I would like to try to do it with REST calls, could you give me some kind of example how it would work?
If I manage to realize the timer thing, then my amazon control setup would be complete.

Thanks for all the work you put into this, I use this binding daily for a lot of different usecases.

Michi gave it the thumbs up so here it is. Hope its useful…

2 Likes

I can confirm this behavior, but I figured out that the announcements typically uses the system volume (for music and so on).

I think it would be iseful if the volume can be defined in the message itself (json). So in this case it would not be necessary to define a own channel. And if somebody wants to control the volume using the gui he can use a dimmer item for example.

What do you think?

I do use the volume channel, without tts

That would be great and i think iobroker already does it this way.

I´m currently struggling to send TTS messages with different volumes and resetting the volume to the “normal” level afterwards.
Sometimes the two commands (volume + tts) are already enough for the Amazon servers to only do one of them.

From the iobroker Alexa Git:

Detailed information Speak: Type in here what you want Alexa to say. You can also adjust the volume of Alexa by giving a percentage before your text. Example: 10;Alexa is saying Alexa with 10% volume, while 100;Alexa is 100% volume. Normally you only can send 250 characters per speak command. By using the semicolon it is possible to write as much as you want, as long as you separate 250 characters with a semicolon. Alexa will then speak the text after each other with a small break. You also can use the volume together with more 255 blocks by writing #Volume;#Block1;#Block2, a.s.o A volume set here will be used over a defined speak-volume.

Kind regards

You should use the textToSpeechVolume channel instead of volume, then the tts setting and resetting is done automatically in one call to the sever

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”