Node-Red Newbie.. having problem with simple notification flow

I am trying to create a simple flow that announces to my Echo Dot (via the notify.alexa_media service) from the Alexa custom component. I made it as simple as possible to test, but am getting errors in the API call. Anyone have any ideas? I’ve made a few success basic flows.

[{"id":"ef6263901b865742","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"d13e37dd21f450c6","type":"api-call-service","z":"ef6263901b865742","name":"Porch Light On","server":"6d33c0bc52cec372","version":3,"debugenabled":true,"service_domain":"notify","service":"alexa_media","entityId":"media_player.echo_dot_front_office","data":"{\"message\":\"The Porch Light is On\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":600,"y":100,"wires":[[]]},{"id":"093363a0efc59d15","type":"server-state-changed","z":"ef6263901b865742","name":"","server":"6d33c0bc52cec372","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"light.front_porch","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":190,"y":100,"wires":[["d13e37dd21f450c6"],[]]},{"id":"6d33c0bc52cec372","type":"server","name":"Home Assistant","version":2,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]

I get the following error:

image

I don’t use Alexa myself but it looks correct to me.
How would you tts from HA? In the developer tools → services, what yaml would you use there?

Can you connect a debug with complete message setting to the state changed node? What does it give you?

AFAIK you need to specify the device already in the service.

You can try to use for the service:

alexa_media_echo_dot_front_office and leave the Entity ID blank

I prefer to use: node-red-contrib-alexa-cakebaked

Select your device in the service box and leave the entity box blank.
Then you need data in your JSON.
It will be like this but this possibly isn’t exactly right as I’ve typed it on my phone I can copy it over later if you need to.

{
   "message" : "your message".
   "data" : {
          "type" : "tts"
    }
}

That’s what I had wrong. It looks like it works two, slightly different, ways:

image

or, just using alexa_media as the service,

image

and setting the target in the JSON data:

type{
    "message": "This is a test",
    "target": "media_player.echo_dot_front_office",
    "data": {
        "type": "tts"
    }
} 

I think the former probably is preferrred.

Thanks you!

1 Like