Closed cibernox closed 1 year ago
You can NOT use the auto acknowledge option for the Temperature traits, this is stated in the docs, see the super script notes in the "Building Flows" section and in the "Alexa Home Response"
https://alexa-node-red.bm.hardill.me.uk/docs
You will need to craft valid responses for all incoming commands.
Thanks! I read that as commands to get the temperature not to set it. Do you happen to have an example of how that response would look like (perhaps of a local installation) or a link to some docs if not.
@hardillb I've read the docs carefully and I'm not sure what I may be missing. I constructed the msg.extra
object with the data stated in the documentation but I still get the same error from alexa.
I've also simplified my flow to the extreme to limit the number of variables
Do you see what's wrong with the msg
object I send to the response node? (Note: I've also tried temperatureMode to AUTO
)
From the docs:
temperatureMode values can be AUTO, HEAT, COOL or CUSTOM. When Custom is used then you also need to include a friendlyName.
And msg.payload
should be changed to true
Again in the docs:
For TurnOnRequest/TurnOffRequest and SetPercentageRequest, IncrementPercentageRequest, DecrementPercentageRequest requests setting the msg.payload of the input message to true/false to signify success or failure.
For SetTargetTemperatureRequest, IncrementTargetTemperatureRequest, DecrementTargetTemperatureRequest, GetTemperatureReadingRequest, GetTargetTemperatureRequest, GetLockStateRequest request you must also include a msg.extra object.
I had tried that too, with identical result:
The following works (for temps between 10 and 30 degrees C
if (msg.payload < 10 || msg.payload > 30) {
var range = {
min: 10,
max: 30
}
msg.payload = false;
msg.extra = range;
} else {
global.set("test-temp", msg.payload);
msg.extra = {
targetTemperature: {
value: msg.payload
},
applianceResponseTimestamp: new Date().toISOString(),
temperatureMode: {
value: "AUTO"
}
}
msg.payload = true;
}
return msg;
FWIW, i solved the mystery. I had two nodes for the same appliance, one with autoacknowledge and one without it. And although one of them was not connected to any other node, that was one one triggering the bad response. My response payload was correct from the the beginning.
I've modelled a smart oven using this package as if it was a thermostat with on/off capabilities.
It works remarkably well provided you accept the limitation of not being able to set modes or alarms.
When I command alexa with "Alexa, turn on/off the oven" the node emits either true or false and all seems fine. When I say "Alexa, set the oven to 220°C" the node emits a number (so far so good) but alexa complains that "Seems that oven is not responding". This is true even if the node is not connected to anything.
I have checked the auto acknowledge box. Why does it work fir on/off but not for numbers?