Node-RED nodes for hubitat

image

on audio player state change doesn't allow the switch for the device to work.
I have to have an activity node in there to specify

I'm getting so confused as to what will and wont work, I should just erase it and begin a new thought

So if the alexa event has a distinguishing value that identifies the device - msg.name, serial #, other, then use two switches in series.

1st one checks if name/serial # is the one you want. If it is a match, then msg flow continues. Then
the second switch block checks activity (basically what you have now).

I don't use alexa, so can't tell you exactly what msg variable you need. But if you don't know, run the output of the alexa node into a debug node, set the node to entire msg, trigger an alexa event and look at the debug message. It will list every parameter available.

Somnething like:

1 Like

@april.brandt I'm confused also and feel the same way.

image
how

Again, if you don't know what msg variable you need then run the output of the alexa node into a debug node, set the debug node to entire msg, trigger an alexa event and look at the debug message. It will list every parameter/variable available.

That is 1st step trouble shooting for any node-red node/flow, not just for alexa.

Once you know what the alexa node is spitting out, and assuming the value you want is actually in the message somewhere, you should be able to use the desired variable in a switch node.

1 Like

If you still can't figure it out. Post the result of the debug message in here after doing whatever you normally do as an alexa trigger. and maybe we can look through it.

@april.brandt This is what your debug node should output in debug window pane:
image

So you Switch Node is:
image
In my case, the Echo Dot is called Ainsleys Room in Alexa app.

Or you could use msg.payload.deviceSerialNumber

1 Like

Maybe leave your big switch where it is... but before it place another switch that only checks for the deviceserial # ... you only need to test for just the device you are interested in, the others can get discarded.

Does that make sense? (note: I rarely do so ymmv)

PS: This is why we need a "Raspberry PI" folder under the Developer Tab in this forum!!!!!!!

1 Like

Like mine..

Note: I added a little message when my daughter tries to access - it whispers to her: "Alexa is available from 6 am to 10 pm. Please try back between those times."

She really does hate me I think... :rofl:

1 Like

My oldest is almost 3. I will have to remember that one. THAT'S CLASSIC!!!!

2 Likes


@JasonJoel @erktrek
This is the flow... it handles different aspects of the integration.
the on device activity basically does what the light sensor does, but with no delay. The second that dot lights up, the radio lights. This is my goal. So ... I've been pouring over the logs and can't find anything that will log the finished activity. It says successful at launch of an activity or question/story/weather/location. So putting these together without a generic delay might not be possible? The dot only stays lit for certain things. Weather, time . It seems she stays lit when answering a question, but when asking her to perform a skill, the light does not stay lit. This is where I need to bridge the gap. I hope this makes sense? I've confirmed that all of these work correctly independently, but on device activity doesn't turn off the light yet.

So the trick is finding "off" - I was noticing that earlier when I was fooling around with recreating a simplified version of what you were trying to do.

One strategy I was looking into was counting the messages (count node) - for each device activity there seems to be either 2 or 4 msgs.. my initial thought was testing modulus 2 on the message count coming in and any with a result of 0 are the ending ones... otherwise a deeper dive into the actual messages. Maybe some sort of status somewhere.

Didn't get very far before getting distracted though. Still am very curious...

Btw I told my daughter about your project, don't think she was impressed - the kids these days...is steampunk not a thing anymore?

:nerd_face:

I know! But we weren't interested in classic things until we learned to appreciate what is around us. This is why I want to do this radio. Old into the tech age without hurting the nostalgia of the piece. Even got Jeff interested in the build. Now, he could care less because he doesn't care about the programming of it.
Really, the logic is simple. It's just finding a way to make it translate. Basically if device activity is active don't turn off the rgbw's. the light sensor is one trigger, but the device activity is another. Do I need to capture that info somewhere? Is there a way to do that? There has to be.

MY NEW LOCK IS HERE.... i'm not done, but definitely pausing this radio project for a bit.
Let me know your thoughts on this while I get this lock. I've been waiting on it to finish my review.

3 Likes

I'll have to bow out on this one, and let someone that uses Alexa comment on what variables/states/events are available for use...

1 Like

I was doing simple tests with a debug node + asking alexa things like the time / weather / tell me a story etc and looking at the results nothing really leapt out at me except for maybe the message count. There seems to be an ID that relates to all the messages in the "session" as well.

edit: looking forward to hearing your thoughts on the lock!

I had the lock out of the door in anticipation of the arrival of my new lock. So, I'm going to work on this while I mess with the newly installed lock and create some rules to fit the household.

My question is .. what is triggering the node? could I use that to pause the light sensor flow? If you can't do it directly, is there a way to walk around to the back side of the box and cheat it?
[EDIT]
If the light is already on, then is there way to just not turn off the rgbw strips when the switch turns off?

1 Like

Dunno that gets into the node itself.. It's the hooks into Alexa via the WsMqtt events.. I think..

Another thing you can play around with is testing for "payload.domainAttributes" - for the most part if it's null then it's done so add a switch node and test for "is not null" to turn on and "is null" to turn off. That might be a start..

edit: for me its working for "time" but not "weather".

When Alexa is done, she sends a message with payload.description.summary is "" every time as far as I can tell.
image

That's what I use to turn her off.

2 Likes