Set ALEXA REMINDER via NODE-RED once Daily / Weekly

Dear Team,

First Of all i am new to node-red but i really loved it.
I have raspberry pi 4b 4gb and i have configured the Node-red on it for always on. Also have Alexa echo.

Project :- Want to make prayer reminder/alert which is 5 time a day and mostly different times and alert/remind via alexa announcement or alexa speak. Currently this is done via 'Prayers Time' Alexa skill but it is not accurate and i need accuracy (as per home town)

I am using below nodes (Might change if needed!)

node-red-contrib-alexa-remote2 Alexa routine

Mostly using just for Direct Speaking / Anonouncement.


You can ignore above image if you want it is work in progress.

For example ( One of Alexa skill Prayer Times sets daily reminder updated)

I just want to this below.

  1. Pending - @ daily 1am it will trigger the node-red or weekly incase of week data. I think it is not an issue to trigger this with corn plus or similar.
  2. Done - NODE-RED fetch daily or Weekly Prayer times and store somewhere(in case of weekly only). (Daily is working properly currently)
  3. Pending - NODE-RED delete old and create new reminders with the detail received in short set 5 daily prayer schedule as shown in above image. Currently clueless

Thats it.
But need help as i unable to get any info on creating REMINDERS inside ALEXA via Node-red

Using the remote2 node , alexa other with settings like below

All other fields can accept a msg etc , just click the 2 bars to right of field

To remove a reminder you need the notifiction id or the name(label)

1 Like

Hi,
First of all thanks for detailed response.

I tried as you suggested. It took me a while to understand it.

image

Queries

1) Everyday Reminder
How to set to Every day for example so that after creation i will just edit the existing reminder. No need to delete & recreate. Also how can i create a condition on If reminder exist than modify (Time / Msg) it else create new.

Everyday Schedule

2) Change Notification
image

3) Time format.
I only Get value such as 19:20 like this from the API. How to convert that to (TODAYS DATE) 28 Sep 2020 19:20

Thank you

1 i don't think it is possible to set a daily reminder with remote2

2 When you change the reminder if it has gone you need to turn it back on before you can change time example below, you will need to edit prayer time to your notification name.

[{"id":"baecd28e.69e348","type":"inject","z":"4484ee28.caa3c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20:34","payloadType":"str","x":230,"y":260,"wires":[["1de4ffde.6c92e"]]},{"id":"1de4ffde.6c92e","type":"moment","z":"4484ee28.caa3c","name":"","topic":"","input":"payload","inputType":"msg","inTz":"Europe/London","adjAmount":"0","adjType":"hours","adjDir":"add","format":"DD MMM YYYY HH:mm","locale":"en_UK","output":"payload","outputType":"msg","outTz":"Europe/London","x":430,"y":260,"wires":[["98f3d4dd.ca241"]]},{"id":"98f3d4dd.ca241","type":"alexa-remote-other","z":"4484ee28.caa3c","name":"","account":"c9677242.dca69","config":{"option":"changeNotification","value":{"notification":{"type":"str","value":"reminder-1601321322968"},"label":{"type":"str","value":""},"time":{"type":"msg","value":"payload"},"status":{"type":"str","value":"on"},"sound":{"type":"json","value":""}}},"x":690,"y":260,"wires":[[]]},{"id":"c9677242.dca69","type":"alexa-remote-account","z":"","name":"alexaremote2","authMethod":"proxy","proxyOwnIp":"192.168.1.25","proxyPort":"3456","cookieFile":"alexa-remote2.txt","refreshInterval":"14","alexaServiceHost":"layla.amazon.co.uk","amazonPage":"amazon.co.uk","acceptLanguage":"en-UK","userAgent":"","useWsMqtt":"on","autoInit":"off"}]

3 you can use the monments node to format your time string example above.

you can also monitor notification dismissals/updates/add

