Solved: Alexa Notify: Announce Syntax?

Does anyone have a working json function to use the notify service?

I had it working, but the latest update changed the syntax, and I cannot figure it out.

this is what i have;

[{"id":"d1fc4a70.6af5d8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"c560d74b.fc9b28","type":"server-state-changed","z":"d1fc4a70.6af5d8","name":"Basement Motion","server":"2a12269e.94634a","entityidfilter":"binary_sensor.basement_motion","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"x":140,"y":220,"wires":[["54cb80f0.7eea9"],[]]},{"id":"d63f9b85.6fd9e8","type":"server-state-changed","z":"d1fc4a70.6af5d8","name":"Kitchen Motion","server":"2a12269e.94634a","version":0,"entityidfilter":"binary_sensor.kitchen_motion","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"x":130,"y":340,"wires":[["6dbe9009.ad3c3"],[]]},{"id":"f51dd1cc.900b6","type":"server-state-changed","z":"d1fc4a70.6af5d8","name":"Master Motion","server":"2a12269e.94634a","entityidfilter":"binary_sensor.master_motion","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"x":130,"y":280,"wires":[["39788870.c737d8"],[]]},{"id":"54cb80f0.7eea9","type":"throttle","z":"d1fc4a70.6af5d8","name":"Limit","throttleType":"time","timeLimit":"10","timeLimitType":"minutes","countLimit":"10","blockSize":0,"locked":false,"x":300,"y":220,"wires":[["c7bb356e.da4ea8"]]},{"id":"2421890c.caf016","type":"api-call-service","z":"d1fc4a70.6af5d8","name":"House","server":"2a12269e.94634a","service_domain":"notify","service":"alexa_media_paul_s_ecobee4","data":"{\"entity_id\":\"media_player.basement\",\"message\":\"{{payload}}\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1200,"y":360,"wires":[[]]},{"id":"c7bb356e.da4ea8","type":"function","z":"d1fc4a70.6af5d8","name":"Storeit","func":"flow.set('friendlyname',msg.data.new_state.attributes.friendly_name);\nreturn msg;","outputs":1,"noerr":0,"x":500,"y":300,"wires":[["51338166.01667"]]},{"id":"51338166.01667","type":"api-current-state","z":"d1fc4a70.6af5d8","name":"Motion Announcements On?","server":"2a12269e.94634a","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.motion_notificaitons","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":730,"y":360,"wires":[["504b518e.37125"],[]]},{"id":"504b518e.37125","type":"function","z":"d1fc4a70.6af5d8","name":"Construct Notifications","func":"var m = flow.get('friendlyname');\n\nreturn {\n        \"payload\": {\n           \"data\": {\n               \"message\": m,\n               \"data\": {\n                 \"type\": \"announce\",\n                 \"method\": \"all\"\n               }\n           } \n    }\n};","outputs":1,"noerr":0,"x":1010,"y":360,"wires":[["2421890c.caf016"]]},{"id":"39788870.c737d8","type":"throttle","z":"d1fc4a70.6af5d8","name":"Limit","throttleType":"time","timeLimit":"10","timeLimitType":"minutes","countLimit":"10","blockSize":0,"locked":false,"x":320,"y":280,"wires":[["c7bb356e.da4ea8"]]},{"id":"6dbe9009.ad3c3","type":"throttle","z":"d1fc4a70.6af5d8","name":"Limit","throttleType":"time","timeLimit":"10","timeLimitType":"minutes","countLimit":"10","blockSize":0,"locked":false,"x":320,"y":340,"wires":[["c7bb356e.da4ea8"]]},{"id":"d0b10509.1dbd08","type":"throttle","z":"d1fc4a70.6af5d8","name":"Limit","throttleType":"time","timeLimit":"10","timeLimitType":"minutes","countLimit":"10","blockSize":0,"locked":false,"x":320,"y":400,"wires":[["c7bb356e.da4ea8"]]},{"id":"46658df7.8e26f4","type":"server-state-changed","z":"d1fc4a70.6af5d8","name":"Garage Motion","server":"2a12269e.94634a","version":1,"entityidfilter":"binary_sensor.garage_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":100,"y":400,"wires":[["d0b10509.1dbd08"],[]]},{"id":"2a12269e.94634a","type":"server","z":"","name":"Home Assistant1","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

Let me add to see if this helps you help me.

Old function and service call that used to work:

***FUNCTION***
var m = flow.get('friendlyname');

return {
        "payload": {
           "data": {
               "message": m + "was opened"
           } 
    }
};

2019-07-12_10-20-16

See this here

Perfect; Thanks! (i did search :slight_smile: )