Coder Social home page Coder Social logo

node-red-contrib-virtual-smart-home's Introduction

Virtual Smart Home (VSH)

A Node-RED node that represents a virtual smart home device which can be controlled via Amazon Alexa. Requires the 'virtual smart home' skill to be enabled for your Amazon account.

Examples

Highlights

  • supports a growing set of device types
    • Blinds
    • Color Changing Light Bulb
    • Contact Sensor
    • Dimmable Light Bulb
    • Dimmer Switch
    • Doorbell Event Source
    • Entertainment Device
    • Fan
    • Garage Door Opener (en-US locale only)
    • Lock
    • Motion Sensor
    • Plug
    • Scene
    • Switch
    • Temperature Sensor
    • Thermostat (Single-setpoint)
    • Thermostat (Dual-setpoint)
  • 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 removed from the Node-RED canvas will also be removed from Alexa. Orphaned devices can also be manually removed from Alexa via the Node-RED editor.
  • changes made to virtual device types and names will immediately be picked up by Alexa.
  • local state changes of devices (e.g. thermostat values) get synchronized with Alexa
  • secure communication with the IoT cloud through individually provisioned certificates

What it does

This node is triggered by Amazon Alexa, either through a voice command or the Alexa app, resulting in the generation of a msg object that carries the updated device state as its payload. This msg can be harnessed to perform practical actions, such as controlling physical devices connected to Home Assistant. For instance, if you say, "Alexa, dim the kitchen light to 50 percent," the emitted msg object would be as follows:

{
  "topic": "home/kitchen/lights",
  "metadata": { "foo": "bar"},
  "payload": {
    "brightness": 50,
    "powerState": "ON",
    "source": "alexa",
    "directive": "SetBrightness",
    "name": "kitchen light",
    "type": "DIMMABLE_LIGHT_BULB"
  }
}

The node also accepts inbound 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 outbound message, just like when the node gets invoked via Alexa. In this case payload.source is set to device instead of alexa. If the inbound message has a topic attribute, its value will be present in the outbound msg instead of the topic configured in the editor.

Please ensure that your setup does not send too many messages to Alexa. Otherwise you risk getting your account blocked.

Availability

The virtual smart home skill is available in the Amazon skill stores in the following locales:

Setup Instructions

In the Alexa app

  1. Search the skill store for the virtual smart home skill and enable it.
  2. Complete the account linking process by logging in with your Amazon account credentials.

In Node-RED

  1. Install the node-red-contrib-virtual-smart-home module.
  2. Place a virtual device node onto the canvas and connect it to a debug node.
  3. Double-click on the virtual device node to enter a name and select a device type. Once set up, you can use this name to control the device via Alexa.
  4. Configure a new vsh-connection by clicking the pen icon. (Only needed once for each Amazon account).
  5. Follow the instructions to complete the account linking process. Make sure you use the same Amazon account credentials as above.
  6. Deploy your Node-RED flow. This will trigger your virtual device to be discovered by Alexa. You should even get a push notification via the Alexa app (if notifications are enabled).
  7. You should now be able to control your virtual device with your voice, e.g., by saying "Alexa, turn xxx on". Inspect the output of the connected debug node and consult the docs to do something useful.
  8. Once you remove virtual devices from the canvas (and redeploy your flows), those devices will also be removed from Alexa.

Docs

Detailed docs are shipped as part of the Node-RED package and available through the 'help' panel.

Examples

Example flows that illustrate the payload structure and voice invocation phrases can be imported from the Node-RED import menu (Import > Examples > node-red-contrib-virtual-smart-home). They can also be found in the examples folder.

Share the Love

I dedicated endless hours to this project and really hope it adds value for you! Nothing is more rewarding to me than your feedback. So if you are a happy user, please

  • rate the 'virtual smart home' skill on the Alexa skill store
  • rate the 'virtual smart home' Node-RED package
  • mention this package in your next blog post / podcast / YouTube

THANK YOU!

Changelog