[{"id":"73e6e592.069ba4","type":"alexa-remote-event","z":"4484ee28.caa3c","name":"","account":"c9677242.dca69","event":"ws-notification-change","x":160,"y":320,"wires":[["436e526e.2c6f14"]]},{"id":"436e526e.2c6f14","type":"debug","z":"4484ee28.caa3c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":320,"wires":[]},{"id":"c9677242.dca69","type":"alexa-remote-account","z":"","name":"alexaremote2","authMethod":"proxy","proxyOwnIp":"192.168.1.25","proxyPort":"3456","cookieFile":"alexa-remote2.txt","refreshInterval":"14","alexaServiceHost":"layla.amazon.co.uk","amazonPage":"amazon.co.uk","acceptLanguage":"en-UK","userAgent":"","useWsMqtt":"on","autoInit":"off"}]
1 Like

Hi,

Thanks for your tremendous help ! REALLY ! I figured something different from the suggestion. As i wanted to keep it light and do not want to use moments.

Please check below. EVERYTHING IS WORKING FINE ! Will share this on NODE-RED for others soon. Will check this tommorow whole day !! Than will do.
Requirement :

  1. node-red-contrib-alexa-remote2
  2. node-red-contrib-cron-plus
  3. Create REMINDERS manually in alexa Fajr, Dhuhr, Asr, Maghrib, Isha, Sunrise, Sunset with everyday !
  4. API from https://aladhan.p.rapidapi.com/ Also please check FIQH as Hanafi, Shafi, etc.
    Make changes accordingly. Currently using Hanafi time. I removed my api key from below node.
  5. Configure Alexa related parameters. India related parameter is set.
  6. Configure Cornplus parameters. Already set.

I hope this will not leak my alexa related informations.

