Since it doesn’t exist, I’m going to try to write an Alexa skill that will ask a question, wait for a yes or no response, then take action accordingly. The thing is, I want it to be modular so it can be used in any number of scenarios/flows. I think the flow looks something like this…
Node-RED triggers Alexa to say [whatever the question needs to be]
Node-RED triggers Alexa skill that listens for a yes/no response. (Anyone know if an Alexa skill can be triggered without Alexa saying anything? If she has to say something, I guess it could be “Please respond with yes or no.”)
Alexa gets her response evaluates it and does [something] if it’s yes, [something else] if no.
The [something]/[something else] needs to be something that Node-RED is watching for. Some sort of generic [AlexaYES] or [AlexaNO] marker or signal that HA is expecting to see (because Node-RED started this in step 1). Maybe it’s a one-time MQTT message… (can Alexa do that?) maybe something else, I’m not sure - this is where I really need some input. The point is, since Node-RED started the whole thing, Node-RED knows what to do with an [AlexaYES] or [AlexaNO] marker/signal/message and the flow that’s triggered is specific to the original question. I hope that’s making sense. Let me try to explain it another way…
<flow>
<question>
<AlexaResponse>
<action(s)>
</AlexaResponse>
</question>
</flow>
So the question can be almost anything. You would define it as part of the automation/flow. And the actions taken can be anything - like the question, they are specific to and exist within the context of the flow. The yes/no part (Alexa’s role in the automation) is therefor nonspecific and can be used in an infinite number of automations.
I’ll throw out an example to further clarify…
Automation For Playing Music
Home Assistant sees that someone is home and not in bed. It has been over an hour since the TV was turned off and no music has been playing for an hour.
HA triggers the Node-RED flow which triggers Alexa to say, “It’s awfully quiet around here. Would you like me to play some music?” Then triggers the AlexaYesNo custom skill.
Alexa listens for a response, evaluates the answer and puts something out that Node-RED is waiting to see.
Node-RED triggers a sequence of actions to turn on the home entertainment system and play some music (or not) based on the response.
Thoughts? Comments? Suggestions?
I tried posting this on the Home Assistant forum and got zero responses so I thought I’d try here.