Home Home Automation The answer to almost all Echo needs: Alexa-remote2

The answer to almost all Echo needs: Alexa-remote2

So far, there is only one function missing!

At first, I wanted to bash on node-red-contrib-alexa-remote2. A promising set of nodes opening Amazon Alexa system didn’t work as expected at all. It even managed to wipe my groups as well… so the anger and disappointment took over and I left the project alone. A couple of weeks later, I noticed the pending updates, and decided to give it another go again! Guess what? This time around Alexa-remote2 sounds promising.

Alexa-remote2

It’s not the first time I’m trying things with Alexa. My washing machine uses NotifyMe to let me know when the washing is done and my Raspberry Pi drops me a message when the internet is below advertised speeds (pretty much all the time). But apart from the excellent Alexa integration for smart devices, there was nothing else I could do with it. Alexa-remote2 changes that. And it does it on another level!

This short showcase was done in about 20 minutes. Yes, you are watching an IKEA Symfonisk remote (Zigbee) controlling 2 Amazon Echo gen3 devices. It’s only a fraction of things you can achieve with Alexa-remote2. I will definitely write more about this setup soon, so it’s a great idea to follow my social pages if you are interested.

Impressive skillset without the “skill” part

Most of us are tired of adding new skills to Alexa each time we want to get something done. Alexa-remote2 works over your local network (after authentication) to

I would strongly recommend playing with the individual nodes as each one comes with a set of actions that you can perform and I’m only going over them in a brief.

Getting Started with Alexa-remote2

To start, download node-red-contrib-alexa-remote2 and use the configuration node to set it up on your NodeRED server. Choose a Service Host and Page and Language depending on your location. For example:

Service Host Page Language
USA pitangui.amazon.com amazon.com en-US
UK alexa.amazon.co.uk amazon.co.uk en-UK
GER layla.amazon.de amazon.de en-UK


Set This IP to the IP of your Node-RED server. You will have to visit this IP followed by the port number specified in the configuration ie: for IP http://192.168.1.10:1880 go to:

 http://192.168.1.10:3456

And log in to your Amazon account.

Initialise Node

Before you can play with anything, you have to initialise the Alexa-remote2. To do so, deploy an Initialisation Node – Initialisation, then open the browser at the IP specified in the error message. You will be asked to sign in to your Amazon account to authorise the Alexa-remote2.

If you enabled preserving variables in NodeRED, you can use this flow to save the authenticated payload, load it up on reboot, and refresh the authentication every 2 days.

