Remote control for Alexa (Amazon Echo)
npm install iobroker.alexa2!Logo
!Number of Installations
!Number of Installations

!Test and Release


This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers. For more details and for information how to disable the error reporting see Sentry-Plugin Documentation! Sentry reporting is used starting with js-controller 3.0.
This adapter allows you to remotely control your Alexa (Amazon Echo) devices.
Big thanks go to soef for version 1 of the adapter and to Hauke and ruhr70 for ideas in their scripts from ioBroker-Forum (especially the media progress updates)!
Also, big thanks to meicker for support in documenting all of this and numerous users from ioBroker Forum for their testing support!
In the adapter namespace (e.g., alexa2.0) some channels are created
| State name | meaning |
|----------------------|--------------------------------------------------------|
| Echo-Devices.* | States per Echo device, see below |
| History.* | Infos for command history, see below |
| Smart-Home-Devices.* | States per smart home device and in general, see below |
| info.* | General information about the adapter status |
| requestResult | Error info for TuneIn and smart-home device requests |
| State name | meaning |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------|
| #clearOwnMessages | Only exists in own contact and a trigger deletes all messages that are send to himself (also includes messages to himself via App or devices!) |
| textMessage | Sends this text as message to the user. It is shown on all devices of this user with a "yellow ring" |
| State name | meaning | Comments |
|--------------------|-------------------------------------------------|--------------------------------------------------------------------------------------------------------------|
| deviceStop | Stop all actions on device | Button |
| deviceDoNotDisturb | Switch on/off "Do not Disturb" for all devices. | true/false, or number in seconds to enable (max 12h) or string in form "HH:MM" until this time it is enabled |
| State name | meaning | value |
|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
|
|
|
|
|
|
|
P1D = daily
XXXX-WD = on weekdays
XXXX-WE = on weekends
XXXX-WXX-1 = every monday
XXXX-WXX-2 = every tuesday
XXXX-WXX-3 = every wednesday
XXXX-WXX-4 = every thursday
XXXX-WXX-5 = every friday
XXXX-WXX-6 = every saturday
XXXX-WXX-7 = every sunday |
|
|
|
|
| New | Data to create a new Reminder as String in following format separated by ; as "timestamp;[label];[sound];[recurring]. timestamp as unix timestamp in ms, label as Text, sound as sound ID, recurring either empty for once, "DAILY" for daily or "WEEKLY=MO,TU,WE,TH,FR,SA,SU" with comma separated weekly day list. Fields in example above in brackets mean that they are optional! | String |
| triggered | ID of the Alarm that triggered last on this device | ID |
When changing an Alarm does not work, please make sure that the Alarm timepoint is in the future - so changing e.g. "sound" on an Alarm in the past will _not_ work!
| State name | meaning |
|------------|----------------------------------------------------------------------------------------------------|
| connected | Shows current connection status and allow connection (set to true) or disconnection (set to false) |
| unpair | Button to unpair this device from the echo device |
| State name | meaning | value |
|---------------|----------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|
| doNotDisturb | Switch on/off "Do not Disturb" for this device or group. Value is updated with Device Configuration updates from Cloud too | true/false, or number in seconds to enable (max 12h) or string in form "HH:MM" until this time it is enabled |
| flashbriefing | Briefing in 100 seconds - news etc.pp | Button |
| goodmorning | Good morning from Alexa ... | Button |
| funfact | Fun fact from Alexa ... (Only USA at the moment) | Button |
| joke | Joke from Alexa ... | Button |
| cleanup | Plays a "gong" tone like for start/end of listening mode ... | Button |
| curatedtts | Random sentence from the chosen area from Alexa ... | Text (allowed: "goodbye", "confirmations", "goodmorning", "compliments", "birthday", "goodnight", "iamhome") |
| singasong | Alexa sings a song ... | Button |
| speak | Alexa says what you type in here ... | Text Input |
| speakvolume | Adjust the speak volume of Alexa, this volume is set before the speak and reset afterwards | 0-100 |
| skill | Launch a defined Skill | Skill-ID as String |
| skillYours | launch a defined Skill - is prefilled with "Your Skills" as displayed in Alexa App too | Skill-ID as String |
| tellstory | Alexa tells a story | Button |
| traffic | Traffic news | Button |
| weather | Weather news | Button |
| deviceStop | Stop all actions on device | Button |
| notification | Send text notification to customer of the device | Text, optionally specify title "title;text" |
| announcement | Play announcement (like speak but with Bing before text)
Note: will only work if announcements (for this device) are activated and the device is not in "do not disturb"-mode | Text |
| ssml | Speak SSML XML string
Note: will only work if announcements (for this device) are activated and the device is not in "do not disturb"-mode | Text |
| textcommand | Send a Text command to Alexa,. Make sure to only use text (e.g. also 3 -> three and such, else Alexa might not correctly react to it!) | Text |
| sound | Play a sound on the device. | Text |
Detailed information Speak and Announcement: 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.
Partially also sounds from https://developer.amazon.com/en-US/docs/alexa/custom-skills/ask-soundlibrary.html work. Specify in speak or ssml as . Details and discussion please at https://forum.iobroker.net/topic/27509/ssml-audio
| State name | meaning | value |
|--------------|--------------------------|--------|
| turnOn | Turn FireTV and TV on | Button |
| turnOff | Turn FireTV and TV off | Button |
| videoPause | Pause the running video | Button |
| videoResume | Resume the current video | Button |
| navigateHome | Navigate to Home | Button |
| State name | meaning | value |
|-------------------|---------------------------------------------------------------------------------------------|---------------------------|
| capabilities | capabilities if the alexa device | Information |
| deviceType | device type from Amazon | Information |
| deviceTypeString | Device Type as string | Information |
| isMultiroomDevice | Is multiroom device - Multiroom is a virtual device group | Information, true / false |
| isMultiroomMember | Is Multiroom member - If true the device is part of a multiroom device group | Information, true / false |
| MultiroomParents | If this device is part of a multiroom device group this state shows the parent group device | Information |
| name | Name of Alexa Device | Information |
| SerialNumber | Serial number of Alexa device |
| State name | meaning | value |
|-----------------------|------------------------------------|------------|
| Amazon-Music | Phrase to play with Amazon Music | Text input |
| Amazon-Music-Playlist | Playlist to play with Amazon Music | Text input |
| My-Library | Phrase to play with My Library | Text input |
| My-Library-Playlist | Playlist to play with My Library | Text input |
| Tune-In | Phrase to play with Tune In | Text input |
| Tune-In-Playlist | Playlist to play with Tune In | Text input |
| State name | meaning | value |
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| allowNext | Is the Next/Forward action allowed? | Information |
| allowPlayPause | Is the Play/Pause action allowed? | Information |
| allowPrevious | Is the Previous action allowed? | Information |
| allowRepeat | Can Repeat function be used? | Information |
| allowShuffle | Can Shuffle function be used? | Information |
| ContentType | text field to put in desired content to play on this device | Information |
| controlForward | Button to trigger player "forward" command (30s) | Button |
| controlNext | Button to trigger player "next" command | Button |
| controlPause | Button to trigger player "pause" command | Button |
| controlPlay | Button to trigger player "play" command | Button |
| controlPrevious | Button to trigger player "previous" command | Button |
| controlRepeat | Button to trigger player "repeat" command | true / false |
| controlRewind | Button to trigger player "rewind" command (30s) | Button |
| controlShuffle | Switch to enable or disable Shuffle mode for player | true / false |
| currentAlbum | Current album actually playing | Information |
| currentArtist | Current artist actually playing | Information |
| currentState | If playing -> true , else false | true / false |
| currentTitle | Current title actually playing | Information |
| imageURL | URL to the image of the album | Information |
| mainArtURL | URL to current main art | Information |
| mediaId | media ID of the current played media (usually queueID:
| mediaLength | Length of the current title | Information |
| mediaLengthStr | active media length as (HH:)MM:SS | Information |
| mainProgress | active media elapsed time | Information |
| mainProgressPercent | active media elapsed time in percent | Information |
| mediaProgressStr | active media progress as (HH:)MM:SS | Information |
| miniArtUrl | URL to the art (mini) | Information |
| muted | state of 'MUTE' | Information, true / false, volume = 0 is considered as muted |
| playingInGroup | Is the medium played in a group? | Information |
| playingInGroupId | ID of the playing group | Information |
| providerID | ID of the current music provider | Information |
| providerName | Name of the current music provider | Information |
| quality | quality name of the current medium (might be empty) | Information |
| qualityCodec | Codec of the current medium (might be empty) | Information |
| qualityDataRate | data rate (kbps) of the current medium (might be empty) | Information |
| qualitySampleRate | sample rate (Hz) of the current medium (might be empty) | Information |
| queueId | queue ID of the current playlist | Information |
| radioStationId | ID of the TuneIn radio station | Information |
| service | name of the current music service | Information |
| TuneIn-Station | text field to put in a Station name to play this station on this device. Also it is possible to type in the station number (s123456...), a show/podcast id (p1234567...) or a topic id (t123456789...) | Text input |
| volume | Volume of playback. You can enter a value between 0-100% | INPUT Volume |
| State name | meaning | value |
|----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| ringNotificationsEnabled | Shows if the ring notifications are enabled or not and allows to edit it (true/false). The status is updated from cloud with a device configuration interval |
| notificationVolume | The notification volume set for the device. The value is loaded once on adapter start and then not synced with Cloud services, but changeable | number 0..100 |
| ascendingAlarmState | The ascending alarm state set for the device. The value is loaded once on adapter start and then not synced with Cloud services, but changeable | Boolean |
| auxPort-*-Direction | The direction of the AuxPort (when supported). The value is loaded once on adapter start and then not synced with Cloud services, but changeable | "INPUT" or "OUTPUT" |
| connectedSpeaker | The speaker with is used for the Device output. The value is loaded once on adapter start and then not synced with Cloud services, but changeable | "InternalSpeaker", "Bluetooth" or "Aux" (if supported by Device! check the App) |
| defaultAlarmNotificationSound | The default alarm sound set for the device. The value is loaded once on adapter start and then not synced with Cloud services, but changeable | ID from a list |
| defaultTimerNotificationSound | The default timer sound set for the device. The value is loaded once on adapter start and then not synced with Cloud services, but changeable | ID from a list |
| displayAdaptiveBrightnessEnabled | Is the adaptive brightness for the display of the device enabled or not. The value is loaded once on adapter start and then not synced with Cloud services, but changeable | true/false |
| displayEnabled | Is the display of the device enabled or not. The value is loaded once on adapter start and then not synced with Cloud services, but changeable | true/false |
| displayBrightness | Brightness of the display. The value is loaded once on adapter start and then not synced with Cloud services, but changeable | 0..100% |
| equalizerBass | Equalizer Bass setting. Value is updated when changed if push connection is enabled | Number |
| equalizerMidRange | Equalizer Midrange setting. Value is updated when changed if push connection is enabled | Number |
| equalizerTreble | Equalizer Treble setting. Value is updated when changed if push connection is enabled | Number |
| State name | meaning | value |
|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
|
|
|
|
|
P1D = daily
XXXX-WD = on weekdays
XXXX-WE = on weekends
XXXX-WXX-1 = every monday
XXXX-WXX-2 = every tuesday
XXXX-WXX-3 = every wednesday
XXXX-WXX-4 = every thursday
XXXX-WXX-5 = every friday
XXXX-WXX-6 = every saturday
XXXX-WXX-7 = every sunday |
|
|
|
|
| New | Data to create a new Reminder as String in following format separated by ; as "timestamp;label;[sound];[recurring]. timestamp as unix timestamp in ms or text like "HH:MM", label as Text (required), sound as sound ID, recurring either empty for once, "DAILY" for daily or "WEEKLY=MO,TU,WE,TH,FR,SA,SU" with comma separated weekly day list. For full flexibility recurring can also be a JSONified object with all data which is passed through. Fields in example above in brackets mean that they are optional! | String |
| triggered | ID of the Alarm that triggered last on this device | ID |
When changing a Reminder does not work, please make sure that the Reminder timepoint is in the future - so changing e.g. "sound" on a Reminder in the past will _not_ work!
| State name | meaning | value |
|------------------------------------|-----------------|--------|
| Serial or internal name of routine | name of routine | Button |
| State name | meaning | value |
|-----------------|--------------------------------------------------------------------------------------------------------------|------------|
| activeTimerList | JSON array with the list of active timers containing ID, label and trigger timepoint as unix timestamp in ms | JSON array |
| nextTimeDate | Contains the timepoint of the next expected triggering as unix epoch in ms | Number | Number
| nextTimerId | ID of the next timer to trigger | String |
| stopTimerId | Control with a timer ID to stop the timer (also stops if the timer is currently ringing!) | String |
| triggered | A timer got triggered - in fact it is the "nextTimerId" one | true/false |
Please note that it is important that the timezone of the iobroker host is set to match your local timezone, else the triggered time detection might be wrong!
| State name | meaning | value |
|------------|------------------------|--------------|
| online | Is the device online ? | True / False |
| State name | meaning | value |
|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| #trigger | Button to get new History (more current then timestamp in creationTime), only needed when not using the push connection or when the automatic querying is disabled | Button |
| cardContent | Additional information as shown in Alexa-App/Echo Show | Information |
| cardJson | Additional information as shown in Alexa-App/Echo Show in JSON format | Information |
| creationTime | date of this history entry, new history entries are only considered when later as this timestamp | Information |
| domainApplicationId | Additional information like Skill-ID or such, optional | Information |
| domainApplicationName | Additional information like Skill name or such, optional | Information |
| json | Json of last command data to be able to process all infos e.g. in own JavaScripts | JSON |
| name | Name of the device that got the last request | Information |
| serialNumber | Serial number of the device that got the last request | Information |
| status | Status of last command to Alexa | SUCCESS / FAULT / DISCARDED_NON_DEVICE_DIRECTED_INTENT; last one is generated when activating the device by saying the wake word, or when the device discarded input as "not for me" |
| summary | text/summary/action received by the device | Information |
| State name | meaning | value |
|-----------------|------------------------------------------------------