tcgerhard
(tcgerhard)
December 24, 2022, 3:34am
1
I’m currently running 3.3.0, and trying to use actions from the Ecobee binding in a JS Script rule
From the Ecobee Binding documentation I am trying to use the DSL rule snippet as an example
val ecobeeActions = getActions("ecobee","ecobee:thermostat:account:103778713388")
ecobeeActions.setHold(UserCool.state as QuantityType, UserHeat.state as QuantityType)
I’ve tried a few approaches, but none with success, i.e.,
ecobeeActions = actions.getActions("ecobee", "ecobee:thermostat:account:7ef17a99ff");
and
ecobeeActions = getActions("ecobee", "ecobee:thermostat:account:7ef17a99ff");
I’m sure I’m missing something basic, but I’ve searched every which way on this forum and in the docs, but haven’t found the missing link
1 Like
ssalonen
(Ssalonen)
December 24, 2022, 6:24am
2
1 Like
tcgerhard
(tcgerhard)
December 26, 2022, 2:26am
3
Thank you. I’ve been down the first two and keep hitting dead ends, but the Pushover example got me over the finish line.
tcgerhard
(tcgerhard)
December 26, 2022, 2:31am
4
Thanks to a lead from ssalonen, I was able to verify that actions.thingActions
is the key that I needed.
Including my test snippet in case someone else stumbles across this post in a seach result.
ecobeeActions = actions.thingActions("ecobee", "ecobee:thermostat:account:id");
var climates = ecobeeActions.getClimates()
// console.log("climate = " + climates);
if (climates !== null) {
climates = JSON.parse(climates);
var numElements = climates.length;
console.log("Climates: There are ", numElements, " climates in array");
console.log(JSON.stringify(climates[numElements-1]));
for (var i=0; i < numElements; i++) {
climateSettings = climates[i];
console.log("Climate ", i, " Name: " + climateSettings.name, " Ref: ", climateSettings.climateRef, " Heat: ", (climateSettings.heatTemp/10.0));
}
ecobeeActions.setHold("smart1");
} else {
console.log("ecobee", "Climates: No climates!!!")
}