Released: Openhab2 Amazon Echo Control Binding (controlling alexa from openhab2)

Tags: #<Tag:0x00007f1e5f40e708> #<Tag:0x00007f1e5f40e3e8> #<Tag:0x00007f1e5f40e050>
(Michael Geramb) #1

Hello community,

FAQ: When I have to remove and recreate things for a binding upgrade?

Download Latest Version
The lastest release - Beta 2.5 (8) - this version is newer than the daily snapshot build from OH 2.5, which feature state is from version Beta 2.5 (3) and bug fix state is of version 2.5 (6).

Download Beta 2.5 (8)

Whats new in Beta 2.5 (8):

  • Fix an issue of Beta 7 where new login are not possible anymore

Whats new in Beta 2.5 (7):

  • Fix issue ‘Bad request’ for TTS calls if the devices are owned by another customer id than the account
  • Repeat calls in case of ‘Bad request’ if there are many request at the same time

Whats new in Beta 2.5 (6):

  • Fix the startRoutine channel if more than 20 routines are defined
  • New channel announcement for echo show and echo spot devices

Whats new in Beta 2.5 (5):

  • Fix memory and thread leak if internet connection is lost
  • Fix problem with not updated channels after some while

Whats new in Beta 2.5 (4):

  • Bugfix for error in notification updates - bug since 2.5 (3), no need to upgrade for 2.4 (2) users

Whats new in Beta 2.5 (3):

  • Bugfix to handle refresh commands for initializing newly created item links
  • Bugfix for ‘Unknown’ in lastVoiceCommand channel
  • New channel: nextMusicAlarm

Whats new in Beta 2.5 (2):

  • Bugfix for wrong encoding for french sites
  • New channels: nextReminder, nextTimer, nextAlarm
  • SSML support for TTS

Whats new in Beta 2.5 (1):

  • Cache for state description, this means a better performance for REST calls and the PaperUI

Whats new in Beta 2.4 (10):

  • Proxy function fixed for PUT and POST
  • Support of TTS for users which does not use the main account

Whats new in Beta 2.4 (9) --> This is the released 2.4 version:

  • Fixed tuneIn channels

Whats new in Beta 2.4 (8):

  • Try to bugfix login problems
  • announcement channel removed, because it does not work and I have no possibility to test it because the feature is not available at

Whats new in Beta 2.4 (7):

  • Workaround for bad formatted login url from the amazon server
  • New channel announcement. This channel is not yet tested by me because it is not supported in But should work. Please give me feedback!

Whats new in Beta 2.4 (6):

  • Support for GZIP content response of amazon server (reduce the network traffic)
  • Fix the bug in the 2 factor authentication. It can now be used without entering the code in the password field, instead you get the amazon dialog to enter the verification code.

Whats new in Beta 2.4 (5):

  • Fix problem with changed amazon response

Whats new in Beta 2.4 (4):
this version is only tested with Beta testers from other domains are welcome to give me feedback.

  • New channel textToSpeechVolume
  • New login method which prevents problems with session renew
  • No password storage in openHAB configuration
  • Support for 2 factor authentication (currently only by using the code in the password field)
  • Alexa activation word is dropped for channel lastVoiceCommand
  • Logging of push is changed to debug level standard messages

If you upgrade from previous version, you have to login to the amazon account one time (See “First Steps” below)

Whats new in Beta 2.4 (3):
WARNING: this beta has maybe problems by resolving bundles. It would to get feedback if it works or not and on which OH version and platform.

  • New channel mediaProgress
  • New channel mediaProgressTime
  • New channel notificationVolume
  • New channel ascendingAlarm

Whats new in Beta 2.4 (2):

  • update of channels triggered by Web-Socket connection to the amazon server
  • new channel “lastVoiceCommand” -> See “Steps for update from previous version (If you want use the new channels):” to get the new channel

Whats new in Beta 2.4 (1):

  • fixed Problem with volumne state

OpenHAB 2.3 Users:
The binding is now included in the official distribution. Before you upgrade to the latest version read this post.

OpenHAB 2.2 Users:
The RC3 will be the last available build for OpenHAB 2.2. It is technical ident with the version included int OpenHAB 2.3.
Use the marketplace of download it from here.

Please check the documentation to see a detailed description of the channels.