[{"id":"754099fb.6b44a8","type":"tab","label":"API request for namaz time","disabled":false,"info":""},{"id":"346354d6.45b6fc","type":"inject","z":"754099fb.6b44a8","name":"","topic":"","payload":"{\"FAJR\":\"null\",\"DHUHR\":\"\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":"","x":70,"y":120,"wires":[["43e39941.bfc0f8"]]},{"id":"d7016e5f.f961","type":"http request","z":"754099fb.6b44a8","name":"Get Prayer Times","method":"GET","ret":"obj","paytoqs":false,"url":"https://aladhan.p.rapidapi.com/timingsByCity?method=1&school=1&city=Mumbai&country=India","tls":"","persist":false,"proxy":"","authType":"","x":130,"y":200,"wires":[["937cd073.97603","da66c140.4656e","a0693fd3.45ab7"]]},{"id":"43e39941.bfc0f8","type":"function","z":"754099fb.6b44a8","name":"set payload and headers","func":"msg.payload = \"data to post\";\nmsg.headers = {};\nmsg.headers['x-rapidapi-host'] = 'aladhan.p.rapidapi.com';\nmsg.headers['x-rapidapi-key'] = '';\n\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":120,"wires":[["d7016e5f.f961"]]},{"id":"e90a72fb.e8949","type":"alexa-remote-routine","z":"754099fb.6b44a8","d":true,"name":"Fajr Time","account":"10dce7e8.4def08","routineNode":{"type":"speak","payload":{"type":"regular","text":{"type":"msg","value":"payload"},"devices":["G090XG0692320RRH"]}},"x":140,"y":540,"wires":[[]]},{"id":"937cd073.97603","type":"template","z":"754099fb.6b44a8","d":true,"name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Todays Date {{payload.data.date.readable}} and time {{payload.data.timings.Fajr}} !\nIt is time for Fajr Namaz!\n\n","output":"str","x":120,"y":340,"wires":[["e90a72fb.e8949"]]},{"id":"da66c140.4656e","type":"function","z":"754099fb.6b44a8","name":"Date Processing","func":"msg.payload.fajr = `${msg.payload.data.date.readable} ${msg.payload.data.timings.Fajr}`;\nmsg.payload.fajrmsg = \"It is time for Fajr Namaz\";\nmsg.payload.dhuhr = `${msg.payload.data.date.readable} ${msg.payload.data.timings.Dhuhr}`;\nmsg.payload.dhuhrmsg = \"It is time for dhuhr Namaz\";\nmsg.payload.asr = `${msg.payload.data.date.readable} ${msg.payload.data.timings.Asr}`;\nmsg.payload.asrmsg = \"It is time for Asr Namaz\";\nmsg.payload.maghrib = `${msg.payload.data.date.readable} ${msg.payload.data.timings.Maghrib}`;\nmsg.payload.maghribmsg = \"It is time for Maghrib Namaz\";\nmsg.payload.isha = `${msg.payload.data.date.readable} ${msg.payload.data.timings.Isha}`;\nmsg.payload.ishamsg = \"It is time for Isha Namaz\";\nmsg.payload.sunrise = `${msg.payload.data.date.readable} ${msg.payload.data.timings.Sunrise}`;\nmsg.payload.sunrisemsg = \"Good Morning! Sunrise\";\nmsg.payload.sunset = `${msg.payload.data.date.readable} ${msg.payload.data.timings.Sunset}`;\nmsg.payload.sunsetmsg = \"Good Evening! Sunset\";\nreturn msg;","outputs":1,"noerr":0,"x":360,"y":200,"wires":[["b88a1f85.532e5","1ec8e7c8.ae93f8","1a32c37f.9499fd","1ae78fa3.dc23f","9b522170.73e3","3c1f213f.431d1e","66f15e05.3939e"]]},{"id":"a0693fd3.45ab7","type":"debug","z":"754099fb.6b44a8","d":true,"name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":410,"y":500,"wires":[]},{"id":"b88a1f85.532e5","type":"alexa-remote-other","z":"754099fb.6b44a8","name":"Fajr Notification","account":"10dce7e8.4def08","config":{"option":"changeNotification","value":{"notification":{"type":"str","value":"aabb42bb-d834-4cac-ab46-7b36e27654e4"},"label":{"type":"msg","value":"payload.fajrmsg"},"time":{"type":"msg","value":"msg.payload.fajr"},"status":{"type":"str","value":"on"},"sound":{"type":"json","value":"null"}}},"x":700,"y":200,"wires":[["84e4d6b0.952998"]]},{"id":"84e4d6b0.952998","type":"debug","z":"754099fb.6b44a8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":910,"y":200,"wires":[]},{"id":"1ec8e7c8.ae93f8","type":"alexa-remote-other","z":"754099fb.6b44a8","name":"Dhuhr Notification","account":"10dce7e8.4def08","config":{"option":"changeNotification","value":{"notification":{"type":"str","value":"a1b61a10-0552-45bd-a420-176928c59110"},"label":{"type":"msg","value":"payload.dhuhrmsg"},"time":{"type":"msg","value":"payload.dhuhr"},"status":{"type":"str","value":"on"},"sound":{"type":"json","value":"null"}}},"x":710,"y":260,"wires":[["bbad1043.472b3"]]},{"id":"bbad1043.472b3","type":"debug","z":"754099fb.6b44a8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":910,"y":260,"wires":[]},{"id":"1a32c37f.9499fd","type":"alexa-remote-other","z":"754099fb.6b44a8","name":"Asr Notification","account":"10dce7e8.4def08","config":{"option":"changeNotification","value":{"notification":{"type":"str","value":"a5e51c61-7708-475a-9619-4deda64ab522"},"label":{"type":"msg","value":"payload.asrmsg"},"time":{"type":"msg","value":"payload.asr"},"status":{"type":"str","value":"on"},"sound":{"type":"json","value":"null"}}},"x":700,"y":320,"wires":[["d1aeace0.90af7"]]},{"id":"d1aeace0.90af7","type":"debug","z":"754099fb.6b44a8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":910,"y":320,"wires":[]},{"id":"1ae78fa3.dc23f","type":"alexa-remote-other","z":"754099fb.6b44a8","name":"Maghrib Notification","account":"10dce7e8.4def08","config":{"option":"changeNotification","value":{"notification":{"type":"str","value":"51462c2b-6486-4631-b4e4-a5a27c6578a5"},"label":{"type":"msg","value":"payload.maghribmsg"},"time":{"type":"msg","value":"payload.maghrib"},"status":{"type":"str","value":"on"},"sound":{"type":"json","value":"null"}}},"x":720,"y":380,"wires":[["39b225e6.bd13da"]]},{"id":"39b225e6.bd13da","type":"debug","z":"754099fb.6b44a8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":910,"y":380,"wires":[]},{"id":"9b522170.73e3","type":"alexa-remote-other","z":"754099fb.6b44a8","name":"Isha Notification","account":"10dce7e8.4def08","config":{"option":"changeNotification","value":{"notification":{"type":"str","value":"89077fd9-648e-43be-96c6-4058b5486ef0"},"label":{"type":"msg","value":"payload.ishamsg"},"time":{"type":"msg","value":"payload.isha"},"status":{"type":"str","value":"on"},"sound":{"type":"json","value":"null"}}},"x":680,"y":440,"wires":[["fff358ba.262798"]]},{"id":"fff358ba.262798","type":"debug","z":"754099fb.6b44a8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":910,"y":440,"wires":[]},{"id":"66f15e05.3939e","type":"alexa-remote-other","z":"754099fb.6b44a8","name":"Sunrise Notification","account":"10dce7e8.4def08","config":{"option":"changeNotification","value":{"notification":{"type":"str","value":"6ba4ea76-2a47-40db-9e27-611360cb5417"},"label":{"type":"msg","value":"payload.sunrisemsg"},"time":{"type":"msg","value":"payload.sunrise"},"status":{"type":"str","value":"on"},"sound":{"type":"json","value":"null"}}},"x":710,"y":120,"wires":[["c5d1b0b9.e2238"]]},{"id":"c5d1b0b9.e2238","type":"debug","z":"754099fb.6b44a8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":910,"y":120,"wires":[]},{"id":"3c1f213f.431d1e","type":"alexa-remote-other","z":"754099fb.6b44a8","name":"Sunset Notification","account":"10dce7e8.4def08","config":{"option":"changeNotification","value":{"notification":{"type":"str","value":"2c09c40a-d712-421d-bcb6-a2eae562948c"},"label":{"type":"msg","value":"payload.sunsetmsg"},"time":{"type":"msg","value":"payload.sunset"},"status":{"type":"str","value":"on"},"sound":{"type":"json","value":"null"}}},"x":690,"y":500,"wires":[["f63ef61f.e9f7e8"]]},{"id":"f63ef61f.e9f7e8","type":"debug","z":"754099fb.6b44a8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":890,"y":500,"wires":[]},{"id":"9d802aaf.a5b118","type":"cronplus","z":"754099fb.6b44a8","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"schedule1","topic":"schedule1","payloadType":"default","payload":"","expressionType":"cron","expression":"0 15 0,15 * * *","location":"","offset":"0","solarType":"selected","solarEvents":"sunrise,sunset"}],"x":80,"y":40,"wires":[["43e39941.bfc0f8","9a05bde3.dca39"]]},{"id":"9a05bde3.dca39","type":"debug","z":"754099fb.6b44a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":390,"y":40,"wires":[]},{"id":"10dce7e8.4def08","type":"alexa-remote-account","z":"","name":"Alexa","authMethod":"proxy","proxyOwnIp":"192.168.0.100","proxyPort":"3456","cookieFile":"authFile","refreshInterval":"3","alexaServiceHost":"alexa.amazon.in","amazonPage":"amazon.in","acceptLanguage":"en-IN","userAgent":"","useWsMqtt":"on","autoInit":"on"}]

Flow Published on Node-red !!! My first flow

Please suggest if there anything I should do to enhance or improve this !!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.