Alexa 'On Device Activity' not working

Still very intermittent for me - restart NR and it work, a s few mins later no joy.

I may have to setup a virtual light and use routines instead of Q&A to set different brightness levels on it so I can react to that. :roll_eyes:

Exactly the same with my setup - works for a few minutes and then just ignores "OnDeviceAct".
Very frustrating!!

Bloomin heck - your right - I tested it continuously for 7 mins and it stopped working after 3 mins :frowning:

Actually, my Alexa locked up and wouldn't respond - going back (Again) to my Win11 setup and will test that for a few minutes

Oik - back on Win 11 - not going to stress test - just going to use it and see if it fails in normal operation

I actually use @hardillb node-red-contrib-alexa-home-skill for most of my lightswitch on/off stuff - I just use applestrudel for some other bits

The idea is to avoid using the Activity node. A routine can take the place of Q&A.

Eg An Alexa routine called whatever your Q&A was but it sets a virtual light to brightness 1.

Virtual light then reports this state change - a switch node routes the msg based on the reported brightness, to take appropriate action. So 100 different routines reported back via this method.

Just add an extra light if needed :wink:

1 Like

I setup a light called "command" but I could never remember which command number did what :slight_smile:

And since I've moved back to running on my Win11 instance - it's worked perfectly

image

Strange gmae :frowning:

This is the flow I've been using for months to re-trigger the Alexa Initialise node.
It catches various errors and after a 10-sec delay tries to re-trigger the node. There was a wire from the 'delay' node to the 'Initalise' node but I removed it because of all the recent problems.


The trigger 'inject' node is set to re-trigger every 6-hours. OnDeviceAct has been working fine since
04:24 hrs this morning. It will be interesting to see what happens this morning at 10:24hrs.

[Edit] Well it worked and 'OnDeviceAct' is still working (fingers crossed it keeps working).

If anyone is interested, here's the code...

