# \[ANNOUNCE\] node-red-contrib-virtual-smart-home for Alexa

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353>\
**Category:** Share Your Nodes\
**Created:** [16 October 2020 15:07 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353 "2020-10-16T15:07:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![lius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lius/32/12679_2.png) [@lius](https://discourse.nodered.org/u/lius)\
**Post date:** [16 October 2020 15:07 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/1 "2020-10-16T15:07:20Z")

</div>

# Virtual Smart Home

I know there are already some Alexa nodes available for Node-RED, but the ones I tried did not proof to be reliable or convenient enough. Hence I went all in and created [virtual smart home](https://flows.nodered.org/node/node-red-contrib-virtual-smart-home), which consists of a Node-RED module and a corresponding [Alexa skill](https://skills-store.amazon.com/deeplink/dp/B08JV9RT7H?deviceType=app&share&refSuffix=ss_copy) that leverages the AWS IoT cloud as a super reliable and scalable backbone.

## What is it for?

Let's say you have built some fancy automations with Node-RED, for instance a plant watering system, a smart plug, a light or even some complex routines. Great, now you can control that from within Node-RED, e.g. using the NR dashboard. But sometimes nothing beats the convenience of simply using your _voice_ to control things. If you own an Amazon Alexa compatible device, _virtual smart home_ is for you!

## Highlights

- supports a growing set of device types
  - Switch
  - Plug
  - Dimmable Light Bulb
  - Color Changing Light Bulb
  - Dimmer Switch
  - Blinds
  - Garage Door Opener

- no separate account needed. Just link your existing Amazon account.
- new virtual devices can simply be dragged onto the Node-RED canvas and will proactively be discovered by Alexa. No need to ask Alexa to discover devices.
- devices that are no longer needed can be removed from Alexa via the Node-RED editor.
- local state changes of devices get synchronized with Alexa
- secure communication with the IoT cloud through individually provisioned certificates

## How does it work?

The node gets invoked through Amazon Alexa (either via a voice command or via the Alexa app) and outputs a `msg` object containing the updated device state as payload. For example, when you say "Alexa, dim the kitchen light to 50 percent", the following `msg` object will be emitted:

```auto
{
  "brightness":50,
  "powerState":"ON",
  "source":"alexa"
}

```

The node also accepts incoming messages that can be used to inform Alexa about local device changes, which will then be reflected in the Alexa app. If the passthrough option is enabled, this will also trigger an outgoing message, just like when the node gets invoked via Alexa. In this case `payload.source` is set to `device` instead of `alexa`.

## Your feedback is appreciated

I've been running _virtual smart home_ in my own home for some time now and it never let me down. But I'm sure it can get even better. Feel free to [make suggestions or report problems](https://github.com/csuermann/node-red-contrib-virtual-smart-home/issues).

Looking forward to your feedback!

Thank you!

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [16 October 2020 15:43 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/2 "2020-10-16T15:43:23Z")

</div>

> [@lius](#):
>
> will proactively be discovered by Alexa. No need to ask Alexa to discover devices.

Hi linking was quick and easy.  
The devices are not auto discovered, Have not asked alexa to discover as yet, giving it some time to auto find.  
edit/ ok working.

Would be nice if the msg contained the name of the switch  
i.e.

```auto
{"payload":{"source":"alexa","powerState":"ON"`,"vDevice":"lounge wall"},"_msgid":"c5c6fa9a.575c18"}

```

P.S. Nice work, seems very quick, will give it a try over the next week.

---

<div class="post-metadata">

**Author:** ![lius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lius/32/12679_2.png) [@lius](https://discourse.nodered.org/u/lius)\
**Post date:** [16 October 2020 17:39 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/3 "2020-10-16T17:39:57Z")

</div>

Thank you for the excellent suggestion! Included in v1.7.0 😀

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [16 October 2020 17:48 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/4 "2020-10-16T17:48:04Z")

</div>

One more suggestion.

option for when receiving an incoming msg, to only accept messge if vDeice property equals virtual device nodes name.

That way we could have one function node feeding all my virtual device nodes, and no need for a switch node, or multiple outputs on a function node.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [17 October 2020 12:46 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/5 "2020-10-17T12:46:54Z")

</div>

Woo - that's a brilliant enhancement... shows "type" as well as "name". Thanks.

![Screen Shot 10-17-20 at 01.45 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/0/50a0787685577a715512f912a8020a15ca5c2be7.jpeg)

---

<div class="post-metadata">

**Author:** ![overdrive69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/overdrive69/32/30927_2.png) [@overdrive69](https://discourse.nodered.org/u/overdrive69)\
**Post date:** [27 October 2020 00:22 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/6 "2020-10-27T00:22:47Z")

</div>

It seems it does not work with german acconts. Is that right?

regards

---

<div class="post-metadata">

**Author:** ![lius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lius/32/12679_2.png) [@lius](https://discourse.nodered.org/u/lius)\
**Post date:** [27 October 2020 06:35 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/7 "2020-10-27T06:35:56Z")

</div>

German accounts should work as well as English, French, Spanish and Italian ones. What kind of issue are you running into?

---

<div class="post-metadata">

**Author:** ![overdrive69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/overdrive69/32/30927_2.png) [@overdrive69](https://discourse.nodered.org/u/overdrive69)\
**Post date:** [27 October 2020 08:26 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/8 "2020-10-27T08:26:34Z")

</div>

Because via the link provided  
.................................................  
The connection must be linked to the same Amazon Alexa account that was / will be used to activate the 'virtual smart home' skill.

Go to [https://amazon.com/de/code](https://amazon.com/de/code) on your smartphone, computer, or tablet and enter this code after loggin in:  
................................  
I need to login with my [amazon.com](http://amazon.com) account but my devices are not in this account.  
I have an [amazon.de](http://amazon.de) account.

---

<div class="post-metadata">

**Author:** ![lius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lius/32/12679_2.png) [@lius](https://discourse.nodered.org/u/lius)\
**Post date:** [27 October 2020 09:54 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/9 "2020-10-27T09:54:13Z")

</div>

Amazon account identities are global, so you should be able to login at [https://www.amazon.com/us/code](https://www.amazon.com/us/code) with your German account credentials. Have you tried it?

---

<div class="post-metadata">

**Author:** ![overdrive69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/overdrive69/32/30927_2.png) [@overdrive69](https://discourse.nodered.org/u/overdrive69)\
**Post date:** [27 October 2020 11:52 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/10 "2020-10-27T11:52:15Z")

</div>

yes and it did not work.  
I have the same email adresse for both accounts but different passwords.  
And when i want to use the password for my [amazon.de](http://amazon.de) account it tells me wrong password.  
And when i login with my password for the [amazon.com](http://amazon.com) account it works, but there are no alexa devices registerd.

---

<div class="post-metadata">

**Author:** ![lius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lius/32/12679_2.png) [@lius](https://discourse.nodered.org/u/lius)\
**Post date:** [27 October 2020 14:14 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/11 "2020-10-27T14:14:44Z")

</div>

Hmm, that's the first time I come across such a problem. I only have one Amazon account and can use it on .de and .com. I found this article, which might (or might not) be helpful: [https://www.zauberware.com/en/articles/2018/amazon-difference-indifference-amazon-com-vs-amazon-de](https://www.zauberware.com/en/articles/2018/amazon-difference-indifference-amazon-com-vs-amazon-de)

---

<div class="post-metadata">

**Author:** ![overdrive69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/overdrive69/32/30927_2.png) [@overdrive69](https://discourse.nodered.org/u/overdrive69)\
**Post date:** [28 October 2020 14:02 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/12 "2020-10-28T14:02:43Z")

</div>

Hi, i created a new Amazon account at [amazon.de](http://amazon.de) and can now login at [amazon.com](http://amazon.com) with the same login data.  
I created one flow in node red with a virtual switch and connected it via the link and the code.  
It seems to be online but the alexas registered at the new account didnt find a new device.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/b/fbb20bf3355a04bfd93748d6e292171bc364cd62.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/7/b7d97533961983fe301a8770ea9381707bf3ed0c.png)

---

<div class="post-metadata">

**Author:** ![lius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lius/32/12679_2.png) [@lius](https://discourse.nodered.org/u/lius)\
**Post date:** [28 October 2020 16:56 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/13 "2020-10-28T16:56:54Z")

</div>

Just to be sure: You activated the "virtual smart home" skill via the Alexa app and completed the account linking process there with the very same Amazon account? Did the account linking go through successfully? What does Alexa respond when you ask her to switch "teestatsestas" on?

P.S. You seem to be running a rather old Node-RED version (1.0.0-beta.2). In order to eliminate as many sources of failure as possible, you might want to upgrade to NR v.1.2.2.

---

<div class="post-metadata">

**Author:** ![overdrive69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/overdrive69/32/30927_2.png) [@overdrive69](https://discourse.nodered.org/u/overdrive69)\
**Post date:** [28 October 2020 17:24 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/14 "2020-10-28T17:24:46Z")

</div>

sorry i missed to activate the skill.  
I dont know why 🙂

I will test and report back.

---

<div class="post-metadata">

**Author:** ![overdrive69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/overdrive69/32/30927_2.png) [@overdrive69](https://discourse.nodered.org/u/overdrive69)\
**Post date:** [28 October 2020 17:32 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/15 "2020-10-28T17:32:30Z")

</div>

I tested and the first impression is very good!!!

1. You need an amzon account where you can login at .de and .com
2. Dont forget to activate the "virtual smart home" skill

Thanks for this.

---

<div class="post-metadata">

**Author:** ![overdrive69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/overdrive69/32/30927_2.png) [@overdrive69](https://discourse.nodered.org/u/overdrive69)\
**Post date:** [28 October 2020 17:54 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/16 "2020-10-28T17:54:18Z")

</div>

So i tested a few funktions.  
About the blind, i the app i can only close and open the blinds.  
But it would also be a very good option to go to percentege.  
see the links

> **[Support for blinds (or shades) in smart home with open/close/stop/move to %...](https://alexa.uservoice.com/forums/913024-alexa-smart-home/suggestions/34277038-support-for-blinds-or-shades-in-smart-home-with)**
>
> Hi Alexa,
> 
> 1. There is not BLIND or SHADES as Display Category availabe https://developer.amazon.com/docs/device-apis/alexa-discovery.html#display-categories, so please can you add support for this ?
> 
> 2. Blinds (or shades) can be opened, closed,...

> **[Alexa.Discovery Interface | Alexa Skills Kit](https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-discovery.html#display-categories)**

> **[Alexa.RangeController Interface | Alexa Skills Kit](https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-rangecontroller.html#discover-blinds)**

---

<div class="post-metadata">

**Author:** ![lius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lius/32/12679_2.png) [@lius](https://discourse.nodered.org/u/lius)\
**Post date:** [29 October 2020 06:55 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/17 "2020-10-29T06:55:25Z")

</div>

I will look into supporting %-based commands for blinds. As a workaround, you could also (mis)use a "dimmable light" instead.

---

<div class="post-metadata">

**Author:** ![overdrive69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/overdrive69/32/30927_2.png) [@overdrive69](https://discourse.nodered.org/u/overdrive69)\
**Post date:** [29 October 2020 08:30 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/18 "2020-10-29T08:30:54Z")

</div>

Thx.  
I know i can use a dimmable light but then its not handled 100% right in alexa when you say all lights off or something like this.

I also tested the "Garage door opener" but this i cant control via alexa

 ![WhatsApp Image 2020-10-29 at 09.20.12](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/64da756c543249588e9618429f02ad107366d658.jpeg)

---

<div class="post-metadata">

**Author:** ![andreanilorenzo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andreanilorenzo/32/32325_2.png) [@andreanilorenzo](https://discourse.nodered.org/u/andreanilorenzo)\
**Post date:** [20 November 2020 20:55 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/19 "2020-11-20T20:55:38Z")

</div>

# RGB Lamp OFF remain OFF asking color.

Using an RGB lamp bulb, if the lamp is off and I ask Alexa "set lamp to Red" the powerState value transmitted by the node remains OFF, so the lamp does not turn on

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [20 November 2020 22:48 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353/20 "2020-11-20T22:48:52Z")

</div>

Hi and welcome to the forum

This is a general feature that all/nearly all lamp nodes employ.

The on/off is one function

Colour is another function

Brightness is another function

So, it is up to us programmers to tell the lamp to switch on and then change color

[Next page](https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353.md?page=2)
