ioBroker Alexa integration

The ioBroker Alexa2 adapter lets ioBroker control selected Alexa features. For example, you can use Alexa’s voice to speak messages and announcements through Amazon smart speakers such as the Echo and Echo Dot. You can also work with alarms, timers, reminders, and other functions exposed by the adapter.

Created: June 2023

Reviewed: November 2026

Prerequisite: An installed ioBroker server.

Before installing the Alexa2 adapter

For reliable operation, use a working ioBroker server with a supported Node.js LTS version and an up-to-date js-controller. You also need an Amazon account with your Echo speakers or other Alexa-compatible devices registered to it.

Installing the Alexa2 adapter

Open the “Adapters” page in ioBroker and search for Alexa. Install an instance of the Alexa2 adapter.

Installing an instance of the ioBroker Alexa2 adapter
Install an instance of the Alexa2 adapter from the ioBroker Adapters page.

After installation, the adapter settings page opens. The adapter connects to your Amazon account using an Amazon cookie rather than an API key. To establish the connection, you need to sign in through the local login proxy provided by the adapter.

The Alexa2 settings display a temporary local login link. Open the link shown in your own adapter settings; its address and port may differ from the example in the screenshot.

Use this link to sign in to your Amazon account and allow the adapter to obtain the cookie.

The local Amazon login link in the Alexa2 adapter settings
Open the login link displayed in the Alexa2 adapter settings.

On the page that opens, sign in with the Amazon account associated with your Alexa devices. After a successful login, you can close the browser tab.

Amazon sign-in page opened through the Alexa2 adapter's local login link
Sign in with the Amazon account used by your Alexa devices.

After the login, check the Alexa2 adapter settings to confirm that the connection details have been obtained.

Alexa2 adapter settings after signing in to the Amazon account
The Alexa2 adapter settings after a successful Amazon login.

Click the button to save and close the settings. The Alexa2 adapter setup is now complete.

Alexa2 data points

After installation, the Alexa2 adapter creates its data points on the “Objects” page.

Alexa2 adapter data points on the ioBroker Objects page
The Alexa2 adapter’s data points on the Objects page.

Let’s look at the main groups of Alexa2 data points. The following table summarizes the first level of the object tree.

ContactsAlexa contacts to whom you can send text messages.
Echo-DevicesAmazon Echo devices associated with the account.
HistoryInformation about recent commands and events, depending on the adapter settings and available Amazon data.
Smart-Home-DevicesSmart home devices known to Alexa.
infoGeneral information about the adapter’s status and connection.
requestResultError information for TuneIn and smart home device requests.

Using Alexa2

Let’s test the Alexa2 adapter. Open the “Scripts” panel and add a new JavaScript script. If you have not installed it yet, install an instance of the JavaScript adapter first.

Adding a new JavaScript script on the ioBroker Scripts page
Create a new JavaScript script on the Scripts page.

Paste the following code into the empty script:

var alexa = 'alexa2.0.Echo-Devices.xxxxxxxxx.Commands.speak'/*speak*/;
var text = 'test message';
setState(alexa, text);

Replace the value of the “alexa” variable with the “Commands.speak” data point of one of your devices under “Echo-Devices”. The “setState()” function writes the contents of the “text” variable to that data point. The series of x characters in the example stands for your device’s identifier.

The speak data point of an Echo device in the ioBroker Alexa2 adapter
Select the speak data point of the Echo device you want to use.

Save the script and press the small triangle button to run it. Then listen to your Echo speaker.

A JavaScript test script for the Alexa2 adapter in ioBroker
The Alexa2 test script in the ioBroker JavaScript editor.

Here are a few more useful data points. The available data points may vary by device and adapter configuration.

Under “alexa2.0.Contacts”, the adapter lists available Alexa contacts. If you write text to a contact’s “textMessage” value, the message can appear on that user’s Alexa devices with a yellow notification ring.

Your own contact has a special “(Self)” label in the list. Under this contact, the “#clearOwnMessages” data point can be triggered to clear your own messages. This data point is available only for your own contact.

In an Echo device’s “Commands” folder, the “announcement” data point can make Alexa speak an announcement. It is similar to “speak”, but Alexa plays a notification sound before speaking. Announcements must be enabled for the device, and the device must not be in Do Not Disturb mode.

var alexa = 'alexa2.0.Echo-Devices.xxxx.Commands.announcement'/*announcement*/;
var text = 'test message';
setState(alexa, text);

The “calendarNext” data point accepts a Boolean trigger. When activated, it asks Alexa to read the next event in the connected calendar.

var alexa = 'alexa2.0.Echo-Devices.xxxx.Commands.calendarNext'/*calendarNext*/;
var trigger = true;
setState(alexa, trigger);

The “calendarToday” and “calendarTomorrow” commands can be used in the same way to request today’s or tomorrow’s calendar events.

The “doNotDisturb” data point controls Do Not Disturb mode. You can switch it on or off with a Boolean value.

The “flashbriefing” command starts Alexa’s configured news briefing. You can choose the news sources in the Alexa app.

We have already used “speak” above. The “speak-volume” data point sets the volume used for speech commands. Its documented range is 0–100.

var alexa_speak = 'alexa2.0.Echo-Devices.xxxx.Commands.speak'/*speak*/;
var alexa_volume = 'alexa2.0.Echo-Devices.xxxx.Commands.speak-volume'/*Volume to use for speak commands*/;
var num = 80;
var text = 'test';
setState(alexa_volume, num);
setState(alexa_speak, text);

With “textCommand”, you can send Alexa a command as text. Use words instead of digits in the command text where possible. Write the command in the language configured for your Alexa device.

var alexa = 'alexa2.0.Echo-Devices.xxxx.Commands.textCommand'/*textCommand*/;
var command = 'Turn on the living room light';
setState(alexa, command);

The “traffic” command requests local traffic information, while “weather” requests a weather report. Both can be triggered by writing true to their data points.

The “Routines” folder contains routines created in the Amazon Alexa app. You can trigger an available routine by setting its data point to true.

You can also create buttons for Alexa commands with the VIS-2 adapter.


← More ioBroker tutorials