Ecobee permissions?

I had Ecobee connected and working great in OH. However, ecobee died. :frowning: Thankfully support was great and they sent me a brand new unit (a v5)

Ran through the instructions again to get binding authorized, everything worked (so I thought).

On ecobee developer page it says:

You have added the following application that can access your ecobee
SOpenHab
This application requires the following permissions:

  • View and change data and settings on your ecobee thermostat(s)
    connected to habpanel

So everything looks good. I update the items file to represent the new thermostat id. And Habpanel populates nicely.

However when I try making any changes through the web interface I see the following in the log:
2020-02-07 15:07:54.889 [ome.event.ItemCommandEvent] - Item ‘ET_runningEvent_climate’ received command resume

==> /var/log/openhab2/openhab.log <==

2020-02-07 15:07:55.112 [ERROR] [inding.ecobee.internal.EcobeeBinding] - Error calling function: ApiResponse[status=Status[code=9,message=Invalid selection. No thermostats in selection. Ensure permissions and selection.]]

==> /var/log/openhab2/events.log <==

2020-02-07 15:07:55.123 [vent.ItemStateChangedEvent] - ET_runningEvent_Type changed from hold to resume

2020-02-07 15:07:59.799 [ome.event.ItemCommandEvent] - Item 'ET_userHeat' received command 25

2020-02-07 15:07:59.810 [vent.ItemStateChangedEvent] - ET_userHeat changed from 23 to 25

2020-02-07 15:07:59.839 [ome.event.ItemCommandEvent] - Item 'ET_runtime_desiredHeat' received command 25

2020-02-07 15:07:59.847 [vent.ItemStateChangedEvent] - ET_runtime_desiredHeat changed from 23.5 to 25

==> /var/log/openhab2/openhab.log <==

2020-02-07 15:07:59.865 [INFO ] [ipse.smarthome.model.script.HeatHold] - Setting heat setpoint to 25

==> /var/log/openhab2/events.log <==

2020-02-07 15:07:59.901 [vent.ItemStateChangedEvent] - desiredTemp changed from 23.5 to 25

==> /var/log/openhab2/openhab.log <==

2020-02-07 15:08:00.025 [ERROR] [inding.ecobee.internal.EcobeeBinding] - Error calling function: ApiResponse[status=Status[code=9,message=Invalid selection. No thermostats in selection. Ensure permissions and selection.]]

Any help would be appreciated.

Items file for reference:

Group ET_All
Group ET_gSettings (ET_All)
Group ET_gRemoteSensors (ET_All)
String ET_name { ecobee=“=[1234567890#name]” }

String ET_settings_hvacMode “hvac mode [%s]” (ET_gSettings) { ecobee=“=[1234567890#settings.hvacMode]” }
Switch ET_settings_useCelsius (ET_gSettings) { ecobee=“=[1234567890#settings.useCelsius]” }
Number ET_settings_heatRangeHigh (ET_gSettings) { ecobee=“=[1234567890#settings.heatRangeHigh]” }
Number ET_settings_heatRangeLow (ET_gSettings) { ecobee=“=[1234567890#settings.heatRangeLow]” }
Number ET_settings_coolRangeHigh (ET_gSettings) { ecobee=“=[1234567890#settings.coolRangeHigh]” }
Number ET_settings_coolRangeLow (ET_gSettings) { ecobee=“=[1234567890#settings.coolRangeLow]” }

Group ET_gRuntime (ET_All)
Number ET_runtime_actualTemperature “actual Temperature [%.1f °C]” (ET_gRuntime) { ecobee=“<[1234567890#runtime.actualTemperature]” }
Number ET_runtime_actualHumidity “actual humidity [%d %%]” (ET_gRuntime) { ecobee=“<[1234567890#runtime.actualHumidity]” }
Number ET_runtime_desiredHeat “desired Heat [%.1f °C]” (ET_gRuntime) { ecobee=“<[1234567890#runtime.desiredHeat]” }
Number ET_runtime_desiredCool “desired Cool [%.1f °C]” (ET_gRuntime) { ecobee=“<[1234567890#runtime.desiredCool]” }

// ** Remote sensor setup**
// You MUST update the item’s binding config to match the name you set for the sensor under
// {ecobee=“<[1234567890#remoteSensors().capability().value]”}
// The first item should be set to your thermostat’s name (mine is called “Downstairs”)
// The temperature item’s text will appear in the widget, update accordingly! (with units if you want)
//
// The first two items ET_mainThermostat_ represent the main thermostats real temperatue and occupancy
// then come the remote sensors ET_Remote_*
// Add or remove as many pairs of temperature and occupancy items under ET_gRemoteSensors as you need

//First item in sensor list is the real thermostat
Number ET_mainThermostat_temperature “Hallway [%.1f °C]” (ET_gRemoteSensors) { ecobee=“<[1234567890#remoteSensors(EcoBee).capability(temperature).value]” }
Switch ET_mainThermostat_occupancy “” (ET_gRemoteSensors) { ecobee=“<[1234567890#remoteSensors(EcoBee).capability(occupancy).value]” }
//Remote sensor Bedroom
Number ET_Remote_1_temperature “Bedroom [%.1f °C]” (ET_gRemoteSensors) { ecobee=“<[1234567890#remoteSensors(Bedroom).capability(temperature).value]” }
Switch ET_Remote_1_occupancy “” (ET_gRemoteSensors) { ecobee=“<[1234567890#remoteSensors(Bedroom).capability(occupancy).value]” }
//Remote sensor 2
Number ET_Remote_2_temperature “Office [%.1f °C]” (ET_gRemoteSensors) { ecobee=“<[1234567890#remoteSensors(Office).capability(temperature).value]” }
Switch ET_Remote_2_occupancy “” (ET_gRemoteSensors) { ecobee=“<[1234567890#remoteSensors(Office).capability(occupancy).value]” }
//Remote sensor 3
//Number ET_Remote_3_temperature “Parents’ Room [%.1f °C]” (ET_gRemoteSensors) { ecobee=“<[1234567890#remoteSensors(Bedroom).capability(temperature).value]” }
//Switch ET_Remote_3_occupancy “” (ET_gRemoteSensors) { ecobee=“<[1234567890#remoteSensors(Bedroom).capability(occupancy).value]” }

Group ET_gEvents (ET_All)
String ET_runningEvent_Type (ET_gEvents) { ecobee=“<[1234567890#runningEvent.type]” }
String ET_runningEvent_climate (ET_gEvents) { ecobee=“<[1234567890#runningEvent.holdClimateRef]”, autoupdate=“false” }
String ET_runningEvent_name “Running event name [%s]” (ET_gEvents) { ecobee=“<[1234567890#runningEvent.name]” }

//String ET_runningEvent_Type (ET_gEvents) { ecobee=“<[1234567890#runningEvent.type]” }
//String ET_runningEvent_climate “desired comf” (ET_gEvents) { ecobee=“<[1234567890#runningEvent.holdClimateRef]”, autoupdate=“false” }
String currentClimateRef “sched comf [%s]” { ecobee=“<[1234567890#program.currentClimateRef]” }
Number desiredTemp “desired temp [%.1f °C]” { ecobee=“<[1234567890#runtime.actualTemperature]” }
Number desiredHeat “desired heat [%.1f °C]” { ecobee=“<[1234567890#runtime.desiredHeat]” }
Number desiredCool “desired cool [%.1f °C]” { ecobee=“<[1234567890#runtime.desiredCool]” }
String desiredFan “desired fan mode [%s]” { ecobee=“<[1234567890#runtime.desiredFanMode]” }

//custom rule populated items
Number ET_userCool (ET_All)
Number ET_userHeat (ET_All)

When you say “web interface”, what are you referring to – the openHAB web interface, or the Ecobee web portal?

And when you say “any changes”, do you really mean any changes? Or, are there certain things you’re doing that’s causing the behavior?

Something is sending a command (“resume”) to the ET_runningEvent_climate String item. Are you sure there’s not a rule doing this? To the best of my knowledge, “resume” isn’t one of the default Ecobee climateRefs (defaults are away, home, and sleep, IIRC). Unless you created a climateRef named “resume”, this has to be coming from openHAB – most likely a rule. It’s also likely that a rule is causing this, since in the Ecobee 1 binding, functions are implemented as thing actions, and are invoked from rules.

Transactions to the Ecobee API must contain a “Selection” object. Among other things, the Selection object contains a list of thermostat ids for which the transaction is intended. This error is saying that the Ecobee “function” API call contains a Selection object that contains no thermostat ids. Ecobee “functions” are things like setHold, sendMessage, createVacation, resumeProgram, etc.

You could try putting the binding into DEBUG mode. Perhaps it will give a better indication of what’s going on.

Also wondering if you’ve tried an openHAB restart. After authorizing the new thermostat.

Sorry for not being clear. Any changes made in Ecobee’s webpage reflect in openhab/habpanel quickly.

When I make adjustments in Habpanel (ie. changing temperature), I see the following in openhab logs:

2020-02-07 15:48:22.922 [vent.ItemStateChangedEvent] - desiredTemp changed from 23.5 to 19.5
2020-02-07 15:48:22.950 [vent.ItemStateChangedEvent] - ET_userHeat changed from 19.5 to 19

==> /var/log/openhab2/openhab.log <==

2020-02-07 15:48:23.070 [ERROR] [inding.ecobee.internal.EcobeeBinding] - Error calling function: ApiResponse[status=Status[code=9,message=Invalid selection. No thermostats in selection. Ensure permissions and selection.]]

I’m using the widget, rules, items from post by RedOranges: Ecobee Thermostat (fork off @Singal11)

I’m 99% sure rules file is identical, items file was edited slightly to add extra sensors.

rules file:

//////////////////////////////////////////
// !! Change this (ecobeeID) to match your own ecobee id
//////////////////////////////////////////
var String ecobeeID = “511887266499”
rule “Populate userHeat from desiredHeat”
when
Item ET_runtime_desiredHeat received update
then
if ( ((ET_settings_hvacMode.state.toString == “heat”)
|| (ET_settings_hvacMode.state.toString == “auto”))
&& ET_runtime_desiredHeat.state instanceof DecimalType)
{
var Number rounded = ET_runtime_desiredHeat.state as DecimalType
rounded = rounded * 2
rounded = Math::round(rounded.floatValue) / 2
ET_userHeat.postUpdate(rounded)
}
end

rule “Populate userCool from desiredCool”
when
Item ET_runtime_desiredCool received update
then
if ( ((ET_settings_hvacMode.state.toString == “cool”)
|| (ET_settings_hvacMode.state.toString == “auto”))
&& ET_runtime_desiredCool.state instanceof DecimalType)
{
var Number rounded = ET_runtime_desiredCool.state as DecimalType
rounded = rounded * 2
rounded = Math::round(rounded.floatValue) / 2
ET_userCool.postUpdate(rounded)
}
end

rule UserHeatHold
when
Item ET_userHeat received command
then
switch ET_settings_hvacMode.state.toString {
case “heat” : ET_runtime_desiredHeat.sendCommand(receivedCommand)
case “auto” : ET_runtime_desiredHeat.sendCommand(receivedCommand)
case “cool” : logWarn(“UserHeatHold”, “in cool mode, heat setpoint ignored”)
case “off” : logWarn(“UserHeatHold”, “in off mode, heat setpoint ignored”)
}
end

rule UserCoolHold
when
Item ET_userCool received command
then
switch ET_settings_hvacMode.state.toString {
case “cool” : ET_runtime_desiredCool.sendCommand(receivedCommand)
case “auto” : ET_runtime_desiredCool.sendCommand(receivedCommand)
case “heat” : logWarn(“UserCoolHold”, “in heat mode, cool setpoint ignored”)
case “off” : logWarn(“UserCoolHold”, “in off mode, heat setpoint ignored”)
}
end

rule HeatHold
when
Item ET_runtime_desiredHeat received command
then
logInfo(“HeatHold”, "Setting heat setpoint to " + receivedCommand.toString)
val DecimalType desiredHeatTemp = receivedCommand as DecimalType
var DecimalType desiredCoolTemp
if (ET_runtime_desiredCool.state instanceof DecimalType) {
desiredCoolTemp = ET_runtime_desiredCool.state as DecimalType
} else {
desiredCoolTemp = new DecimalType(28)
}

// the 1.9 onwards action bundle uses a selection string instead of an item as the first parameter
ecobeeSetHold(ecobeeID, desiredCoolTemp, desiredHeatTemp, null, null, null, null, null)
end

rule CoolHold
when
Item ET_runtime_desiredCool received command
then
logInfo(“CoolHold”, "Setting cool setpoint to " + receivedCommand.toString)
val DecimalType desiredCoolTemp = receivedCommand as DecimalType
var DecimalType desiredHeatTemp
if (ET_runtime_desiredHeat.state instanceof DecimalType) {
desiredHeatTemp = ET_runtime_desiredHeat.state as DecimalType
} else {
desiredHeatTemp = new DecimalType(18)
}

// the 1.9 onwards action bundle uses a selection string instead of an item as the first parameter
ecobeeSetHold(ecobeeID, desiredCoolTemp, desiredHeatTemp, null, null, null, null, null)
end

rule ComfortHold
when
Item ET_runningEvent_climate received command
then
if (receivedCommand.toString.equals(“resume”)) {
// the 1.9 onwards action bundle uses a selection string instead of an item as the first parameter
ecobeeResumeProgram(ecobeeID, true)
ET_runningEvent_Type.postUpdate(receivedCommand.toString)
} else {
// the 1.9 onwards action bundle uses a selection string instead of an item as the first parameter
ecobeeSetHold(ecobeeID, null, null, receivedCommand.toString, null, null, null, null)
}
end

rule “Populate desiredTemp from desiredHeat”
when
Item ET_runtime_desiredHeat received update
then
if (ET_settings_hvacMode.state.toString == “heat” && ET_runtime_desiredHeat.state instanceof DecimalType) {
desiredTemp.postUpdate(ET_runtime_desiredHeat.state)
}
end

rule “Populate desiredTemp from desiredCool”
when
Item ET_runtime_desiredCool received update
then
if (ET_settings_hvacMode.state.toString == “cool” && ET_runtime_desiredCool.state instanceof DecimalType) {
desiredTemp.postUpdate(ET_runtime_desiredCool.state)
}
end

and you are right I shouldn’t say any. Adjusting temperature, or canceling the holding temperature cause that error. Changing from heating to Auto and vice versa was sent to ecobee.

I restarted OH, I have not tried putting a binding into debug mode. Will research and provide feedback.

Hi,

Did you set ecobeeID in Ecobee Thermostat.widget.rules correctly?

It looks as though maybe only the functions that used the rules are failing

1 Like

You are completely correct, it was right under the comments and I completely missed it!

Thank you both for your help!

@RedOranges, can I ask 1 additional question. In the widget, my sensors if in the seperate menu work perfectly, however if they are in the main menu they are missing some information. Have you seen this before?

Hmm, no i haven’t noticed before since I use the latter myself, but I can reproduce it now.
I’ll take a look.

Thanks for letting me know.

Sorry it took a little while but I think I fixed the sensor issue on the main page.

Let me know if it works for you now.

I selected update on the widget config and now all the sensors show up correctly. Thanks for the update!