Steps for update from previous version (If you want use the new channels):

  1. Remove discovered echo devices from your inbox
  2. Remove all your existing echo things (If you have created them in PaperUI)
  3. Replace now the binding jar
  4. Create your things to get the new channels
  5. In PaperUI some channels are only shown if the “show more” (top right corner) option in the thing page is activated

Amazon Echo Control Binding

This binding can control Amazon Echo devices (Alexa).

It provides features to control and view the current state of echo devices:

  • use echo device as text to speech from a rule
  • volume
  • pause/continue/next track/previous track
  • connect/disconnect bluetooth devices
  • start playing tuneIn radio
  • start playing Amazon Music
  • control of multi room music
  • show album art image in sitemap
  • speak a reminder message
  • plays an alarm sound
  • start traffic news
  • start daily briefing
  • start weather report
  • start good morning report
  • start automation routine
  • activate multiple configurations of flash briefings
  • start playing music by providing the voice command as text (Works with all music providers)
  • get last spoken voice command
  • change the volume of the alarm
  • change the equalizer settings
  • get information about the next alarm, reminder and timer

Some ideas what you can do in your home by using rules and other openHAB controlled devices:

  • Automatic turn on your amplifier and connect echo with bluetooth if the echo plays music
  • If the amplifier was turned of, the echo stop playing and disconnect the bluetooth
  • The echo starts playing radio if the light was turned on
  • The echo starts playing radio at specified time
  • Remind you with a voice message, that a window is open for a long time and it is winter
  • Start a routine which welcome you, if you come home
  • Start a routine which switch a smart home device connected to alexa
  • Start your briefing if you turn on the light first time in the morning
  • Have different flash briefing in the morning and evening
  • Let alexa say ‘welcome’ to you if you open the door
  • Implement own handling for voice commands in a rule
  • Change the equalizer settings depending on the bluetooth connection
  • Turn on a light on your alexa alarm time


