Release Candidate and Support: Amazon Echo Control Binding

Hi michi,

I know. I will try to get a log. Echo is speaking the text at desired volume and after that it is set to the volume before. when talking to alexa Approx. 1 hour later it´s volume is on the lowest level and you can hardly understand

This Binding has made my holiday. Was able to use it to control Halo Bluetooth mesh lights through an Alexa skill. Good job michi and everyone else involved.

Is it possible to play an “Alarm”-sound when a doorcontact is activated? If yes, how? Thank you!

@siod Yes, via rules.

Here I use Alexa to sound an alarm if the proxy item is on, when the garage door opens.

rule "Turn on alarm sound for 15 seconds if garage door opens"
when
    Item ESP_Easy_Door changed to OFF
then
    if(Garage_Door_Alert.state == ON){
        Echo_Plus_PlayAlarmSound.sendCommand('ECHO:system_alerts_atonal_02')
            if (stopAlarmTimer === null)
            {
            stopAlarmTimer = createTimer(now.plusSeconds(15)) [|
            stopAlarmTimer.cancel()
            stopAlarmTimer = null
            Echo_Plus_PlayAlarmSound.sendCommand('')
            Garage_Door_Alert.sendCommand(OFF)
        ]
        }
    }
end

See the top of this thread for how to select the alarm you want use. Hint you will need to go to here: You will find the serial number in the alexa app or on the webpage YOUR_OPENHAB/amazonechocontrol/YOUR_ACCOUNT (e.g. http://openhab:8080/amazonechocontrol/account1 ).

As mentioned in first post:

Playing an alarm sound for 15 seconds with an openHAB rule if an door contact was opened:

  1. Do get the ID of your sound, follow the steps in “How To Get IDs”
  2. Write down the text in the square brackets. e.g. ECHO:system_alerts_repetitive01 for the nightstand sound
  3. Create a rule for start playing the sound:
var Timer stopAlarmTimer = null

rule "Turn on alarm sound for 15 seconds if door opens"
when
    Item Door_Contact changed to OPEN
then
    Echo_Living_Room_PlayAlarmSound.sendCommand('ECHO:system_alerts_repetitive01')
    if (stopAlarmTimer === null)
    {
        stopAlarmTimer = createTimer(now.plusSeconds(15)) [|
            stopAlarmTimer.cancel()
            stopAlarmTimer = null
            Echo_Living_Room_PlayAlarmSound.sendCommand('')
        ]
    }
end

Note 1: Do not use a to short time for playing the sound, because alexa needs some time to start playing the sound.
It’s not recommended to use a time below 10 seconds.

Note 2: The rule have no effect for your default alarm sound used in the alexa app.

1 Like

will test asap, Thank you!!

Could you really solve this? With a little try-and-error I figured out, that the -syntax works just fine on an echo dot, but doesn’t on a Sonos Beam.
Has anyone got an idea why that is (and possibly how to fix it)?

So I tested this:

var Timer stopAlarmTimer = null

rule "Turn on alarm sound for 15 seconds if door opens"
when
    Item TuereWg changed to OPEN
then
    EchoWz.sendCommand('ECHO:system_alerts_repetitive_01')
    if (stopAlarmTimer === null)
    {
        stopAlarmTimer = createTimer(now.plusSeconds(15)) [|
            stopAlarmTimer.cancel()
            stopAlarmTimer = null
            EchoWz.sendCommand('')
        ]
    }
end

but Alexa is just saying “ECHO:system_alerts_repetitive_01”, not playing a soundfile…

@siod: Looking at ‘ECHO:system_alerts_repetitive_01’ in your rule is that correct when matched to the info from your amazon account?

I ask because the alert sound syntax is different when comparing yours to the example in the docs at top of topic. Note the last part does not have a _ between repetitive and 01.

Try changing your rule an use this line:

EchoWz.sendCommand('ECHO:system_alerts_repetitive01')

Thanks for the hint, but the “_” is correct.

What do you see in the logs when running this rule?

2019-12-31 19:15:26.858 [ome.event.ItemCommandEvent] - Item 'EchoWz' received command ECHO:system_alerts_repetitive_01

2019-12-31 19:15:26.864 [nt.ItemStatePredictedEvent] - EchoWz predicted to become ECHO:system_alerts_repetitive_01

2019-12-31 19:15:26.880 [vent.ItemStateChangedEvent] - EchoWz changed from  to ECHO:system_alerts_repetitive_01

2019-12-31 19:15:29.136 [vent.ItemStateChangedEvent] - EchoWz changed from ECHO:system_alerts_repetitive_01 to 

2019-12-31 19:15:29.927 [vent.ItemStateChangedEvent] - TuereWg changed from OPEN to CLOSED

2019-12-31 19:15:41.884 [ome.event.ItemCommandEvent] - Item 'EchoWz' received command 

2019-12-31 19:15:41.889 [nt.ItemStatePredictedEvent] - EchoWz predicted to become 

Log looks good.:thinking:

Volume and Alarm Sound channels are linked correctly? If using files for your Alexa Thing make sure the correct syntax is used.

I have the same/similar problem, do you use openhab 2.5 stable version?

In an older openhab version I used following syntax to play an alarm sound followed by a text message, but this is currently also not woking with OH 2.5 stable release:

 gAlexa_alarm.sendCommand('ECHO:system_alerts_melodic_07')
  Thread::sleep(7000)
  gAlexa_alarm.sendCommand('')
  Thread::sleep(2000)
  gAlexa_tts.sendCommand(text)

I hear the text but in most of the cases I do not hear an alarm sound

@H102

Volume and Alarm Sound channels are linked correctly?

Don´t know, what di I have to configure here? I just set up this rule…

@HALLO01
Yes, I´m using the latest stable release

edit:

Now I set up an alarm item in Paper UI Linked to my echo. From the “Controls” Site of PaperUI I can select and play the sounds now.

Anyway, that was just a try, it won´t help me playing a sound as I defined it in my rule

@michi My announcement channel did not work on my echos, today I figured out why.
Maybe you can improve your documentation: Please add a note, that for this channel the announcement feature must be activated at the echo devices.
I did not find this hint, if I have missed it, sorry for spam :blush:

Have you got the ascending alarm feature enabled? If yes, then that could cause your problem. If the alarm starts off quiet then it may not have enough time to ramp up to be audible. Disable it per device. The setting for this can be found under General sound settings.

M

It is already deactivated, so this couldn’t be the issue :neutral_face:

Maybe it is some other setup issue of the echo device - I will check…

@m4rk Are you using OH 2.5.0 stable?

I am using 2.4

Thank you, that is interesting. I did not know this.

I have just discovered that the ‘last alexa voice command’ has been added and wow, this solves everything so big pat on the back. It was the main thing missing from my smart setup.

Have just dumped all my routines (just the actions and kept the triggers so Alexa doesn’t say ‘not sure what you meant) from Alexa (always deleting stuff / never reliable would forget to turn a light off etc),
Added 2 rules:
1 to detect change to the string for my 7 echo devices and update 1 proxy item
1 to detect the change of the proxy item and do stuff on a switch/case statement.

Works perfectly every single time!

1 Like