How To Set Ecobee "Away and Hold"

Thanks mhilbush, the name of my ecobee binding is Ecobee Binding. This didn’t seem right which sent me looking for more examples and I found this one which is supposed to work. The script looks completely different. When I tried it I got the same error. I tried adding var in front of the first line with no change. So why is the error saying that actions.thingactions is not a function? Isn’t that a valid function for a ECMAScript?

New script:

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

I just realized that this other script is also from tcgerhard. Interesting that it’s so different. The thread I found is here:
https://community.openhab.org/t/how-to-access-binding-actions-with-js-scripting/142456/2