New versions of VSH are frequently released and it is generally recommended to always run the latest version. The Changelog is published in the Releases section on GitHub.

FAQ

  1. Q: Which voice commands can I use to control my devices with Alexa?

    A: Take a look at the example flows which you can import from the Node-RED import menu (Import > Examples > node-red-contrib-virtual-smart-home).

    Here are some of the most often used commands:

    • Alexa, switch on / off DEVICE-NAME
    • Alexa, set DEVICE-NAME to X percent
    • Alexa, set DEVICE-NAME to Warm white / Soft white / Daylight white / Cool white / Red / Crimson / Salmon / Orange / Gold / Yellow / Green / Turquoise / Cyan / Sky blue / Blue / Purple / Magenta / Pink / Lavender
    • Alexa, open / close DEVICE-NAME
  2. Q: How can I control devices in a specific room?

    A: You can create rooms in the Alexa app and assign your devices to them. Create a room which groups together an Alexa device (e.g. Echo) and some virtual lights. You can then control all those lights simply by speaking "Alexa, switch off the light" into the Alexa device.

  3. Q: Why do my devices suddenly fail to connect and show up as 'offline'?

    A: If your device was not connected to the VSH backend for more than 30 days its certificate will be revoked. You can fix that by deleting the old connection, creating a new one and linking your virtual devices to the new one. All your devices should then get re-discovered by Alexa.

    Another reason could be that you are using an outdated version of VSH. Please update to the latest version (e.g using the Node-RED palette manager).

  4. Q: Why do some of my devices show up as duplicates in the Alexa app?

    A: Your duplicate devices might belong to a vsh-connection that no longer exists. You can delete them manually on the connection page where they probably show up with a shaded background, indicating they belong to another vsh-connection.

  5. Q: I deleted a virtual device but Alexa keeps rediscovering it!

    A: You probably deleted the device in the Alexa app instead of Node-RED. Open the connection page which lists all known devices and click the trash icon next to the device you want to delete.

  6. Q: Why does VSH not work offline?

    A: Alexa lives in the cloud. When you ask Alexa to control one of your devices, your voice is sent to Amazon servers for processing. Amazon's servers then try to make sense of what you said and which skill to invoke. If you said "Alexa, dim the kitchen light to fifty percent!", Alexa will realize that 'kitchen light' belongs to the VSH skill and invoke the VSH backend with a 'directive' containing the command that was understood (e.g. 'SetBrightness'). The VSH skill backend then sends a message to your connected virtual device which triggers an outgoing msg object with the device state for you to make use of. This requires your VSH devices to be online.

  7. Q: What do you do with my data?

    A: The VSH backend only stores metadata about your configured devices needed for VSH to function and your basic profile information provided by Amazon when you enabled the skill. Neither your Amazon password nor your voice prompts or your location is ever shared with VSH. I also have no interest in analyzing your usage patterns although this would technically be possible.

  8. Q: Where can I see what data is being sent to / received from the backend?

    A: Activate the Debug option on the connection page and observe the output logged to stdout.

  9. Q: Can I run my own backend?

    A: Yes! Check out the backend repository and follow the instructions precisely. Keep in mind that it might be cheaper and much easier to keep using the official backend.

  10. Q: Is there a way to persist the state of devices across restarts of Node-RED?

    A: Yes! The device state is stored as 'context' provided by Node-RED, which is kept in memory by default. You can easily change that by adding this snippet to your Node-RED's settings.js file:

    contextStorage: {
      default: {
        module: "localfilesystem",
      },
    },
  11. Q: In which way is the FREE plan limited?

    A: While you can use the FREE plan free of charge for as long as you want, it is currently limited to 7 virtual devices and doesn't support retrieving device state by Alexa, e.g. commands like "Alexa, what's the temperature in the living room" will fail.

  12. Q: Why did a paid PRO plan get introduced?

    A: With growing popularity of VSH the infrastructure costs also grew significantly. I had to make a decision to either shut VSH down or to introduce a paid plan. For 12 EUR per year, you can deploy up to 200 virtual devices and support further development of VSH. You can upgrade to the "Pro" plan from the Connection dialog within Node-RED.

  13. Q: Where can I manage my VSH subscription?

    A: Click the 'manage subscription' button on the vsh-connection page in Node-RED or manually log into the Stripe dashboard. This will only work when you already have purchased a subscription.

  14. Q: Can you add feature X, please?

    A: I'm always eager to hear your ideas! Please file a ticket.

  15. Q: Where can I ask a question that hasn't been addressed yet?

    A: Check out existing issues on GitHub or file a new ticket.

