Hello, I wanted to share a quick and dirty setup to send TTS notifications to my alexa units (and other functions) , I am obviously glossing over the technical aspects but hopefully this is helpful, as most information online refeered to older workarounds that no longer function - this is something that I have long wanted to do and finally decided to focus on this as for some reason - the DLNA TTS media render smart app / device handler completly stopped working for me (and others)
now my gut would tell me that the cookie used in this workaround would eventually expire and this would stop working, so far itâs been humming along fine for two weeks
Requirements: web server that your ST hub can access (I have a linux server on my LAN) - no reason it canât be done with an amazon lambda function but I didnât get around to that.
Virtual HTTP Button Device Handler: [Released] Virtual HTTP Switch/Button Creator
Software to capture HTTPS sessions I am big fan of charles proxy: https://www.charlesproxy.com
login to https://alexa.amazon.com - you will find an interface comperable to whatâs in the alexa app, create a reminder on one of your alexa devices. in charles, this will show up under https://alexa.amazon.com/api/notifications/createreminder
there is an option to convert to a CURL request:
the request will look something like this:
curl -H âHost: alexa.amazon.comâ -H âAccept: application/json, text/javascript, /; q=0.01â -H âX-Requested-With: XMLHttpRequestâ -H âAccept-Language: en-usâ -H âContent-Type: application/jsonâ -H âOrigin: https://alexa.amazon.comâ -H âUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15â -H âReferer: https://alexa.amazon.com/spa/index.htmlâ -H âDNT: 1â -H 'Cookie: SUPER LONG COOKIE âPragma: no-cacheâ -H âCache-Control: no-cacheâ --data-binary â{âtypeâ:âReminderâ,âstatusâ:âONâ,âalarmTimeâ:1531697940000,âoriginalTimeâ:â19:39:00.000â,âoriginalDateâ:â2018-07-15â,âtimeZoneIdâ:null,âreminderIndexâ:null,âsoundâ:null,âdeviceSerialNumberâ:âXXXXXXXâ,âdeviceTypeâ:âXXXXXXXXXâ,ârecurringPatternâ:null,âreminderLabelâ:âtestâ,âisSaveInFlightâ:true,âidâ:âcreateReminderâ,âisRecurringâ:false,âcreatedDateâ:1531604386442}â -X PUT --compressed âhttps://alexa.amazon.com/api/notifications/createReminderâ
I have created two scripts:
Here is the one you point to with the http button via get, which I use for motion notification via SMH - for this to work I find that the reminder has to be at least a few seconds in the future for the API to accept.
#!/bin/bash
echo âContent-Type: text/html; charset=UTF-8â
echo ââ
echo ââ
echo ââ
now=$(date -d â+5 secondsâ +%H:%M:%S).000
nowday=$(date +%F)
/usr/lib/cgi-bin/set-alexa-reminder.sh â$nowâ â$nowdayâ âMotionHasBeenDetectedâ
here is set-alexa-reminder.sh - you will want to replace reminderlabel, originaltime and originaldate as below
curl -H âHost: alexa.amazon.comâ -H âAccept: application/json, text/javascript, /; q=0.01â -H âX-Requested-With: XMLHttpRequestâ -H âAccept-Language: en-usâ -H âContent-Type: application/jsonâ -H âOrigin: https://alexa.amazon.comâ -H âUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15â -H âReferer: https://alexa.amazon.com/spa/index.htmlâ -H âDNT: 1â -H âCookie: SUPER LONG COOKIEâ -H âcsrf: -XXXXXXâ -H âPragma: no-cacheâ -H âCache-Control: no-cacheâ --data-binary â{âtypeâ:âReminderâ,âstatusâ:âONâ,âalarmTimeâ:1531069800000,âoriginalTimeâ:"â$1â",âoriginalDateâ:"â$2â",âtimeZoneIdâ:null,âreminderIndexâ:null,âsoundâ:null,âdeviceSerialNumberâ:âXXXXXXâ,âdeviceTypeâ:âXXXXXXXâ,ârecurringPatternâ:null,âreminderLabelâ:"â$3â",âisSaveInFlightâ:true,âidâ:âcreateReminderâ,âisRecurringâ:false,âcreatedDateâ:1530983424221}â -X PUT --compressed âhttps://alexa.amazon.com/api/notifications/createReminderâ