How to access binding actions with JS Scripting

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");


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

With jsscripting: JavaScript Scripting - Automation | openHAB

More details here actions - Documentation

Example here Pushover notifications from JavaScript rules - #2 by rlkoshak

1 Like

Thank you. I’ve been down the first two and keep hitting dead ends, but the Pushover example got me over the finish line.

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");

    for (var i=0; i < numElements; i++) {
        climateSettings = climates[i];
        console.log("Climate ", i, " Name: " +, " Ref: ", climateSettings.climateRef, " Heat: ",  (climateSettings.heatTemp/10.0));
} else {
    console.log("ecobee", "Climates: No climates!!!")