Node-RED nodes for hubitat

I don't know if this would help but I've been using the "semaphore" nodes.. I can set a semaphore and other msgs will be ignored then at the end remove it.

I am using it to limit my daughters Echo Dot time..

2 Likes

That's an interesting node. Thanks for mentioning it.

2 Likes

The final line in the Usage Section of that palette's webpage makes me nervous bcuz that would be me:
"Use with care, it can be easy to set yourself up in a dead lock situation."

1 Like

Yeah that's why you use the "catch" node for errors and for the other stuff - even without those you can always get into trouble with infinite loops etc.. so it's whatever your tolerance for pain is. I don't think it's all that risky though if you keep it simple like using dedicated semaphores for individual sequences.

edit (again): of course you could always add an inject node on startup that "clears" all your semaphores.. or something like that.

1 Like

Btw thats a cool use-case. Am digging the Alexa integration so far.

1 Like

It was inspired by this post by @april.brandt's where she is integrating an antique radio and an Echo Dot. Did you see her thread? It's a SICK idea!!! Old meets new.

That Alexa Remote2 palette will give you a ton of information every time she does something. Most is unusable but there is a lot of information buried in the messsages.

2 Likes

Wow - that's awesome @april.brandt - I missed that thread completely.. thanks @stephen_nutt !!!

You did, but this is what I'm running intto. The flow is not identifying which echo, even though I enter the name, it's not seeing it. Also, want to integrate the light sensor into it because it bridges the gap.

I'm sorry to jump in.. I've been using "deviceSerialNumber" to detect which device.

2 Likes

This is what comes out of an On Device Activity Node from just asking her what time it is:

Click on image to see the entire length of it.

So using payload.name = to the name of the Echo you want is not working? That should be in the Switch Node coming out of the On Device Activity Node in this sequence of flow:

Great idea!!!

3 Likes

correct, it is not working. I think it makes a difference that it is an amazon dot. I've noticed some different behaviors between the two of them.

Here's what's in my head. I know that there is a way to do it.

"Alexa"
light sensor reads on and lights up
what's the weather or tell me a story or where is something - the light sensor will keep the lights on in a limited capacity during some of these
Then i want it to see what is happening with the music player and either flow into that or turn off the lights. I don't think I'm explaining it right. I've got it working to light up when it plays music, but it's not good enough.

Yeah, but if you stick a debug node on there, set it to complete message, I would expect the device name or serial number is in the message somewhere...

yes, it is. but how to connect the light sensor into the flow?

I would have to see the flow to comment.

That said, when I want to set "and" conditions, I will often take the value I want to check and assign it to a flow variable using a change node.

Then when I want to check the variable, I put a switch node in the chain of events/flow that looks at the variable and decides whether to proceed or not based on the variable's value.

Something like:

In your case, "Some variable" could be echo dot status and "Some event" could be the light sensor, or whatever else triggers your flow.


This is confirmed to be working. music starts, lights turn on. but you can do it from either echo. I only want the one echo to light it up. I tried the deviceSerialNumber and still get the same results.
I deleted the other flows because they aren't working right.

What's in the switch node? Might need 2 switch nodes - 1st one checks serial number/device name, and second checks function?

1 Like

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