Alexa node-red-contrib-alexa-remote2-applestrudel how trigger to get activities

I use the get activities (other node) to grab the payload.description.summary to then process further. I used to use a alexa routine to trigger a switch in Homeseer (my home automation system via the Homerseer skill) to then inject the get activities node. Due to the Homeseer skill now being paid only, this does not work any more.
I am trying to find another way to trigger a inject into my get activities node when I speak to Alexa. The listen node has stopped working a long time ago, its listening but does not trigger at all.

See this thread:

I did see that post. My issue is not with the applestrudel, thats working fine (except for the listening node), if I inject the get activities node, it gives me the last thing I have asked Alexa.
I just need to find a way of triggering a inject to the get activiteis node output when talking to Alexa

I'm a bit of a novice here, but as I understand your problem is triggering the message to the Alexa node. I found, as others that the listen node doesn't seem to trigger so now use a series of actions, e.g. a virtual switch that triggers when I ask Alexa a certain question, a presence sensor that notes when I come into the kitchen, or, as I use a tracker, when this is in the salon area.
Maybe you've already tried this, but just a suggestion.
Some ideas here

Yes that is what I used to use. I triggered a virtual switch via the Alexa routine, then that sends a message to the get activities node. But now, unless I pay a subscription I cannot trigger the virtual switch any more, so need to find some other way

Have a look at @smcgann99 creative solution using VSH and a virtual light.
I've been using it to trigger a number of my devices for over 6-months - works faultlessly.

I've taken Sean's @smcgann99 idea a stage further with a VSH virtual light named 'location'.


I can say to Alexa... "Alexa, I'm in the Study" (or any other room) and she will response with "Thanks for letting me know". At the same time the flow sets a 'destination' variable so any futher messages from Alexa are routed to the Alexa device in that particular room. Took a while to enter all the details into the Alexa app - but well worth the time and energy.

Here's a screenshot of flow for the virtual light named 'action'.

6 Likes

Now that's cleaver! I know what I'm doing this evening. :slight_smile:

1 Like

Finally got the VSH solution working. Now I need to change all my routines and add everything to NR :grinning:

2 Likes

Initially found this thread but wasn't clear on how to implement the functionality. After discovering there was an associated thread that provided the missing context, I was able to get my solution working.
Steps: created a VSH device that is of type - dimmable light, following the current examples, named it "Command". Then in the Alexa app, created a routine and also named it "Command" to match the VSH device created in Node-Red. In the routine setup, in the 'When' section I entered the desired spoken phrase; then in the 'Alexa Will' section I selected the Smart Home device category, expanded All Devices, and selected "Command" and also selected the 'Brightness' option and set the brightness value to the desired level.

This is the part where I'm not sure if I'm doing this correctly. In the 'When' section I've entered multiple spoken phrases, each specific to the desired system request I'd like to make. Then in the 'Alexa Will' section I entered additional actions that call the "Command" and set a unique brightness value for each. Finally, in Node-Red, I use a switch node and route the flow to the appropriate path based on the detected msg.payload.brightness value.

Would appreciate guidance if I've overlooked something, or have inadvertently created a headache for myself down the road. -Thanks

@Donner This sounds correct, what exactly are you not sure about ?

@smcgann99 What I'm unclear on is within the Alexa app, the routine consists of one 'When' entry with multiple phrase entries; then in the 'Alexa Will' section there are individual action entries, all referencing the same Smart Home device ("Command") but each having a unique brightness value.
What I'm curious about is how the spoken phrase is consistently associated with the same brightness value.

When I first started with this solution, I had the VSH device connected to a function node and I was using 'if' statements to determine the appropriate action based on the detected brightness value. When I tested this configuration all of the 'if' statements would execute regardless of the spoken command.

I've created three phrase entries for testing in the single 'When' section and three separate 'Alexa Will' entries with brightness values of 10, 20 and 30.

Now, with the 'switch' node, regardless of the spoken command, the first brightness value action is always triggered, then the desired action followed by the last action.

From a data association perspective, this appears to be a many-to-many relationship, so no matter what the spoken phrase is, all configured actions will get executed.

I'm not sure how to have the spoken phrase mapped to a single brightness value.

I see what you are doing now :wink:

You can only have one routine for each "command" brightness. There can be several phases in the When section, so you don't need to remember a specific phrase, but should only be 1 Alexa will entry.

So create multiple separate routines one for each different command.

Thanks for the reply. I'm obviously missing something then. In one of the flow examples above provided by @dynamicdave, it appears to a VSH device labeled "Location" that passes to a switch and then multiple functions. He indicates he is able to speak different phrases stating his location and the flow processes accordingly. There is only one "Location" VSH device, so on the Alexa app backend are there multiple routines uniquely names for each spoken phrase that all reference the same VSH device in the 'Alexa When' section, with unique brightness values? If so, I thinks that is the part of this configuration that wasn't clear to me.

If you don't need the location then ignore that bit.

Otherwise as far as I can tell the "Location" is just another VSH light device, with multiple routines 1 for each location, which sets a unique brightness which NR uses to set a location variable.

Sorry for the delay in responding - been busy with IoT students.

@smcgann99 is spot-on with his assessment (as he was the person who suggested the idea).

I can say phrases like... "Alexa, I'm in the study" or "Alexa, I'm in the back bedroom" and all that happens is a certain value (brightness) is sent to VSH device named Location. This is decoded in the NR-flow and used to set a 'destination' variable which is used to route any Alexa message to a certain Alexa device (I have six Alexa devices in various places in my house). The NR-flow also sends an acknowledgement that says... "Thanks for letting me know, this Alexa device will now be used for system messages".

Note: The above method of using a couple of VSH devices has been completely reliable for the whole of 2024, whereas, the Alexa activity feature was very unreliable.

Appreciate the replies @smcgann99 and @dynamicdave ! I'm not the sharpest tool in the shed, but things finally clicked and I believe I understand the process and how things need to be configured.

It's actually a many-to-one relationship (many Alexa routines to one VSH device).... Start by creating a VSH device of type dimmable light. Then in the Alexa app, create separate routines, each configured with the desired phrase Alexa should recognize; each routine will reference the same VSH device created in NR, but each will have a unique brightness value set.

This configuration allows for one voice command to be associated with one brightness value, which the VSH device receives and can then pass to the switch node in order to determine the appropriate flow path to follow.

Thanks again! This really expands my home automation capabilities.

2 Likes

You are "spot-on" with how the the VSH node works with Alexa.

I hope you have as much "fun" with it as I've had.

1 Like