This binding uses the same API as the Web-Browser-Based Alexa site (
In other words, it simulates a user which is using the web page.
Unfortunately, the binding can get broken if Amazon change the web site.

The binding is tested with,,, and accounts, but should also work with all others.

Supported Things

Thing type id Name
account Amazon Account
echo Amazon Echo Device
echospot Amazon Echo Spot Device
echoshow Amazon Echo Show Device
wha Amazon Echo Whole House Audio Control
flashbriefingprofile Flash briefing profile

First Steps

  1. Create an ‘Amazon Account’ thing
  2. open the url YOUR_OPENHAB/amazonechocontrol in your browser (e.g. http://openhab:8080/amazonechocontrol/), click the link for your account thing and login.
  3. You should see now a message the the login was successful


After configuration of the account thing with the login data, the echo devices registered in the amazon account, get discovered.
If the device type is not known by the binding, the device will not be discovered.
But you can define any device listed in your alexa app with the best matching existing device (e.g. echo).
You will find the required serial number in settings of the device in the alexa app.

Binding Configuration

The binding does not have any configuration.
The configuration of your amazon account must be done in the ‘Amazon Account’ device.

Thing Configuration

The Amazon Account does not need any configuration.

Amazon Devices

All Amazon devices (echo, echospot, echoshow, wha) needs the following configurations:

Configuration name Description
serialNumber Serial number of the amazon echo in the Alexa app

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).

Flash Briefing Profile

The flashbriefingprofile thing has no configuration parameters.
It will be configured at runtime by using the save channel to store the current flash briefing configuration in the thing.


Channel Type ID Item Type Access Mode Thing Type Description
player Player R/W echo, echoshow, echospot, wha Control the music player (Supported commands: PLAY or ON, PAUSE or OFF, NEXT, PREVIOUS, REWIND, FASTFORWARD)
volume Dimmer R/W echo, echoshow, echospot Control the volume
equalizerTreble Number R/W echo, echoshow, echospot Control the treble (value from -6 to 6)
equalizerMidrange Number R/W echo, echoshow, echospot Control the midrange (value from -6 to 6)
equalizerBass Number R/W echo, echoshow, echospot Control the bass (value from -6 to 6)
shuffle Switch R/W echo, echoshow, echospot, wha Shuffle play if applicable, e.g. playing a playlist
imageUrl String R echo, echoshow, echospot, wha Url of the album image or radio station logo
title String R echo, echoshow, echospot, wha Title of the current media
subtitle1 String R echo, echoshow, echospot, wha Subtitle of the current media
subtitle2 String R echo, echoshow, echospot, wha Additional subtitle of the current media
providerDisplayName String R echo, echoshow, echospot, wha Name of the music provider
bluetoothMAC String R/W echo, echoshow, echospot Bluetooth device MAC. Used to connect to a specific device or disconnect if a empty string was provided
bluetooth Switch R/W echo, echoshow, echospot Connect/Disconnect to the last used bluetooth device (works after a bluetooth connection was established after the openHAB start)
bluetoothDeviceName String R echo, echoshow, echospot User friendly name of the connected bluetooth device
radioStationId String R/W echo, echoshow, echospot, wha Start playing of a TuneIn radio station by specifying it’s id or stops playing if a empty string was provided
radio Switch R/W echo, echoshow, echospot, wha Start playing of the last used TuneIn radio station (works after the radio station started after the openhab start)
amazonMusicTrackId String R/W echo, echoshow, echospot, wha Start playing of a Amazon Music track by it’s id od stops playing if a empty string was provided
amazonMusicPlayListId String W echo, echoshow, echospot, wha Write Only! Start playing of a Amazon Music playlist by specifying it’s id od stops playing if a empty string was provided. Selection will only work in PaperUI
amazonMusic Switch R/W echo, echoshow, echospot, wha Start playing of the last used Amazon Music song (works after at least one song was started after the openhab start)
remind String R/W echo, echoshow, echospot Write Only! Speak the reminder and sends a notification to the Alexa app (Currently the reminder is played and notified two times, this seems to be a bug in the amazon software)
nextReminder DateTime R echo, echoshow, echospot Next reminder on the device
playAlarmSound String W echo, echoshow, echospot Write Only! Plays ans Alarm sound
nextAlarm DateTime R echo, echoshow, echospot Next alarm on the device
nextMusicAlarm DateTime R echo, echoshow, echospot Next music alarm on the device
nextTimer DateTime R echo, echoshow, echospot Next timer on the device
startRoutine Switch W echo, echoshow, echospot Write Only! Type in what you normally say to Alexa without the preceding “Alexa,”
musicProviderId String R/W echo, echoshow, echospot Current Music provider
playMusicVoiceCommand String W echo, echoshow, echospot Write Only! Voice command as text. E.g. ‘Yesterday from the Beatles’
startCommand String W echo, echoshow, echospot Write Only! Used to start anything. Available options: Weather, Traffic, GoodMorning, SingASong, TellStory, FlashBriefing and FlashBriefing. (Note: The options are case sensitive)
announcement String W echoshow, echospot Write Only! Display the announcement message on the display. See in the tutorial section to learn how it’s possible to set the title and turn off the sound.
textToSpeech String W echo, echoshow, echospot Write Only! Write some text to this channel and alexa will speak it. It is possible to use plain text or SSML: e.g. I want to tell you a secret.<amazon:effect name=“whispered”>I am not a real human.</amazon:effect>
textToSpeechVolume Dimmer R/W echo, echoshow, echospot Volume of the textToSpeech channel, if 0 the current volume will be used
lastVoiceCommand String R/W echo, echoshow, echospot Last voice command spoken to the device. Writing to the channel starts voice output.
mediaProgress Dimmer R/W echo, echoshow, echospot Media progress in percent
mediaProgressTime Number:Time R/W echo, echoshow, echospot Media play time
mediaLength Number:Time R echo, echoshow, echospot Media length
notificationVolume Dimmer R echo, echoshow, echospot Notification volume
ascendingAlarm Switch R/W echo, echoshow, echospot Ascending alarm up to the configured volume
save Switch W flashbriefingprofile Write Only! Stores the current configuration of flash briefings within the thing
active Switch R/W flashbriefingprofile Active the profile
playOnDevice String W flashbriefingprofile Specify the echo serial number or name to start the flash briefing.

Advanced Feature Technically Experienced Users

The url <YOUR_OPENHAB>/amazonechocontrol/<YOUR_ACCOUNT>/PROXY/<API_URL> provides a proxy server with an authenticated connection to the amazon alexa server. This can be used to call alexa api from rules.

E.g. to read out the history call from an installation on openhab:8080 with a account named account1:


Full Example


Bridge amazonechocontrol:account:account1 "Amazon Account" @ "Accounts" 
    Thing echo                 echo1          "Alexa" @ "Living Room" [serialNumber="SERIAL_NUMBER"]
    Thing echoshow             echoshow1      "Alexa" @ "Kitchen" [serialNumber="SERIAL_NUMBER"]
    Thing echospot             echospot1      "Alexa" @ "Sleeping Room" [serialNumber="SERIAL_NUMBER"]
    Thing wha                  wha1           "Ground Floor Music Group" @ "Music Groups" [serialNumber="SERIAL_NUMBER"]
    Thing flashbriefingprofile flashbriefing1 "Flash Briefing Technical" @ "Flash Briefings" 
    Thing flashbriefingprofile flashbriefing2 "Flash Briefing Life Style" @ "Flash Briefings" 

You will find the serial number in the Alexa app.


Sample for the Thing echo1 only. But it will work in the same way for the other things, only replace the thing name in the channel link.
Take a look in the channel description above to know, which channels are supported by your thing type.

Group Alexa_Living_Room <player>

// Player control
Player Echo_Living_Room_Player                "Player"                                (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:player"}
Dimmer Echo_Living_Room_Volume                "Volume [%.0f %%]" <soundvolume>        (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:volume"}
Number Echo_Living_Room_Treble                "Treble"                                (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:equalizerTreble"}
Number Echo_Living_Room_Midrange              "Midrange"                              (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:equalizerMidrange"}
Number Echo_Living_Room_Bass                  "Bass"                                  (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:equalizerBass"}
Switch Echo_Living_Room_Shuffle               "Shuffle"                               (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:shuffle"}

// Media channels
Dimmer Echo_Living_Room_MediaProgress    "Media progress"                             (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:mediaProgress"}
Number:Time Echo_Living_Room_MediaProgressTime    "Media progress time [%d %unit%]"   (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:mediaProgressTime"}
Number:Time Echo_Living_Room_MediaLength    "Media length [%d %unit%]"                (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:mediaLength"}

// Player Information
String Echo_Living_Room_ImageUrl              "Image URL"                             (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:imageUrl"}
String Echo_Living_Room_Title                 "Title"                                 (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:title"}
String Echo_Living_Room_Subtitle1             "Subtitle 1"                            (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:subtitle1"}
String Echo_Living_Room_Subtitle2             "Subtitle 2"                            (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:subtitle2"}
String Echo_Living_Room_ProviderDisplayName   "Provider"                              (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:providerDisplayName"}

// Music provider and start command
String Echo_Living_Room_MusicProviderId       "Music Provider Id"                     (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:musicProviderId"}
String Echo_Living_Room_PlayMusicCommand      "Play music voice command (Write Only)" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:playMusicVoiceCommand"}
String Echo_Living_Room_StartCommand          "Start Information" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:startCommand"}

// TuneIn Radio
String Echo_Living_Room_RadioStationId        "TuneIn Radio Station Id"               (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:radioStationId"}
Switch Echo_Living_Room_Radio                 "TuneIn Radio"                          (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:radio"}

// Amazon Music
String Echo_Living_Room_AmazonMusicTrackId    "Amazon Music Track Id"                 (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:amazonMusicTrackId"}
String Echo_Living_Room_AmazonMusicPlayListId "Amazon Music Playlist Id"              (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:amazonMusicPlayListId"}
Switch Echo_Living_Room_AmazonMusic           "Amazon Music"                          (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:amazonMusic"}

// Bluetooth
String Echo_Living_Room_BluetoothMAC          "Bluetooth MAC Address" <bluetooth>     (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:bluetoothMAC"}
Switch Echo_Living_Room_Bluetooth             "Bluetooth"             <bluetooth>     (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:bluetooth"}
String Echo_Living_Room_BluetoothDeviceName   "Bluetooth Device"      <bluetooth>     (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:bluetoothDeviceName"}

// Commands
String Echo_Living_Room_Announcement          "Announcement"                          (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:announcement"}
String Echo_Living_Room_TTS                   "Text to Speech"                        (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:textToSpeech"}
Dimmer Echo_Living_Room_TTS_Volume            "Text to Speech Volume"                 (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:textToSpeechVolume"}
String Echo_Living_Room_Remind                "Remind"                                (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:remind"}
String Echo_Living_Room_PlayAlarmSound        "Play Alarm Sound"                      (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:playAlarmSound"}
String Echo_Living_Room_StartRoutine          "Start Routine"                         (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:startRoutine"}
Dimmer Echo_Living_Room_NotificationVolume    "Notification volume"                   (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:notificationVolume"}
Switch Echo_Living_Room_AscendingAlarm    "Ascending alarm"                           (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:ascendingAlarm"}

// Feedbacks
String Echo_Living_Room_LastVoiceCommand          "Last voice command"                (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:lastVoiceCommand"}
DateTime Echo_Living_Room_NextReminder             "Next reminder"                     (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:nextReminder"}
DateTime Echo_Living_Room_NextAlarm                "Next alarm"                        (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:nextAlarm"}
DateTime Echo_Living_Room_NextMusicAlarm           "Next music alarm"                  (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:nextMusicAlarm"}
DateTime Echo_Living_Room_NextTimer                "Next timer"                        (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:nextTimer"}

// Flashbriefings
Switch FlashBriefing_Technical_Save   "Save (Write only)" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing1:save"} 
Switch FlashBriefing_Technical_Active "Active" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing1:active"}
String FlashBriefing_Technical_Play   "Play (Write only)" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing1:playOnDevice"}

Switch FlashBriefing_LifeStyle_Save   "Save (Write only)" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing2:save"} 
Switch FlashBriefing_LifeStyle_Active "Active" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing2:active"}
String FlashBriefing_LifeStyle_Play   "Play (Write only)" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing2:playOnDevice"}


sitemap amazonechocontrol label="Echo Devices"
        Frame label="Alexa" {
            Default   item=Echo_Living_Room_Player
            Slider    item=Echo_Living_Room_Volume
            Setpoint  item=Echo_Living_Room_Volume   minValue=0  maxValue=100 step=5
            Setpoint  item=Echo_Living_Room_Treble   minValue=-6 maxValue=6   step=1
            Setpoint  item=Echo_Living_Room_Midrange minValue=-6 maxValue=6   step=1
            Setpoint  item=Echo_Living_Room_Bass     minValue=-6 maxValue=6   step=1
            Slider    item=Echo_Living_Room_MediaProgress
            Text      item=Echo_Living_Room_MediaProgressTime
            Text      item=Echo_Living_Room_MediaLength
            Switch    item=Echo_Living_Room_Shuffle
            Image     item=Echo_Living_Room_ImageUrl      label=""
            Text      item=Echo_Living_Room_Title
            Text      item=Echo_Living_Room_Subtitle1
            Text      item=Echo_Living_Room_Subtitle2
            Text      item=Echo_Living_Room_ProviderDisplayName

            // The listed providers are only samples, you could have more
            Selection item=Echo_Living_Room_MusicProviderId mappings=[ 'TUNEIN'='Radio', 'SPOTIFY'='Spotify', 'AMAZON_MUSIC'='Amazon Music', 'CLOUDPLAYER'='Amazon']
            Text    item=Echo_Living_Room_MusicProviderId

            // To start one of your flashbriefings use Flashbriefing.<YOUR FLASHBRIEFING THING ID>
            Selection item=Echo_Living_Room_StartCommand mappings=[ 'Weather'='Weather', 'Traffic'='Traffic', 'GoodMorning'='Good Morning', 'SingASong'='Song', 'TellStory'='Story', 'FlashBriefing'='Flash Briefing', 'FlashBriefing.flashbriefing1'='Technical', 'FlashBriefing.flashbriefing2'='Life Style' ]

            Selection item=Echo_Living_Room_RadioStationId mappings=[ ''='Off', 's1139'='Antenne Steiermark', 's8007'='Hitradio Ö3', 's16793'='Radio 10', 's8235'='FM4' ]
            Text    item=Echo_Living_Room_RadioStationId
            Switch  item=Echo_Living_Room_Radio

            Text    item=Echo_Living_Room_AmazonMusicTrackId
            Text    item=Echo_Living_Room_AmazonMusicPlayListId
            Switch  item=Echo_Living_Room_AmazonMusic

            Text    item=Echo_Living_Room_BluetoothMAC
            // Change the <YOUR_DEVICE_MAC> Place holder with the MAC address shown, if alexa is connected to the device
            Selection item=Echo_Living_Room_BluetoothMAC mappings=[ ''='Disconnected', '<YOUR_DEVICE_MAC>'='Bluetooth Device 1', '<YOUR_DEVICE_MAC>'='Bluetooth Device 2']

            // These are only view of the possible options. Enable ShowIDsInGUI in the binding configuration and look in drop-down-box of this channel in the Paper UI Control section
            Selection item=Echo_Living_Room_PlayAlarmSound mappings=[ ''='None', 'ECHO:system_alerts_soothing_01'='Adrift', 'ECHO:system_alerts_atonal_02'='Clangy']

            Switch  item=Echo_Living_Room_Bluetooth
            Text    item=Echo_Living_Room_BluetoothDeviceName
            Text    item=Echo_Living_Room_LastVoiceCommand
            Slider  item=Echo_Living_Room_NotificationVolume
            Switch  item=Echo_Living_Room_AscendingAlarm

        Frame label="Flash Briefing Technical" {
            Switch  item=FlashBriefing_Technical_Save
            Switch  item=FlashBriefing_Technical_Active
            Text    item=FlashBriefing_Technical_Play

        Frame label="Flash Briefing Life Style" {
            Switch  item=FlashBriefing_LifeStyle_Save
            Switch  item=FlashBriefing_LifeStyle_Active
            Text    item=FlashBriefing_LifeStyle_Play

How To Get IDs

  1. Open the url YOUR_OPENHAB/amazonechocontrol in your browser (e.g. http://openhab:8080/amazonechocontrol/)
  2. Click on the name of the account thing
  3. Click on the name of the echo thing
  4. Scroll to the channel and copy the required ID


Let alexa speak a text from a rule:

  1. Create a rule with a trigger of your choice
rule "Say welcome if the door opens"
    Item Door_Contact changed to OPEN
    Echo_Living_Room_TTS.sendCommand('Hello World')

You can also use SSML to provide a better voice experience

rule "Say welcome if the door opens"
    Item Door_Contact changed to OPEN
    Echo_Living_Room_TTS.sendCommand('<speak>I want to tell you a secret.<amazon:effect name="whispered">I am not a real human.</amazon:effect>.Can you believe it?</speak>')

Show an announcement on the echo show or echo spot:

  1. Create a rule with a trigger of your choice


rule "Say welcome if the door opens"
    Item Door_Contact changed to OPEN
    Echo_Living_Room_Announcement.sendCommand('Door opened')

You can use a json formatted string to control the title and the sound:

{ "sound": true, "title": "<Title>", "body": "<Body Text>"}

Note: If you turn off the sound and alexa is playing music, it will anyway turn down the volume for a moment. This behavior can not be changed.

rule "Say welcome if the door opens"
    Item Door_Contact changed to OPEN
    Echo_Living_Room_Announcement.sendCommand('{ "sound": false, "title": "Doorstep", "body": "Door opened"}')

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"
    Item Door_Contact changed to OPEN
    if (stopAlarmTimer === null)
        stopAlarmTimer = createTimer(now.plusSeconds(15)) [|
            stopAlarmTimer = null

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.

Play a spotify playlist if a switch was changed to on:

  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. SPOTIFY for the spotify music provider
  3. Create a rule for start playing a song or playlist:
rule "Play a playlist on spotify if a switch was changed"
    Item Spotify_Playlist_Switch changed to ON
    Echo_Living_Room_PlayMusicCommand.sendCommand('Playlist Party')

Note: It’s recommended to test the command send to play music command first with the voice and the real alexa device. E.g. say ‘Alexa, Playlist Party’

Start playing weather/traffic/etc:

  1. Pick up one of the available commands: Weather, Traffic, GoodMorning, SingASong, TellStory, FlashBriefing
  2. Create a rule for start playing the information where you provide the command as string:
rule "Start wheater info"
    Item Spotify_Start_Wheater_Switch changed to ON

Start playing a custom flashbriefing on a device:

  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. flashbriefing.flashbriefing1
  3. Create a rule for start playing the information where you provide the command as string:
rule "Start wheater info"
    Item Spotify_Start_Wheater_Switch changed to ON


The idea for writing this binding came from this blog: (German).
Thank you Alex!
The technical information for the web socket connection to get live alexa state updates cames from Ingo. He has done the alexa iobrokern implementation
Thank you Ingo!

Trademark Disclaimer

TuneIn, Amazon Echo, Amazon Echo Spot, Amazon Echo Show, Amazon Music, Amazon Prime, Alexa and all other products and Amazon, TuneIn and other companies are trademarks™ or registered® trademarks of their respective holders.
Use of them does not imply any affiliation with or endorsement by them.

Steps for setup

Download the jar file (you will find the link in the top of this posting)
Copy it to the addons directory of your openhab2 installation (/usr/share/openhab2/addons for repository installation, /opt/openhab2/addons for manual installations)
Open the Paper UI
Check if the binding (Amazon Echo Control Binding) is listed under Configuration | Bindings
Navigate to the Inbox
You should find an „Amazon Account“ Thing
Accept it
Navigate to Things
Open the newly create Amazon Account Thing
Start editing (Press button in the upper left corner)
Select your amazon site (e.g.
Enter the email of the account which is used for the alexa
Enter the password of the account which is used for the alexa
Commit the settings by pressing the accept button in left upper corner (with the hook sign)
Now the Thing should go Online after view seconds, if not, an error should give you an hint whats was wrong

Follow this thread for updates!

Kind regards,

If you are looking for a wedding photographer, visit my site at I would be happy to see you!


I have planned to started the development of a binding to control amazon echo devices.

In the first version, it will be possible to send commands like pause, continue, next track, set volumn and so on from openhab to the echo device. For this step, I have already all the necessary knowhow.

In the second step, I trie to use the MQTT connection to the amazon server to get the state of the alexa device (e.g. Playing song xyz). I have seen already the communication in firefox development tools and hope that it is possible to reverse engineer the protocol.

In the third step, it should be possible to use alexa for text to speech notifications. I have seen already projects which sent the necessary voice command with an TTS engine to amazon and use a echo skill to get the device to speak. So it should be possible…

Is there currently anybody working on a similar binding? I mean a real binding not only the shell scripts which can be used with the exec binding.



Is it possible to use Alexa (Echo dot) as an output device for a TTS addon?
Openhab to control echo speaker?
Custom voice command and response (e.g. with Google or Alexa)?
Official Alexa Smart Home Skill for openHAB 2
How to control Alexa amazon echo with openhab?
TTS or Alexa or Google home in every room
[SOLVED] Amazon account login page not working
Official Alexa Smart Home Skill for openHAB 2
Google Maps widget with traffic
Alexa Skill not able to find new devices
Amazon binding error trying to configure
[SOLVED] Amazon binding problems
[SOLVED] Login failed: POST url '' failed: Not Found
Amazon Login Garbage Characters
Google Home vs Amazon Echo
OpenHab2 control Alexa Skill
Amazon Echo Control Binding gets uninistalled
Custom Widget: Amazon Echo Music Control
Alexa : Voice Announcements
openHAB can now use Amazon Echo devices to speak any text (TTS) - new feature in the amazonechocontrol binding
Home Connect addon: Looking for beta testers
HABPanel RELOADED - THEME / SKIN + Custom Widgets
Beginners questions smart home skill V3?
[Solved] Alexa more than one echo leads to error messages
OpenHAB/Raspberry stops working after 2-3 weeks running
openHAB as a back controller initially
Home Connect addon: Looking for beta testers
Amazon Echo Control Binding Errors
HABPanel connection lost Openhab 2.4
Configuration with Alexa Echo Dot
Sometimes 'internal server error 500' - no pattern recognizable
Amazon Echo error 409 conflict
[SOLVED] Login problems when setting up Echo Control binding
Alexa Rollershutter UP/DOWN only percentage works
(Christian Emerich) #2

sounds good, keep us informed on your achievements!

br. Christian


(Renier) #3

Can you elaborate how you can send a command to an echo device?

Is it directly network internally or via some skill you have to write?


(Michael Geramb) #4

You have to make http request to the amazon server. It’s easy to spy the network traffic in the web browser with the development tools if you open the alexa web-site. So I simulate the login and sent the same REST-calls to the server. In my prototype I can already make the login and sent commands.


(Rich Koshak) #5

Just to be sure, make sure you look at the Alexa skill and make sure you are not duplicating effort or implemented better on that existing add-on. I suspect a separate binding is needed but some of what you are describing like the TTS I think are already handled. I could be mistaken though.


(Joachim Boeddeker) #6

@rlkoshak, as i understand, this is the opposite of the current skill. With the current skill, Alexa is able to control items in openHAB.

This new binding offers functions to control Alexa from openHAB.

I don’t think any of these functions exist.


(Michael Geramb) #7

@job yes, you are right, it’s the opposite way, anyway for the notification feature it will be helpfull to extend the openhab alexa skill with a feature to translate a code which will be received as voice command to message which will be received from openhab. But this have to be discussed before I start implementing the notification.


(Lucky) #8

@michi I do this on Google Home already using a simple rule. Using TTS, you can create an audio file accessible remotely by Google Home. Do note that Google Home is also a Chromecast. Just recreate your audio and push that audio to Google Home via rule.

I dont have an Amazon Echo but I did make my own Alexa using AVS on an orange Pi. It’s easier to trigger Alexa (non-echo device) via the actual SDK rather than sniffing traffic and reverse engineering the protocol. Also note that the Assistant SDK (Google) latest version also now supports text in/text out, which means you can issue commands via text, for example: “Repeat after me Hello Lucky” and google home (or AssistantSDK enabled device) will say “Hello Lucky”. IDK it seems easier to just make all your GOogle Home devices belong to an entire-house homegroup, and have that homegroup play an audio file.


(Michael Geramb) #10

Is anyone interested in beta testing of my new binding?

Current features:
control volume
control pause/continue playing
showing current played title and provider
showing current bluetoothconnection

Leave a message if you are interested in testing and I will send a private message with the download link.


(Nathan Stratton) #11

I am very interested in the broadcast side, I have lots of echos and would like to use them for announcements.


(Marvyn Zalewski) #12

Hey @michi,

it would be awesome to have a binding like this. Looking forward with new information and in addition: if you need a beta tester i can do the job for you. Sadly i don’t own echo plus but a echo dot.

Kind regards :slight_smile:


(Joachim Boeddeker) #13

I would enjoy testing, i own two echo dots and one echo.


(Hadrian Sieger) #14

I would also like to help BETA testing.


(Alex) #15

I bet you were inspired by one of the following links:

Is it also planned to implement the following?

  • select echo-device
  • next|prev|fwd|rwd|shuffle|
  • connect/disconnect bluetooth device
  • play tunein radio
  • play library track
  • play Prime playlist
  • play Prime station
  • play Prime historical queue
  • play library playlist
  • list imported library tracks
  • list purchased library tracks
  • list Prime playlists
  • list Prime stations
  • list available devices
  • delete multiroom and/or create new multiroom containing devices
  • logoff

(Michael Geramb) #16

Yes, you are right. But not all of your listed features makes sense in an openhab binding. E.g. How should the list commands handled by a thing channel?
Hi Celaeno1,

select echo-device is implemented by creating a thing for each device
next/previous is already handled in the player channel
shuffle as it’s own channel

bluetooth connection is currently only readonly, but will be writeable in the next version.

For the other commands, I currently thinking about how the can be handled as channel. Any ideas?
Regards, Michael


(Alex) #17


I’m currently also using the allplay and the chromecast bindings. There are a lot of thing channels supported. Maybe you can adopt them.

See here:

Also the sonos binding should have many channels you could be inspired.

For me most wanted features would be:

Connect/disconnect Bluetooth
Play Tunein Radio

Thanks a lot.


(Michael Geramb) #18

Thanks for your posting. Some of the informations are already implemented. Bluetooth connection will be the next. :slight_smile:
Currently I do not know, if it is possible to start playing the radio without giving the internal station id to the api. Maybe it will be necessary to create manual a mapping file for your favorite stations. But I will check this in the next days.


(Michael Geramb) #19

Currently I close the beta test with the users which have posted here there wish for testing. You should have got an private message with the installation instructions, if not, please let me know.

I will start a public beta test, after I get response from the current testers. Follow this thread to get informed.


(Heiko Hegewald) #20

I would also like to help BETA testing.


(Michael Geramb) #21

New version is ready for testing! Please follow the instruction in the first posting of this thread!

Kind regards,

1 Like