[{"id":"af5e8155a1978f4c","type":"group","z":"7fa3299b269a02b1","name":"","style":{"fill":"#e3f3d3","label":true,"stroke":"#d1d1d1"},"nodes":["3c5fc9a02e7d2e9d","fac478d34f1d1c91","46bc496e73300e2d","db18fdda5d75db29","53dde391381dfefc","299c9c9c33fe13c9","5ad918ab3eabb29d","79c921c43908a88e","4383f85d86f73fe7","4aef86af826cc53f"],"x":34,"y":39,"w":792,"h":342},{"id":"3c5fc9a02e7d2e9d","type":"catch","z":"7fa3299b269a02b1","g":"af5e8155a1978f4c","name":"","scope":["4aef86af826cc53f"],"uncaught":false,"x":150,"y":260,"wires":[["fac478d34f1d1c91","46bc496e73300e2d"]]},{"id":"fac478d34f1d1c91","type":"debug","z":"7fa3299b269a02b1","g":"af5e8155a1978f4c","name":"catch alexa error","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":" $moment().format(\"ddd HH:mm:ss\")","statusType":"jsonata","x":370,"y":340,"wires":[]},{"id":"46bc496e73300e2d","type":"switch","z":"7fa3299b269a02b1","g":"af5e8155a1978f4c","name":"","property":"_error","propertyType":"msg","rules":[{"t":"eq","v":"Error: no JSON","vt":"str"},{"t":"eq","v":"Error: account must be initialised before refreshing","vt":"str"},{"t":"eq","v":"Error: Error while checking Authentication: Error: no JSON","vt":"str"},{"t":"eq","v":"Error: Account not initialised!","vt":"str"},{"t":"eq","v":"Error: Authentication failed: \"no JSON\"","vt":"str"},{"t":"cont","v":"Error: unexpected response layout:","vt":"str"}],"checkall":"true","repair":false,"outputs":6,"x":330,"y":260,"wires":[["db18fdda5d75db29"],["db18fdda5d75db29"],["db18fdda5d75db29"],["db18fdda5d75db29"],["db18fdda5d75db29"],["db18fdda5d75db29"]]},{"id":"db18fdda5d75db29","type":"change","z":"7fa3299b269a02b1","g":"af5e8155a1978f4c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"alexa","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":260,"wires":[["53dde391381dfefc"]]},{"id":"53dde391381dfefc","type":"delay","z":"7fa3299b269a02b1","g":"af5e8155a1978f4c","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":700,"y":260,"wires":[["4aef86af826cc53f"]]},{"id":"299c9c9c33fe13c9","type":"inject","z":"7fa3299b269a02b1","g":"af5e8155a1978f4c","name":"trigger","props":[{"p":"payload"}],"repeat":"21600","crontab":"","once":true,"onceDelay":"3","topic":"","payload":"alexa","payloadType":"flow","x":140,"y":140,"wires":[["4aef86af826cc53f"]]},{"id":"5ad918ab3eabb29d","type":"change","z":"7fa3299b269a02b1","g":"af5e8155a1978f4c","name":"","rules":[{"t":"set","p":"alexa","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":140,"wires":[["79c921c43908a88e"]]},{"id":"79c921c43908a88e","type":"debug","z":"7fa3299b269a02b1","g":"af5e8155a1978f4c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":" $moment().format(\"ddd HH:mm:ss\")","statusType":"jsonata","x":710,"y":140,"wires":[]},{"id":"4383f85d86f73fe7","type":"comment","z":"7fa3299b269a02b1","g":"af5e8155a1978f4c","name":"Initialise node-red-contrib-alexa-remote2-applestrudel","info":"","x":300,"y":80,"wires":[]},{"id":"4aef86af826cc53f","type":"alexa-remote-init","z":"7fa3299b269a02b1","g":"af5e8155a1978f4c","name":"","account":"3f1413240d54f337","option":"initialise","x":340,"y":140,"wires":[["5ad918ab3eabb29d"]]},{"id":"3f1413240d54f337","type":"alexa-remote-account","name":"Amazon-Alexa","authMethod":"proxy","proxyOwnIp":"192.168.1.152","proxyPort":"3458","cookieFile":"/home/pi/amazon_alexa.txt","refreshInterval":"3","alexaServiceHost":"alexa.amazon.co.uk","pushDispatchHost":"","amazonPage":"amazon.co.uk","acceptLanguage":"en-UK","onKeywordInLanguage":"","userAgent":"","usePushConnection":"on","autoInit":"off"}]

I beleive there is still an issue with the code, which CAN self correct in the backgound.
This can happen without any user interaction, so you only know its not working when you try it.

It may work any number of times but can then stop working.

I've decided to try out a @TotallyInformation alternate install on my Pi alongside my main NR instance

Has worked fine for past hour

Lets see what happens

I wonder if it's an issue with running other Alexa type nodes alongside applestrudel

[edit 18Sep23 - And that failed as well - went back to my WIn11 instance and that has failed today as well

I've now added a flow that gets Alexa to say confirmed if it receives a spoken command - so at least I can tell if the command is going to be ignored or not

2 Likes

I think there is some Heisenberg effect going on here! :slight_smile:

In normal usage, (when I'm listening for "Alexa,Simon says ..." ) it "seems" to work perfectly.

I've now rigged up another Pi to speak a test command out every 10 mins and event was received fine for an hour

I'm now testing it out at 4 minute intervals [edit] which has worked for past hour

So now testing every 2 mins... which has worked fine for past 30 mins

So now testing every 1 min....and that has worked perfectly as well

1 Like

You realise Amazon.com will eventually explode ? :exploding_head:

1 Like

:slight_smile:
So today I shortened interval down to 30 secs, then 20 secs, then 10 secs

Nothing missed at all (this is with it running on my Win11 instance)

Going to go back to Pi alternate install and see what happens

Didn't work consistently on my Pi so went back to Win11 and that still working consistently

1 Like

There might be some good news

[edit] see later info in thread - I now don't believe this change is the solution

2 Likes

Hi Simon - thanks for the 'heads-up' on this.
I've followed your suggestion to replace 'alexa-remote-account.js' and can confirm it is working for me.

Go back and see later info - and see if you can replicate behaviour please

I keep having problems with alexa commands ,they work once after a deployment and then they don't work anymore.

1 Like

My setup has started misbehaving (again) not reacting to 'On Dev Act'.
I've tried different authorisation methods - all to no avail.
It will be interesting to hear if 'others' are encountering issues.

1 Like

It only works after a Deploy for about a minute, then it crashes.

If Node-RED is crashing, then I think you have a different problem to the rest of us.

For the rest of us, it is just the Device Activity node stops outputting messages from time to time

If it is crashing, I would start a new thread and post a copy of your Node-RED log

1 Like