Initialisation Flow
[{"id":"b6c11feb.c1f0a","type":"group","z":"44f83b37.b3f044","name":"Authenticate & re-authenticate","style":{"stroke":"#ff0000","fill":"#ffbfbf","label":true,"label-position":"n","color":"#ffffff"},"nodes":["f3ff139b.01dd3","ba61ab31.e4d208","74cd0c7b.325354","2a1fc81f.b96e28","443b92d6.132dfc","6313cbe4.e7fc64","6c43f2b4.15104c"],"x":65,"y":70,"w":570,"h":200},{"id":"f3ff139b.01dd3","type":"alexa-remote-init","z":"44f83b37.b3f044","g":"b6c11feb.c1f0a","name":"","account":"9d26c7ce.162eb8","option":"initialise","x":360,"y":160,"wires":[["74cd0c7b.325354"]]},{"id":"ba61ab31.e4d208","type":"inject","z":"44f83b37.b3f044","g":"b6c11feb.c1f0a","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"00 12 * * 3,4,0","once":false,"onceDelay":0.1,"payload":"alexa","payloadType":"flow","x":190,"y":160,"wires":[["f3ff139b.01dd3"]]},{"id":"74cd0c7b.325354","type":"change","z":"44f83b37.b3f044","g":"b6c11feb.c1f0a","name":"set","rules":[{"t":"set","p":"alexa","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":160,"wires":[[]]},{"id":"2a1fc81f.b96e28","type":"comment","z":"44f83b37.b3f044","g":"b6c11feb.c1f0a","name":"Alexa Init","info":"","x":160,"y":120,"wires":[]},{"id":"443b92d6.132dfc","type":"inject","z":"44f83b37.b3f044","g":"b6c11feb.c1f0a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"Started!","payloadType":"str","x":180,"y":220,"wires":[["6313cbe4.e7fc64"]]},{"id":"6313cbe4.e7fc64","type":"change","z":"44f83b37.b3f044","g":"b6c11feb.c1f0a","name":"set","rules":[{"t":"set","p":"payload","pt":"msg","to":"alexa","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":220,"wires":[["6c43f2b4.15104c"]]},{"id":"6c43f2b4.15104c","type":"alexa-remote-init","z":"44f83b37.b3f044","g":"b6c11feb.c1f0a","name":"","account":"9d26c7ce.162eb8","option":"initialise","x":540,"y":220,"wires":[[]]},{"id":"9d26c7ce.162eb8","type":"alexa-remote-account","z":"","name":"","authMethod":"proxy","proxyOwnIp":"192.168.1.107","proxyPort":"3456","cookieFile":"","refreshInterval":"3","alexaServiceHost":"alexa.amazon.co.uk","amazonPage":"amazon.co.uk","acceptLanguage":"en-UK","userAgent":"","useWsMqtt":"on","autoInit":"off"}]

The Initialisation Node also comes with separate options to control cookies, cashed state, interval and resetting the authentication. If you use the above flow, you shouldn’t really care much for other values unless you know what you are doing.

Device Activity Node

This is an input node that is able to report changes in your Amazon Alexa services. Each category will send a JSON formatted, detailed messages about what just happened on your Amazon Echo. These values can be used to control other flows on your device. Among the activities you will find:

  • Error
  • Unknown command
  • Connect/Disconnect
  • Bluetooth State
  • Audio & Media changes
  • Volume changes
  • Notification changes
  • Device Activity
  • EQ changes

There is no universal channel for all messages, so you have to be very specific what notification group subscribe to. It’s proven useful to update the music track changes, confirming actions set by other nodes as well like Bluetooth operations and notification updates.

SmartHome Node

This node can send commands and query your Alexa enabled devices. While it’s much easier to use the configuration, you can submit the data in msg.payload.

  • Get
  • Query
  • Action
  • Discover
  • Forget
Get

You can query Alexa services to obtain information about devices and groups registered on your account. The level of information available will depend on the list that you want to receive: devices, groups, entities, & definitions.

Apart from the device information, you will see all actions that are available in your ecosystem. These are populated based on device types registered. Please note, that you will access active and past devices.

Query

Select a device of your choice to receive updates about its state. You can receive a specific state or ask for all properties for each device. Obviously the information will be specific to the device type. You can query more than one device with a single call.

Action

Select a connected device and trigger property change. The available options will depend on what traits the device supports. You can send actions to more than one device at the same time.

Discover

Run Alexa discovery service. Alexa will try to find new devices available on the network.

Forget

If a device is no longer connected, you can remove it from the list of your devices. You could create a self clean-up task where devices that were not seen online for days are removed from Alexa.

Routine Node

Control prompts and notifications, set the volume and launch actions and routines on any Alexa devices or groups in your home.

  • Speak/at Volume
  • Wait
  • Stop
  • Prompt/Phrase
  • Volume
  • Music
  • Smarthome
  • Launch Skill
  • Execute Routine
  • Push Notification
  • Node
  • Custom
Speak/Speak at Volume

The speech comes in 3 flavours: regular, SSML and Announcement. The regular option causes Alexa to speak without any prompt. The announcement plays the chime first, and SSML enables you to use a speech synthesis mark up language. It gives you more control over how things are being pronounced:

<speak>
    Here is a number <w role="amazon:VBD">read</w> 
    as a cardinal number: 
    <say-as interpret-as="cardinal">12345</say-as>. 
    Here is a word spelled out: 
    <say-as interpret-as="spell-out">hello</say-as>. 
</speak>

If you use the Speak at Volume, you will be able to set the speech volume just for that phrase, the volume will return to the previous value once Alexa is done speaking.

Wait/Stop

With wait action, you can cause Alexa to suspend whatever she is currently doing for X seconds. Alexa will return to the previous task once the wait time is over. If you want to stop her from completing the task, use stop action instead.

Prompt/Phrases

A list of predefined queries that can provide you with morning news briefs, traffic updates or unique answers from Alexa like jokes and stories. In a similar manner, phrases are predefined but randomised things that Alexa can say in the morning or as a greeting.

Volume

Changing volume can be done in 2 ways. You can set a new value, or you can add/subtract a number from the current value. If you want to lower the volume of Alexa simply type in a negative number (-10) in msg.payload.

Music

You can start music playback from the list of your music providers. You can pick between your library, iTunes, Spotify and Amazon Music. If you have any 3rd party music services, these can be listed there too.

Provide a song name, artist or name of the playlist to start the playback. Optionally, you can pass the duration in seconds if you want to terminate the playback after some time.

Smarthome

With this action, you can control your smart devices like with SmartHome Node, with one exception: one device at the time.

Launch Skill

You can also launch your favourite skill directly from NodeRED! Select the device, and the skill you want to launch to make things happen.

Execute Routine

Start one of your saved routines. Unfortunately, some of the routines are hard to identify (time-based) due to lack of clear information. This may take some experimenting before you are able to pick the one you need.

Push Notification

Send a phone notification to the device with Alexa installed. You can specify the title and the text of the notification. Sadly, there are no other options available. Wish there was a direct way of sending a notification to specified Echo devices. I guess for that, I will use NotifyMe instead.

Node

You can mix and match the above actions to create a unique string of events. Let’s say you want to start a routine, play some music and control a smart device at once – Node option lets you chain these together.

Custom

With the Custom option, you can feed in a routine node as JS object for completely dynamic routines.

Echo Node

An array of mostly audio related controls including music playback, Bluetooth and Alexa devices.

  • Get
  • Music command
  • Bluetooth
  • Rename/Delete
  • TuneIn
  • Do not disturb/Alarm
Get

You can query media information, playback or volume preferences including DND and alarm. There is an option to check pending notifications too. If you are looking for a status update, chances are this is the action you want to use.

Music commands

These options can get really messy, especially if you run multiple Alexa devices in a group or a single room. Alexa likes to default the playback to a group or a specific device. If you attempt the control (play/pause, skip/back) without correct device specified, your action will fail.

In my experience, the actions are most reliable with groups.

Bluetooth

It’s possible to pair/connect and disconnect from paired speakers. With some clever planning, you could stream Alexa on your favourite Bluetooth speaker.

Rename/Delete

From time to time, there might be a need to re-assign a name or delete the Amazon Echo device altogether. These options do just that.

TuneIn

Use TuneIn service and query the stations to start the playback

DND and Alarm Volume

Additional controls for Do NotDisturb and Alarm Volumes so you get the sound settings just right.

Get Other Node

Yet another set of actions to get additional information about accounts, contacts, notifications, skills and more. If you want to create a notification or a timer, you will find the actions to configure it.

List Node

With Alexa-remote2 you can create, edit and delete lists. You can do this to default lists like: “to-do” and “shopping” and you can create your own lists. These will be available across all Alexa devices.

The node provides you with a complete toolset to get the lists, elements and options to add, edit and remove items from the list.

Buy Alexa Show 8″

Buy it using these links to support NotEnoughTech.

Conclusion

Alexa-remote2 us updated on a regular basis. So if you find something that isn’t working just yet, chances are that it will be fixed soon. I’m glad I can make Alexa speak at will. Thanks to this node I can get Alexa to speak at will and trigger exciting automation without relying on 3rd party servers. What would you like to do with Alexa-remote2? Let me know in this Reddit thread.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated in style with crypto-currency

Smart Ideas with

Automate your space in with these ecosystems and integrate it with other automation services

Learn NodeRED

NodeRED for beginners: 1. Why do you need a NodeRED server?

0
To server or not to server? That's a very silly question!

Best Automation Projects

ESP8266 WIFI lights under $5

0
Your Sonoff device can't do this!

Free wireless doorbell (Amazon Dash button hack)

0
The most terrifying situation I can imagine* is missing a parcel

New Amazon Dash Buttons

0
You can teach new buttons old tricks!

ESP8266 ceiling light – demo

0
Testing the ESP8266 as a WIFI light controller

Try Tasker and Raspberry Pi for your home automation needs!

0
Raspberry Pi can help you with your Tasker profiles

Smart Home

IFTTT Pro Alternative: Alexa ed.

0
Bypass IFTTT Pro restrictions for Alexa voice actions with this IFTTT Pro Alternative

The answer to almost all Echo needs: Alexa-remote2

0
Alexaremote2 is a Swiss army knife for Amazon Echo devices. Connect, control and listen to all Alexa enabled gadget at home.

This ESP32 is on FIRE! – M5Stack Core

0
This ESP kit is on fire! M5Stack Core merges IoT platform and learning in a very polished stackable module.

From KettleBot to ANY-Bot – SwitchBot

0
Switching anything on and of with SwitchBot -an insanely cute robot that does all the finger pressing for you

NodeRED – multiple payloads

0
Mastering multiple payloads in the function node in NodeRED