Terms of Use

This package comes without any warranty. Use it, enjoy it, but all at your own risk. If you are satisfied with this project, consider upgrading to the PRO plan or buying me a coffee. Thank you!

NOTE

The permitted use of the VSH package is limited to human-triggered interactions with Alexa and infrequent synchronizations of device states (e.g. for sensor data, such as thermostat). Any setup that leads to excessive data traffic between the VSH client and its backend is strictly forbidden and will lead to permanent blocking of the user's account.

Devices that have not been online for 30 days will be permanently deleted without prior warning. Their certificates will be invalidated and can no longer be used to connect virtual devices.

Accounts without any activity for 60 days will also be deleted and can no longer be used to control virtual devices.

node-red-contrib-virtual-smart-home's People

Contributors

csuermann avatar enforcebeautifulcode avatar thohoj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-red-contrib-virtual-smart-home's Issues

Huge Feature Request: New Dropdown Menu in your node to prepare Output for different Backends

Hey again,

after my thoughts about your node I came a long with a huge idea that could be realy helpfull for beginners or even makes things a lot easier to setup.

What if you implement a new Menu item in your node with a dropdown where the user could select the backend.
F.e. deconz/phoscon or zigbee2mqtt (that are both tools I'm used to, and there a many more).

If the user set nothing up, everything will be like it is right now. If the user setup zigbee2mqtt as the backend, the output will be somewhat "simplified" that your node should only be connected to the endpoint in node-red rather than having to manipulate the output with function nodes that much.

If that is possible and you like to do it, I can help you with 2 backends above. Other guys that want other backends can help here as well.

No VSH Config

Node red:
ERROR
provisioning failed

on amazon side:
Erfolg!
Ihr Registrierung ist hiermit abgeschlossen.

[Feature Request] Arbitrary state device

Unsure if this is even possible, but a device sort of like the "color change bulb" only I can either just say "Alexa, set MyThing to ArbitraryWord" or that I can preset various states for. My use case is to be able to control TV inputs. I can currently set them from node-red, the problem is that I now have to expose a switch for every input option and then give a clunky command like "Alexa, turn on DownstairsTV_input3" instead of just "Alexa, set DownstairsTV to Input3". Bonus if it can use Alexa's area functionality so I can name them all TV and it'll determine based on room like it does for "turn on the lights" Even better if it can be done as a switch so that it doesn't try to turn on the TV when I turn on the lights (although easily enough worked around by having a separate virtual switch for turning on and ignoring the power signal from the multistate)

Security

First of all, I like the skill a lot. It works much better than the local skill I used before.
Could you please point out what security concept runs behind the scenes and what risk I take using your skill.
I ask this, because I want to know alittle bit more before I advice others on e.g. (loxforum.com) to try your skill.
Thanks in advance.

Feature Request: Filter Output by [directive]

Good morning @csuermann,

was struggling with a command to only set the brightness for a bulb/light.
If the directive is set to SetBrightness your node will send all color objects what is not neccesary.

That leads to always turn my bulbs to red if I only wanted to change the brightness.
Same could be done for SetColorTemperature, TurnOn, TurnOff. Brightness should be included because some bulbs need a brightness setting.... or sometimes without brightness the transition wouldn't be applied.

{"powerState":"ON","brightness":100,"colorTemperatureInKelvin":7000,"lightMode":"temp","color":{"hue":0,"saturation":1,"brightness":1},"source":"alexa","directive":"SetBrightness","name":"Licht im Schlafzimmer","type":"COLOR_CHANGING_LIGHT_BULB","color_rgb":[255,0,0],"color_hex":"#FF0000","color_cmyk":[0,100,100,0],"color_lab":[53,80,67],"color_xyz":[41,21,2]}

image

Sure no problem to fix this by user with a node function, but I guess it isn't neccessary to respond an object that isn't wanted/needed at this point or?

Duplicate Devices Conflict Question

So I have a virtual smart home device for my kitchen cabinet lights. Every couple of days it stops working. When I go to alexa.amazon.com and look at my smart home devices "Cabinet Lights" shows up three times. When I click on the devices, two of them show as unavailable and the third is the correct device. If I hit remove for the two unavailable devices, everything goes back to working. After a day or two, the two unavailable devices show back up. I have tried removing all three from the alexa.amazon.com, followed by removing the node from my nodered flow and then deploying it, followed by re-adding the node to the flow...but again in three days they show back up.

Are these devices cached somewhere? Anyway to purge them?
Any suggestions would be greatly appreciated.

Also - thank you very much for implementing my suggestion for the Topic field! It has simplified my flows.

Dan

Abnormal network activity

Hi,

do you have any data on network activity of your module? I have deployed around 20 virtual devices, and my Raspberry has become extremely slow on network operations.
Could it be that I have deployed too many devices?

Open Source VSH Backend

Hi @csuermann,

I was wondering if you could open source the backend code?

From my point of view, there would be critical advantages:

  • Community can better understand what happens with their sensible smart home devices under external control
  • Community coders can properly contribute to VSH
  • Users can self-host their VSH instance by creating their own AWS resources

Thermostat type not updating with "targetTemperature" value

Using the example for the Thermostat provided, I am finding that when I inject the node with a msg.payload.targetTemperature of 22.5 it just overwrites the temperature value in the case of 20 with the value 22.5 and the target temperature value remains at 0.

Starting values coming out of the node:
{"temperature":22,"scale":"CELSIUS","targetTemperature":0,"targetScale":"CELSIUS","source":"device","directive":"OverrideLocalState","name":"Thermostat Lake","type":"THERMOSTAT"}

Injected results from "target temp = 22.5 °C" inject node:
{"targetTemperature":22.5,"targetScale":"CELSIUS"}

Resulting value from node:
{"temperature":22.5,"scale":"CELSIUS","targetTemperature":0,"targetScale":"CELSIUS","source":"device","directive":"OverrideLocalState","name":"Thermostat Lake","type":"THERMOSTAT"}

Further, if I set the targetTemperature to 25 through Alexa and the temperature back to 22:
{"temperature":22,"scale":"CELSIUS","targetTemperature":25,"targetScale":"CELSIUS","source":"device","directive":"OverrideLocalState","name":"Thermostat Lake","type":"THERMOSTAT"}

Then upon injecting the results from "target temp = 22.5 °C" inject node:
{"targetTemperature":22.5,"targetScale":"CELSIUS"}

Resulting value from node has an incorrect temperature now 22.5 rather than 20, and targetTemperature remains at 25 whereas it should be 22.5
{"temperature":22.5,"scale":"CELSIUS","targetTemperature":25,"targetScale":"CELSIUS","source":"device","directive":"OverrideLocalState","name":"Thermostat Lake","type":"THERMOSTAT"}

[FEATURE REQUEST] ContactSensor

Hi @csuermann,

I'am still loving your solution and setting up more and more devices :-)

What I want to do now is, to use my contact sensors at the windows to trigger routines in the alexa app. As far as I've seen it is not possible to use switches or plugs for that. In the documentation I've found, that there are ContactSensors under the SmartHome Securtiy Skills

Would it be possible to integrate them into vsh?

Kind regards
Maui2k

quota exhausted

I have a flow with a virtual switch connected to a debug node, nothing else. After a short period of running it goes offline and says connection quota exhausted... what am I doing wrong?
Screen Shot 2021-02-15 at 16 32 30

Idea: Input-payload, trigger if name matches

For input payload.name is not evaluated. If you want to control multiple virtual devices, e.g. via MQTT, it would be helpful if the name was optionally evaluated and the device only triggers if the name matches. (possibly regex?)
If no name is specified in the input-payload, the device switches as before.
What do you think?
Achim

Feature Request: Thermostat Temperature

  1. Thermostat Temperature Increment 0.5:
    Currently when asking “Alexa, make it warmer in here” or “Alexa, make it cooler in here”, the response is to increase|decrease the targetTemperature by 1 degree. I have found that all of my smart thermostats increase|decrease the temperature by 0.5 degree rather than 1 degree.

Would it be possible to change the increment|decrement value to 0.5 or somehow be able to select the increment|decrement value?

  1. Response to Setting Thermostat Target Temperature:
    When asking Alexa to “Set Loft Thermostat to 21.5” the response is “Auto set to 21.5”. It is possible for the response from Alexa to use the name of the thermostat as in this scenario “Loft Thermostat” instead of “Auto” for a more positive confirmation of the thermostat set?

Also, when first exploring the Thermostat, I thought Alexa also responded with “Auto set to 21.5” followed by “Current Temperature is 21”. Was I just engaging in wishful thinking or if not how do I invoke this response?

Thanks Again!

Configuration Node is Empty

Hi, I'm having an issue on a new Node Red instance, where the configuration node for VSH just stays empty. There is a name input but nothing else shown in the panel:

image

On another system, which already had VSH successfully integrated, I cannot retrieve my list of registered devices.

Registered Devices ...loading...

I'm not sure if this is a local issue or caused by some server outage. In any case, how would you analyze the issue? I cannot see any relevant logs in Node Red and the Chrome Network tab is also not showing anything.

In any case: The configuration node should show some backup/debug information in order to point the user in the right direction what's happening.

Feature Request HEX color with a leading "#"

Hey @csuermann,

would it be possible to add the leading "#" for the color_hex key.

Node-Red could then show the color directly in the debug log and we don't have to add this charackter infront with a following seperate node.

Thank you very much for your awesome support so far!!!!!

Example for ZigBee2MQTT:
image

[Feature request] Support for color xyY

Hi. I am using your very useful node to control some devices by voice with deCONZ. For color-changing-light-bulbs I had taken the HUE values from the output of your node and converted them for deCONZ in the right range.

Now I bought last week the LED band from Lidl/Silvercrest. This apparently does not accept color changes via HUE values, but XY works.
Example: {"on":true, "xy":[0.4193, 0.5053],"bri":200}

I found this thread in the forum how I can calculate these values with a function from RGB to use them with deCONZ.
https://discourse.nodered.org/t/use-dashboard-color-picker-for-deconz-conbee2-rgbw-stripe/37207

Now I thought, since besides deconz-rest-api also the API of Philips Hue has a use of the XY values for colors, that you could possibly consider these also with the output of your node.

Best regards and thank you!

Add support for PT - BR

Is it possible to release it to BR locale?
Is any translation is necessary, I can provide it.
Thanks

Activating the Virtual Smart Home skill

Hi I wonder if you can advise. I've just beeen talking to a guy (friend of mine - Antonio) who you;ve just helped with a sample flow or similar - that's not my issue. Indeed not your node at all - in order to use your node, we neeed to activate the virtual smart home skill in the Alexa App. I simply cannot get past that point.

So, on my smartphone, logged into Alexa (which I use all the time and have lots of lights and controllers etc) today I've tried activating the skill - I'm told by Alexa App (Android) that this will need account linking - I told it to go ahead (firstly without a UK VPN as I'm in Spain) then WITH a UK VPN - in both cases skills.store.amazon.co.uk says "we were unable to link at this time - try later" or similar. Thoughts?

Emit only attributes set by Alexa: name and source

The option "Emit only attributes set by Alexa" does exactly what it says: the payload contains only "directive" and "powerState". It would be useful if it also contained the fields "name" and "source: alexa".
Thanks
Achim

Generating new devices on every deploy if used in subflow with enviromental variable

Hi @csuermann,

I just tried to use your nodes within a subflow, to put the mapping that is needed for my devices inside. I used an enviromental variable to pass the name to your nodes. Sadly I received a notification on every deploy, that new devices were dicovered, for all the devices I changed to use the sub flows.

I am quite new to node-red and subflows, but I did not found any settings that could cause that.

Kind Regards
Maui

no response to changes in the brightness level

despite the DIMMABLE LIGHT BULB setting, I see this bulb in alexe but when I try to change the brightness with the slider, it turns on or off instead of changing the brightness level. I have ha and this is what the settings look like call service
Domain: light
Service: toggle
Entity Id: light.the_light
translated with google translator

Invalid Properties: Connection

I followed the step by step guide on activating the Skill and using the Code to authenticate - but during deployment i get a warning that the vsh virtual device is not correctly configured. But i don't see what could be possible wrong with the connection because i created a new one just entering a Name - then went to the code side and entered the code.

I don't see any messages in the console.

For reference - i'm using the nodered docker image - is there a specific inbound port that needs to be opened?

input to Alexa

Hi, first of all congratulations for this integration.I could make it work in 5 minutes.
From what I see Alexa is always woking as input device. I ask something and a message arrives in node-red.
Is there a way to trigger something in Alexa, for example a routine or a scene with a message from Node-Red?

stop command or percentage for blinds?

Hi Cornelius,

Imagine the following use case:
you want to close/open your blinds but want them to stop at a certain position.
One way would be to implement a percentage like "Alexa, open blinds livingroom 50%"
Or just "open blinds livingroom" and then your convenient moment "Alexa, stop blinds livingroom".

Or the blinds are closing automatically as you programmed, but you party outside and want it to stop?

Same applies for a garage or similar IoT device..

Thanks for considering,
Hans-Jörg

Invert logic of blinds

Hi,

i really appreciate you work. And it works very well with my system.

I just have a small favor to ask. Is it somehow possible to invert the logic of the blinds? So that 0% is open and 100% is closed. Reason is that my whole system is programmed this way. And it's hard for me to invert. Because what i've seen, i could not see out of the payload, if it is set via the slider to 100% or via the command "raise".

Thank you very much!

Kind regards
Maui

Feature Request: Control Door Locks

First, thank you for developing this skill. I love it!! I use homeseer as my backend home automation platform. I have several schlage door locks connected that i would like to control. I know i can use the garage door opener to say something like "Alexa, open my front door" and that would work, but i would like to be able to tell Alexa to lock and unlock doors instead of open and close them. perhaps maybe a voice security code like the garage door would be helpful as a simple security measure.

Thanks

Inform Alexa of new Blinds state seems not to be working correctly

When inputting the following payload to a virtual device of type Blinds, Alexa shows the device as up.

{"mode":"Position.Down","percentage":0}

Passthrough output looks like this

{"mode":"Position.Up","instance":"Blinds.Position","percentage":0,"source":"device","position":"Position.Down","directive":"OverrideLocalState","name":"Rolladen im Schlafzimmer","type":"BLINDS"}

Property position is changed correctly, but property mode obviously not.

Another question: Is changing the position (e.g. to 30%) not supported by the alexa app? I can only choose fully open or fully closed.

Thank you,
great work btw.!

RGB Lamp OFF remain OFF asking color

Using an RGB lamp, 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

Install error

While installing:
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name ""~"0.1.10": Tags may not have any characters that encodeURIComponent encodes.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-11-02T16_35_43_609Z-debug.log

:(

It happens with everything I try to install, so it's not your fault, mine is. I'll search for info. Sorry for this,
For future references, if someone reaches here: Solved by using sudo npm i -g npm

Alexa skill

Hi csuermann!
First of all I need to say thank you for sharing this amazing tool for the guys that we love to domotize our homes. I really appreciate people like you.

I have open this “issue” because I would like to learn about creating my personal Alexa skill to communicate with your node red contrib so I wanted to ask you if you will share this info with us?

Thank you in advance :)

Alexa App isn't showing actual state

hey Cornelius,

found a new problem maybe it is only the part sitting right in front of the screen :D

I'm deploying smarthome at my friends environment from scratch right now.
For now he is using alexa app to touch the buttons on the app to control his devices. So if we change the state of a switch inside node-red from any other source the state on the alexa app should be updated as well.

Here an example what we sent to your virtual device node's input to get this to work (but it is not right now):

{
  "name":"Kellerraum",
  "powerState":"ON",
  "directive":"TurnOn"
}

Do we only need the powerState for the input? We already tested this but didn't work as well. But that was written in the help part of your node.

Ty you in advance again!

Add Alexa Device ID to Message

Hey @csuermann,

it would be great if the Alexa deviceid would be sent with each message coming into the VSH nodes. That would enable device specific actions, like having a generic "lights" VSH node, which controls different lights depending on the Alexa device which sent the command.

Example: You're in the kitchen and say "Alexa, lights off" -> kitchen lights go off. If you say the same command in the living room, the living room lights would react, as the deviceid of the living room Alexa would be sent and a different nodered flow can go off.

It seems to be possible that custom skills receive the deviceid of the Alexa device which received the verbal command. Maybe this is a point to start: https://developer.amazon.com/en-US/docs/alexa/custom-skills/device-address-api.html#get-the-api-access-token-and-device-id

Feature Request: Description-field of AlexaApp editable in node-red

Please make the Description field in the alexa app editable in node-red. Currently, only the virtual device type is displayed there.
It would already help to add the node-red name to the description, as you can rename devices in the Alexa app and quickly lose the assignment.
Thank you, Achim

Device cannot be deleted

Error in the account, I can't delete the old devices registered previously, it gives me "ERROR"

Immagine

Temperature-sensor: Error in AlexaApp at value 0

When I set the value in the temperature-sensor to exactly 0 or 0.0, the AlexaApp reports "A problem has occurred / Ein Problem ist aufgetreten" and shows no value. Emit state shows no error.
As a workaround, I am currently adding 0.001.
Thanks!
Achim

adding extra devices

Hi
when asking alexa to discover new devices for other things, alexa also rediscovers the smart home device, adding multiple devices with same name.

Control Raspberry GPIO

Hi,

I'm getting a NAN output from my Raspberry Pi Node.
So It's not switching the GPIO to HIGH...

It requires a 1 or 0...

Any idea's how to resolve this?

Remove devices from lost configuration node

Hi, is there a way to remove devices from an account connection which is not active anymore?

Basically, what is there to do, if the hint to reuse an established connection to an Alexa account has been ignored? 😀

There could be the case that a previous connection is not retrievable anymore and a new configuration node to the same account needs to be created. Where do you find the old devices to delete them?

Node not sending any message if "Emit only changed attributes" is checked

Hey @csuermann,

you added this awesome feature by my request a couple days ago. Maybe it is not absolutly working as it should be.
The intention was to only send the payload that needed to do the request of the user.

So here an example:

I turn on the lights in the kitchen with my smart switch at the wall. Then I tell alexa to turn off the light in the kitchen. Nothing will happen if the new option is enabled.

Why will this happen: I think you made the logic as this that alexa knows the last state that she did for the user to turn on or turn off the lights f.e. And if this status isn't changed it won't send any message. (That is what your option is telling me right).

Here just to clear things up:

  • your node should send only that part that is told to alexa like turn on or turn off or change brightness etc.
  • if I turn the lights on it wouldn't be neccessary to send a message with the last color saved in alexa, only send the powerState
  • if I change the brightness it should only send the brightness instead of the powerState and color_temp and so on

Would this be possible as well?

Update Device State in Alexa App

Hello Cornelius,
I use the virtual device node to control my own light with wemos MCU. When i switch the color in the Alexa app to any color, it switches back to "warm white" after some seconds. I tried to send the VirtDev message back into the same node and changed the source to "device" before - as you mentioned here: https://discourse.nodered.org/t/announce-node-red-contrib-virtual-smart-home-for-alexa/34353.
It still does not work. The Passthrough function is disabled. Otherwise I create an infinite loop - which still does not work. I tried ^^
Is there something I do wrong? Or am I too early, beacause this function isn't released yet? I attached some images ;)

Kind regards
Jan

2021-02-07 01_35_54-Window

2021-02-07 01_36_18-Window

2021-02-07 01_36_56-Window

Temp Sensor example Anomalies

I am checking out your Node-RED vsh-virtual-device node and so far looks like it will perform nicely for me!

I did however discover some anomalies with the Temperature Sensor example from node-red-contrib-virtual-smart-home/examples/temperature-sensor.json. In summary, for msg.payload.scale of FAHRENHEIT, KELVIN and Kelvin it consistently provides an incorrect result as if these are treated as reserved or special strings.

Using the sample provided, I got the following results:

Regardless of the msg.payload.scale entered into the "measured temp = 220.5 °C" inject node, I got the correct result for spoken by Alexa:

From inject node: {"temperature":220.5,"scale":"CELCIUS"}, Alexa response: The pizza oven temperature is 220.5 degrees
From inject node: {"temperature":220.5,"scale":"Celcius"}, Alexa response: The pizza oven temperature is 220.5 degrees
From inject node: {"temperature":220.5,"scale":"abcdef"}, Alexa response: The pizza oven temperature is 220.5 degrees

For the msg.payload.scale entered into the "measured temp = 430 °F" inject node, I got the correct result for spoken by Alexa for anything other than "FAHRENHEIT"

From inject node: {"temperature":430,"scale":"FAHRENHEIT"}, Alexa response: The pizza oven temperature is 221.5 degrees
From inject node: {"temperature":430,"scale":"Fahrenheit"}, Alexa response: The pizza oven temperature is 430 degrees
From inject node: {"temperature":430,"scale":"abcdef"}, Alexa response: The pizza oven temperature is 430 degrees

For the msg.payload.scale entered into the "measured temp = 495 K" inject node, I got the correct result for spoken by Alexa for anything other than "KELVIN|Kelvin" where

From inject node: {"temperature":495,"scale":"KELVIN"}, Alexa response: The pizza oven temperature is 221.9 degrees
From inject node: {"temperature":495,"scale":"Kelvin"}, Alexa response: The pizza oven temperature is 257.2 degrees
From inject node: {"temperature":495,"scale":"abcdef"}, Alexa response: The pizza oven temperature is 495 degrees

Device name

Hi would be nice to ouput device name i.e. "lounge wall switch". This would make it easy to identify and rout messages.

Great node excelent work, Thank You

Feature request: generic sensor for data reporting

This is an awesome project because it's very useful and easy to configure.

I would like to suggest another important feature, a generic sensor for data reporting.

Example: in the screenshot below I would like to select a new type called generic sensor, which can report data via voice commands.

image

In the example above, I could retrieve information from the generic sensor via voice commands:

  • Alexa, get the temperature from the kitchen sensor
  • Alexa, read the humidity from the kitchen sensor
  • Alexa, what's the pressure from the kitchen sensor?
  • Alexa, report the status of the kitchen sensor (Alexa will read all the values)

The generic sensor node have an input that receives a msg.payload with an object. This object contains the data to be read:

{
  "temperature": {
     "value": 20.8, 
     "unit": "Celcius"
  },

  "humidity": {
     "value": 66.3, 
     "unit": "percent"
  },

  "pressure": {
    "value": 1.02,
    "unit": "atm"
  }
}

It's up to the flow to update the generic sensor, it can be done periodically like once per minute, the generic sensor will store the last msg.payload received and it will report the requested values via voice commands.

Alexa should report the measures like:

  • The temperature is 20.8 Celcius
  • The humidity is 66.3 percent
  • The pressure is 1.02 atm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.