Closed salusalpha closed 2 years ago
I'm not anywhere I can test this at the moment, but it looks right at first glance.
Can you post the flow you are using to make the changes?
Are you copying the input msg.payload
into the msg.extra.targetTemperature.value
field?
Here is the function node I'm using in my test setup.
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
}
}
msg.payload = true;
}
return msg;
Yes the function code I use is yours basically ->
msg.extra = {
targetTemperature: {
value: msg.payload
}
};
msg.payload = true;
return msg;
when payload is 23.5 it makes no difference
the flow is as below
I have the same problem...
I've tested it with the setup I used when it was built and it's just responding with "I'm not sure what went wrong"
This used to work and nothing has changed in the service so the only thing is I can think is that Amazon may have changed something, in which case there is nothing I can do.
I am not an expert in programming alexa skills but it could not be that Amazon no longer wants the "extra" parameter on response but something else in the json response. I found this document, could it be useful? https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-thermostatcontroller.html
That documentation is for the new version of the API so does not apply. If Amazon have changed something that has been backwardly applied to the old version of the API it will break anything still using the old API and is a bug, they have done this a couple of times in the past and eventually fixed it. (Amazon have totally removed any links to the old API documentation as far as I can tell).
This service is based on an early version of Amazon's Smart Home device API, to move it to a new version would take a total rewrite which is just not going to happen.
But as I said in the last message, I'm now back with my test kit and tests that all worked in the past now give the error.
This project is purely in maintenance mode, where only minimal changes will be made, so at this point I'm just going to wait and see if Amazon fix the old API.
@hardillb actually fixed this in #12 I think the documentation was not updated. try:
msg.extra = {
targetTemperature: {
value: msg.payload // or whatever value
},
applianceResponseTimestamp: new Date().toISOString(),
temperatureMode: {
value: "AUTO"
}
};
@hardillb actually fixed this in #12 I think the documentation was not updated. try:
msg.extra = { targetTemperature: { value: msg.payload // or whatever value }, applianceResponseTimestamp: new Date().toISOString(), temperatureMode: { value: "AUTO" } };
Worked for me also, thanks!
Original Message
Changed message and sent to "Alexa Home Response" node
Response of Alexa. "I dont know what went wrong".
It seems that the "Alexa Home Response" node is not working as expected