Help with variable in Node Red

OH MY GAWD! SUCH a rookie mistake!
Custom routine was - msg.payload.value
removed value and she TALKED ... she actually TALKED!
Thanks @morningz for the help!

One more question, what is the syntax to list more than one device, but not all devices?

1 Like

“devices”: [ “device 1”, “device 2” ]

1 Like

I actually managed to work that one out after fiddling with it. Thanks! You guys are the tops.

2 Likes

I am struggling getting this to work. I keep getting an error

image

It looks like the message is formatted correctly as far as I know in the Beta Debug Node but I am getting undefined error.

image

Here is my function node:
image

and my Routine Edit

image

Any help would be appreciated. thanx.

I don't know what the format for Alexa is supposed to be, but I do note that you have msg.payload.payload , which is odd. May be correct, but that jumped out at me.

This is the format in the documentation.

From looking at previous posts, I think I am doing nested payloads like @morningz's post #8 in this thread.

1 Like

Ah, good point. That's what I get for mot looking it up. :slight_smile:

@stephen_nutt this works fine for me, just tested it

return {
    "payload": {
        "type": "music",
        "payload": {
            "provider": "AMAZON_MUSIC",
            "search": "Moby",
            "device": "G0918309652387U4"
        }
    }
};

The device value is the serial number of one of my devices (but not really lol)

additionally:

"provider": "Pandora", -> invalid routine

BUT

"provider": "PANDORA" -> works just fine

The doc for sure implies that the value must be in CAPS

3 Likes

IT WAS THE DANG CAPITALIZATION!!!!!!!! I notice that now in the Information Window. I wish that it was consistent with the Edit Node.

image

Thank you thank you.

I created a dashboard to control Alexa Music so I can do it without talking that has a slider to specify which Echo to send the Play Music command. The currently playing category is highlighted in blue. Now it's working!!

6 Likes

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