Ecobee - Hold Temperature Not working for me

Hi, I have everything working besides the Temperature hold. Once the temperature is adjusted down or up, it does not get updated on the ecobee with cool or heat. I have spent many hours on this and am getting no where. Any advice would be greatly appreciated.

I am running openhab 2.3 snapshot build 1242, ecobee action 1.12 snapshot, ecobee binding 1.12 snapshot.

debug mode - openhab log
2018-05-03 07:42:47.573 [DEBUG] [rest.core.internal.item.ItemResource] - Received HTTP POST request at ‘items/desiredTemp’ with value ‘72 °F’.
2018-05-03 07:42:47.578 [DEBUG] [ntime.internal.engine.RuleEngineImpl] - Executing rule ‘TempHold’
2018-05-03 07:42:47.584 [DEBUG] [ntime.internal.engine.RuleEngineImpl] - Executing rule ‘HeatHold’
2018-05-03 07:42:47.588 [INFO ] [ipse.smarthome.model.script.HeatHold] - Setting heat setpoint to 72 °F
2018-05-03 07:42:47.587 [DEBUG] [ntime.internal.engine.RuleEngineImpl] - Executing rule ‘Populate desiredTemp from desiredHeat’
2018-05-03 07:42:47.591 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘HeatHold’: Could not cast 72 °F to org.eclipse.smarthome.core.library.types.DecimalType; line 38, column 36, length 30
2018-05-03 07:42:47.746 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Checking visiblity for widget ‘Temp [%.1f °F]’.
2018-05-03 07:42:47.748 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Checking visiblity for widget ‘Heat [%.1f °F]’.
2018-05-03 07:42:47.749 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Widget Heat [%.1f °F] is not visible.
2018-05-03 07:42:47.750 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Checking visiblity for widget ‘Cool [%.1f °F]’.
2018-05-03 07:42:47.751 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Widget Cool [%.1f °F] is not visible.
2018-05-03 07:42:47.904 [DEBUG] [arthome.ui.icon.internal.IconServlet] - Requested icon category number provided by no icon provider;
2018-05-03 07:42:47.907 [DEBUG] [arthome.ui.icon.internal.IconServlet] - Requested icon category number provided by no icon provider;
2018-05-03 07:42:47.910 [DEBUG] [arthome.ui.icon.internal.IconServlet] - Requested icon category number provided by no icon provider;
2018-05-03 07:42:47.914 [DEBUG] [est.sitemap.internal.SitemapResource] - Received HTTP GET request at ‘sitemaps/house/0203’
2018-05-03 07:42:47.956 [DEBUG] [rest.core.internal.item.ItemResource] - Received HTTP POST request at ‘items/desiredTemp’ with value ‘73 °F’.
2018-05-03 07:42:47.960 [DEBUG] [ntime.internal.engine.RuleEngineImpl] - Executing rule ‘TempHold’
2018-05-03 07:42:47.965 [DEBUG] [ntime.internal.engine.RuleEngineImpl] - Executing rule ‘HeatHold’
2018-05-03 07:42:47.966 [DEBUG] [ntime.internal.engine.RuleEngineImpl] - Executing rule ‘Populate desiredTemp from desiredHeat’
2018-05-03 07:42:47.968 [INFO ] [ipse.smarthome.model.script.HeatHold] - Setting heat setpoint to 73 °F
2018-05-03 07:42:47.969 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘HeatHold’: Could not cast 73 °F to org.eclipse.smarthome.core.library.types.DecimalType; line 38, column 36, length 30
2018-05-03 07:42:48.219 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Checking visiblity for widget ‘Temp [%.1f °F]’.
2018-05-03 07:42:48.221 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Checking visiblity for widget ‘Heat [%.1f °F]’.
2018-05-03 07:42:48.222 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Widget Heat [%.1f °F] is not visible.
2018-05-03 07:42:48.223 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Checking visiblity for widget ‘Cool [%.1f °F]’.
2018-05-03 07:42:48.224 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Widget Cool [%.1f °F] is not visible.
2018-05-03 07:42:48.380 [DEBUG] [arthome.ui.icon.internal.IconServlet] - Requested icon category number provided by no icon provider;
2018-05-03 07:42:48.384 [DEBUG] [arthome.ui.icon.internal.IconServlet] - Requested icon category number provided by no icon provider;
2018-05-03 07:42:48.389 [DEBUG] [arthome.ui.icon.internal.IconServlet] - Requested icon category number provided by no icon provider;
2018-05-03 07:42:48.396 [DEBUG] [est.sitemap.internal.SitemapResource] - Received HTTP GET request at ‘sitemaps/house/0203’
2018-05-03 07:42:49.903 [DEBUG] [basic.internal.servlet.WebAppServlet] - Servlet request received!
2018-05-03 07:42:49.904 [DEBUG] [basic.internal.servlet.WebAppServlet] - reading sitemap house
2018-05-03 07:42:49.907 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Checking visiblity for widget ‘Temp [%.1f °F]’.
2018-05-03 07:42:49.909 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Checking visiblity for widget ‘Heat [%.1f °F]’.
2018-05-03 07:42:49.910 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Widget Heat [%.1f °F] is not visible.
2018-05-03 07:42:49.912 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Checking visiblity for widget ‘Cool [%.1f °F]’.
2018-05-03 07:42:49.913 [DEBUG] [ui.internal.items.ItemUIRegistryImpl] - Widget Cool [%.1f °F] is not visible.
2018-05-03 07:42:50.124 [DEBUG] [arthome.ui.icon.internal.IconServlet] - Requested icon category number provided by no icon provider;
2018-05-03 07:42:50.134 [DEBUG] [arthome.ui.icon.internal.IconServlet] - Requested icon category number provided by no icon provider;
2018-05-03 07:42:50.141 [DEBUG] [arthome.ui.icon.internal.IconServlet] - Requested icon category number provided by no icon provider;
2018-05-03 07:42:50.141 [DEBUG] [arthome.ui.icon.internal.IconServlet] - Requested icon category number provided by no icon provider;

