Issue with node-red-contrib-alexa-remote2

Does anyone have a workaround to the frequent failures of this node because you need to log on to Amazon to update the damned cookie?

I would be OK with some regularity, like once a month, then I can put a reminder on my calendar. But no. This “log on to 192.168.1.35:3456” happens with no regularity. Sometimes a few weeks, sometimes a few hours.

1 Like

There’s a new version, that node isn’t maintained.

I’ve found its pretty regular unless you reboot your HA, then you have to re-authenticate.

Thanks. That explains why there have been no updates for almost a year…

Is this a direct replacement for node-red-contrib-alexa-remote2?
In other words, do I just remove node-red-contrib-alexa-remote2 and install node-red-contrib-alexa-cakebaked? Or, do I need to edit every node with the same names?

I’m using cakebacked’s and this flow:

[{"id":"8d5e6c19.b0249","type":"comment","z":"6cd0b2f8.4bb6fc","name":"Reinicia alexa la cuenta alexa si no funciona","info":"","x":530,"y":60,"wires":[]},{"id":"513dd1b5.698fd","type":"inject","z":"6cd0b2f8.4bb6fc","name":"4 horas","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"14400","crontab":"","once":true,"onceDelay":0.1,"topic":"A","payload":"refresh","payloadType":"str","x":160,"y":170,"wires":[["4af276ab.50fe68"]]},{"id":"ad6e6ce2.6e106","type":"inject","z":"6cd0b2f8.4bb6fc","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"Started!","payloadType":"str","x":160,"y":230,"wires":[["f4722d3a.83fc4"]]},{"id":"c4204271.22e2","type":"inject","z":"6cd0b2f8.4bb6fc","name":"5 Minuto","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"A","payload":"true","payloadType":"bool","x":160,"y":300,"wires":[["390c17bf.e13308"]]},{"id":"f4722d3a.83fc4","type":"change","z":"6cd0b2f8.4bb6fc","name":"set","rules":[{"t":"set","p":"payload","pt":"msg","to":"alexa","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":230,"wires":[["969e134e.022a1","9c70705f.af0d8"]]},{"id":"969e134e.022a1","type":"function","z":"6cd0b2f8.4bb6fc","name":"Valorizza","func":"global.set(\"alexa\", msg.payload);\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":460,"y":210,"wires":[[]]},{"id":"49229144.b0447","type":"function","z":"6cd0b2f8.4bb6fc","name":"","func":"//var x=global.get(\"Rain\");\nglobal.set(\"Alexa__\",0); \nif(msg.payload!=true)\n{\n msg.payload=\"refresh\";\n return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":700,"y":320,"wires":[["3c1ff04.e80871"]]},{"id":"de3397e0.a96178","type":"alexa-remote-init","z":"6cd0b2f8.4bb6fc","name":"","account":"bb44c27d.b8d5a","option":"initialise","x":850,"y":190,"wires":[["692301fc.fb76c"]]},{"id":"692301fc.fb76c","type":"change","z":"6cd0b2f8.4bb6fc","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.csrf","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":190,"wires":[["83f7886a.4a9438"]]},{"id":"83f7886a.4a9438","type":"function","z":"6cd0b2f8.4bb6fc","name":"","func":"async function delay(timeMs) {\n  await new Promise(resolve => setTimeout(resolve, timeMs));\n} \nvar newInit = msg.payload;\nvar oldInit = global.get(\"alexa\");\nif (newInit != oldInit)\n{\n global.set(\"alexa\", msg.payload); \n msg.payload=\"refresh\";\n await delay(20000);  \n return msg;\n}\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":190,"wires":[["1e442b7d.c2de15"]]},{"id":"6576f31f.dea88c","type":"alexa-remote-other","z":"6cd0b2f8.4bb6fc","name":"","account":"bb44c27d.b8d5a","config":{"option":"checkAuthentication"},"x":510,"y":320,"wires":[["49229144.b0447"]]},{"id":"390c17bf.e13308","type":"delay","z":"6cd0b2f8.4bb6fc","name":"","pauseType":"random","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"0","randomLast":"5","randomUnits":"seconds","drop":false,"x":320,"y":300,"wires":[["6576f31f.dea88c"]]},{"id":"2928bceb.7bc434","type":"catch","z":"6cd0b2f8.4bb6fc","name":"Check Authentication","scope":["6576f31f.dea88c"],"uncaught":false,"x":120,"y":340,"wires":[["383dce50.fa9c62"]]},{"id":"383dce50.fa9c62","type":"delay","z":"6cd0b2f8.4bb6fc","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":320,"y":340,"wires":[["6576f31f.dea88c"]]},{"id":"9daa9719.e22fa8","type":"catch","z":"6cd0b2f8.4bb6fc","name":"Initialise","scope":["de3397e0.a96178"],"uncaught":false,"x":160,"y":110,"wires":[["aff93015.2c7e3"]]},{"id":"aff93015.2c7e3","type":"delay","z":"6cd0b2f8.4bb6fc","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":290,"y":110,"wires":[["8f910d7b.f5d5d"]]},{"id":"8f910d7b.f5d5d","type":"change","z":"6cd0b2f8.4bb6fc","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"refresh","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":110,"wires":[["1c7e7e04.dacaf2"]]},{"id":"3c449a39.1d29e6","type":"link in","z":"6cd0b2f8.4bb6fc","name":"","links":["1e442b7d.c2de15","3c1ff04.e80871","1c7e7e04.dacaf2","4af276ab.50fe68","9c70705f.af0d8"],"x":755,"y":190,"wires":[["de3397e0.a96178"]]},{"id":"9c70705f.af0d8","type":"link out","z":"6cd0b2f8.4bb6fc","name":"","links":["3c449a39.1d29e6"],"x":415,"y":250,"wires":[]},{"id":"1e442b7d.c2de15","type":"link out","z":"6cd0b2f8.4bb6fc","name":"","links":["3c449a39.1d29e6"],"x":1305,"y":190,"wires":[]},{"id":"3c1ff04.e80871","type":"link out","z":"6cd0b2f8.4bb6fc","name":"","links":["3c449a39.1d29e6"],"x":805,"y":320,"wires":[]},{"id":"1c7e7e04.dacaf2","type":"link out","z":"6cd0b2f8.4bb6fc","name":"","links":["3c449a39.1d29e6"],"x":575,"y":110,"wires":[]},{"id":"4af276ab.50fe68","type":"link out","z":"6cd0b2f8.4bb6fc","name":"","links":["3c449a39.1d29e6"],"x":275,"y":170,"wires":[]},{"id":"bb44c27d.b8d5a","type":"alexa-remote-account","name":"Edu","authMethod":"proxy","proxyOwnIp":"192.168.1.29","proxyPort":"1234","cookieFile":"/config/.storage/authentication2","refreshInterval":"1","alexaServiceHost":"alexa.amazon.es","amazonPage":"amazon.es","acceptLanguage":"es-SP","userAgent":"","useWsMqtt":"on","autoInit":"on"}]

And do this too ( bbindreiter’s fix) since cakebacked’s has needed some tweaking lately:

I’ve had very few problems since I set both

1 Like

@stevemann unfortunately they are different. The way it works is if the original maintainer of the node/integration/etc isn’t responsive, there is no way to take over the repo. At that point all you can do is copy the project and continue under a new name.

Thanks, but that wasn’t the question.
Do I just drop in CakeBake, or do I have to remove and reinsert all of my dozens of remote2 nodes?

I can’t find the source where I extracted this information but, to install cakebackeds coming from the original alexa-remote2, do this:

Export all flows to file
Delete all flows
Uninstall “node-red-contrib-alexa-remote2” via UI
Install “node-red-contrib-alexa-cakebaked” via UI
Import flows from file
Restart Node-RED

1 Like

hi how do i remove remove node-red-contrib-alexa-remote2

how to remove? does not work

npm_packages:

  • remove node-red-contrib-alexa-remote2
    init_commands:
  • remove node-red-contrib-alexa-remote2

Manage palette in the main menu.

Have you tried this?

init_commands:
  - npm uninstall node-red-contrib-alexa-remote2
1 Like

everything was reinstalled, but alexa works for about 2 days 24 hours and then I have to reload Node Red,

what do you suggest?

Have you tried cakebaked?

Uh, three days?

1 Like

create an authentication file so you don’t have to keep login in

@Isaias_Irizarry

I don’t understand how to do it- Edit exec node touch file msg.payload

lasts 24 hours maximum 2 days

I have filepath set up

The same thing happens to me, I would love to receive an answer. I have no idea why every three days it stops working for me and I have to restart node red.

ah first you must create a file
you can do this by creating an exec node
with the command “touch file”
this will create a file called file in the directory /opt/
then inside of node-red auth under file path enter /opt/file

You might also try this, refreshes the cookie every hour. I can’t remember the last time I logged into alexa via node-red once I started using this. Will need to update the settings, basically just select the alexa account I believe.

[{"id":"5d6f4bd237cce51e","type":"alexa-remote-init","z":"1d6ea103169544d8","name":"Refresh Cookie","account":"DELETED","option":"refresh","x":320,"y":40,"wires":[["fe394cc3e0de8206"]]},{"id":"eaf8162ad9ef351e","type":"alexa-remote-init","z":"1d6ea103169544d8","name":"Fresh Authentication","account":"DELETED","option":"fresh","x":320,"y":100,"wires":[["fe394cc3e0de8206"]]},{"id":"d758ddf8b963b0bd","type":"catch","z":"1d6ea103169544d8","name":"","scope":["5d6f4bd237cce51e"],"uncaught":false,"x":130,"y":100,"wires":[["eaf8162ad9ef351e"]]},{"id":"fe394cc3e0de8206","type":"debug","z":"1d6ea103169544d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":100,"wires":[]},{"id":"a069672a71520df2","type":"inject","z":"1d6ea103169544d8","name":"1 Hour Loop","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"0 0-23 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":120,"y":40,"wires":[["5d6f4bd237cce51e"]]},{"id":"DELETED","type":"alexa-remote-account","name":"Alexa Account","authMethod":"proxy","proxyOwnIp":"172.30.1.46","proxyPort":"3456","cookieFile":"/config/node-red/alexa_auth","refreshInterval":"3","alexaServiceHost":"pitangui.amazon.com","amazonPage":"amazon.com","acceptLanguage":"en-US","userAgent":"","useWsMqtt":"on","autoInit":"on"}]
1 Like

Has it got better by itself?