In yet another Ecobee/auto rule, I am trying to implement my own auto function because our master bedroom Ecobee also controls the nursery temperature and we keep the AC/Heat setpoints too close to use the built-in auto functionality. So my thought was to switch to heat if, in cool mode, the temperature drops more than 2 degrees below the heat setpoint. Likewise, the rule will switch to cool mode if, in heat mode, the temperature rises more than 2 degrees above the A/C set point.
Unfortunately, I’m getting the following error in my if/then statement:
2016-04-21 07:10:17.802 [ERROR] [o.o.c.s.ScriptExecutionThread ] - Error during the execution of rule ‘Upstairs HVAC Auto Controller’: Could not invoke method: org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_plus(java.lang.Object,java.lang.String) on instance: null
Here are the items:
Number tNurseryTemperature “Temperature: [%.1f °F]” (g2FTemp) { ecobee="<[XXX
rule "Upstairs HVAC Auto Controller"
when
Item tNurseryTemperature changed or
Item tMBRCoolPoint changed or
Item tMBRHeatPoint changed or
Item tMBRhvacMode changed
then
if (tNurseryTemperature.state >= (tMBRCoolPoint.state + 2.0f) && tMBRhvacMode == “heat”) {
sendCommand(tMBRhvacMode, “cool”)
pushover(“Bedroom/Nursery HVAC has transitioned from heating mode to cooling.”)
}
else if (tNurseryTemperature.state <= (tMBRHeatPoint -2.0f) && tMBRhvacMode = “cool”) {
sendCommand(tMBRhvacMode, “heat”)
pushover(“Bedroom/Nursery HVAC has transitioned from cooling mode to heating.”)
}
end
Thank you, that is working well, but now I’m seeing another error. It looks like the logic is working fine, but I’m seeing an error trying to change the HVAC mode:
2016-04-21 13:24:20.063 [ERROR] [o.o.c.s.ScriptExecutionThread ] - Error during the execution of rule ‘Upstairs HVAC Auto Controller’: Could not invoke method: org.openhab.core.items.GenericItem.setState(org.openhab.core.types.State) on instance: tMBRhvacMode (Type=StringItem, State=cool)
It’s strange because I use the same setup on a different HVAC mode Item (i.e., sendCommand) in another rule in the same rule file and it does not give me an error.
I’m still getting the same error with this command:
tMBRhvacMode.sendCommand(“heat”)
2016-04-21 16:10:15.389 [ERROR] [o.o.c.s.ScriptExecutionThread ] - Error during the execution of rule ‘Upstairs HVAC Auto Controller’: Could not invoke method: org.openhab.core.items.GenericItem.setState(org.openhab.core.types.State) on instance: tMBRhvacMode (Type=StringItem, State=cool)
This may be a silly question, but is it worth rebooting before I do more troubleshooting?
2016-04-25 06:38:43.410 [ERROR] [o.o.c.s.ScriptExecutionThread ] - Error during the execution of rule ‘Upstairs HVAC Auto Controller’: Could not invoke method: org.openhab.core.items.GenericItem.setState(org.openhab.core.types.State) on instance: tMBRhvacMode (Type=StringItem, State=cool)
I’m going to change the title to make it clear that this relates to an Ecobee item in an attempt to help resolve it. Would running at the debug level help?
It looks like you are assigning “cool” to the item variable. You instead need == and not = to do the comparison. One “trick” is to put the constant on the left of the == to help safeguard the common error of using a single =, like:
For some reason, I was having an issue previously with sending the command to change the HVAC state when transitioning to “cool” (the comparison was configured correctly for that if/then statement), so I figured it was the same issue.