I am sure the experts here can find a more efficient way or make improvements to it. When Alexa is playing music, she sends a message from the On Audio Player State Change that she is "Playing". However, every time she changes songs, she sends a "Stopped" then almost immediately "Playing" again so I have the mytimeout Node set to 5 seconds so that the light doesn't flash at every song transition.
Also, she sends an empty msg when she is done talking if you use the On Device Activity Node in the other sequence I sent you to play with. Unfortunately, the message is sent a 5+ seconds after she is done talking.
@aaiyar Have you used the Alexa Remote2 palette to do anything when Alexa is talking and when she stops as a trigger?
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..
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."
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.
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.
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.
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:
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...
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.
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.