Number actualTemperature "actual temp [%.1f °F]" {ecobee="<[3XXXXXXXXXXX#runtime.actualTemperature]"}
Number actualHumidity "actual hum [%d %%]" {ecobee="<[3XXXXXXXXXXX#runtime.actualHumidity]"}
String hvacMode "hvac Mode [%s]"            { ecobee="=[3XXXXXXXXXXX#settings.hvacMode]" }
String currentClimateRef "sched comf [%s]"  { ecobee="<[3XXXXXXXXXXX#program.currentClimateRef]" }
String desiredComf "desired comf"           { ecobee="<[3XXXXXXXXXXX#runningEvent.holdClimateRef]", autoupdate="false" }
Number desiredTemp "desired temp [%.1f °F]"
Number desiredHeat "desired heat [%.1f °F]" { ecobee="<[3XXXXXXXXXXX#runtime.desiredHeat]" }
Number desiredCool "desired cool [%.1f °F]" { ecobee="<[3XXXXXXXXXXX#runtime.desiredCool]" }
String desiredFan  "desired fan mode [%s]" { ecobee="<[3XXXXXXXXXXX#runtime.desiredFanMode]" }

Group item=gTemp label="Temperature" icon="temperature" {
                  Frame label="Thermostat" {
                        Text item=actualTemperature label="Actual Temperature"
                        Text item=actualHumidity label="Inside Humidity"
                        Switch item=hvacMode label="HVAC Mode" mappings=[heat=Heat,cool=Cool,auto=Auto,off=Off]
                        Text item=currentClimateRef
                        Switch item=desiredComf mappings=[sleep=Sleep,wakeup=Wake,home=Home,away=Away,smart6=Gym,resume=Resume]
                        Setpoint item=desiredTemp label="Temp [%.1f °F]" minValue=50 maxValue=80 step=1 visibility=[hvacMode==heat,hvacMode==cool]
                        Setpoint item=desiredHeat label="Heat [%.1f °F]" minValue=50 maxValue=80 step=1 visibility=[hvacMode==auto]
                        Setpoint item=desiredCool label="Cool [%.1f °F]" minValue=50 maxValue=80 step=1 visibility=[hvacMode==auto]
                        Switch item=desiredFan mappings=[on=On,auto=Auto]
                                           }



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

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

rule TempHold
when
    Item desiredTemp received command
then
    switch hvacMode.state.toString {
        case "heat" : desiredHeat.sendCommand(receivedCommand)
        case "cool" : desiredCool.sendCommand(receivedCommand)
        case "auto" : logWarn("TempHold", "in auto mode, single setpoint ignored")
        case "off"  : logWarn("TempHold", "in off mode, single setpoint ignored")
 }
end

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

ecobeeSetHold("3XXXXXXXXXXX", desiredCoolTemp, desiredHeatTemp, null, null, null, null, null)
end

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

ecobeeSetHold("3XXXXXXXXXXX", desiredCoolTemp, desiredHeatTemp, null, null, null, null, null)
end

rule FanHold
when
    Item desiredFan received command
then
    logInfo("FanHold", "Setting fan hold to " + receivedCommand.toString)
    val params = newLinkedHashMap(
   'isTemperatureAbsolute'-> false,
   'isTemperatureRelative' -> false,
   'isCoolOff' -> true,
   'isHeatOff' -> true,
   'coolHoldTemp' -> 90,
   'heatHoldTemp' -> 50,
   'fan' -> receivedCommand.toString)
 ecobeeSetHold("3XXXXXXXXXXX", params, null, null, null, null)
end

rule ComfortHold
when
   Item desiredComf received command
then
   if (receivedCommand.toString.equals("resume")) {
ecobeeResumeProgram("3XXXXXXXXXXX", true)
   } else {
   ecobeeSetHold("3XXXXXXXXXXX", null, null, receivedCommand.toString, null, null, null, null)
          }
end

Hello, can you change your post using code fences, please?

I am not that good with rules, so I won’t even try debugging your code. (I am able to get setHold to work with my ecobee)

However, I would suggest creating a very simple rule to test the setHold. For instance, I might use the following cron to trigger the setHold at 7pm on Sunday to see if that works…

var DecimalType desiredHeatTemp
var DecimalType desiredCoolTemp

`rule “Test setHold”
when
Time cron “0 0 19 ? * SUN *”

then
desiredCoolTemp = new DecimalType(75)
desiredHeatTemp = new DecimalType(68)
ecobeeSetHold(“3xxxxxxxxxxx”, desiredCoolTemp, desiredHeatTemp, null, null, null, null, null)
end`

I am able to get a hold with the simple hold rule you mentioned. So that is good…

Do you mind sharing what you have for a rule for your ecobee hold?

I believe the error I am having troubles with is
2018-05-03 07:42:47.969 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘HeatHold’: Could not cast 73 °F to org.eclipse.smarthome.core.library.types.DecimalType; line 38, column 36, length 30

Good to know your Hold Temp is working. Again, I’m not great with rule coding. However, your code “receivedCommand as DecimalType” seems odd to me.

The simple rule I posted is almost exactly the rule I’m using. The only differences are…

  1. The cron command triggers at 6am daily.
  2. I have an “if” statement (after “then”) to check the forcasted high outdoor temp.
    if (OutdoorTemperatureMax.state > 85)

I call this rule “Morning Cooling Boost” and is used to cool off my upstairs at 6am if it’s predicted to be hot that day.

Thanks for your example, I’m trying to just input a setpoint into your code that actually works.

All the sitemap, items, rules are what is written for the openhab/ecobee binding.
[https://docs.openhab.org/addons/bindings/ecobee1/readme.html]
I’m surprised no one else is having the same problem since this is what the site has for an example…

David,
Thanks for that link. Things are much clearer for me now. Maybe that code used to work before Openhab made some upgrades?

Anyway, what you are trying to do and what my code does - are different. (I am not trying to get the setpoint from anywhere, rather hardcoding the setpoints in my rule)

Now that I understand what you are trying to do, I may play around tonight and see if I can get it to work.

Mike M.

Hi Mike,
Everything is works besides changing the desired temperature from the setpoint switch. It does the same thing even if you switch it to cool and change the desired temperature.

This is what it I’m going for…

Hi David,
I was able to set the desired cool temp with this rule… (note that I hard coded the desired warm to 55) Hope this helps. -Mike

when
  Item desiredCool received command
then
  ecobeeSetHold("3xxxxxxxxxxxx", desiredCool.state, 55, null, null, null, null, null)
end`

Hi Mike,

Your rule was not working for me either so I thought I must have messed something up…
I was always testing on the computer with google chrome with basic ui which is the problem. Everything works fine with the android or apple app.
So IE doesnt load too great and chrome doesnt provide the correct setpoint data.

Thanks for all your help getting me on the right path Mike.