I tried several different ways of attempting to access this variable. They all produce an error like this when I try to output them to the debug log:
groovy.lang.MissingMethodException: No signature of method: java.lang.String.currentValue() is applicable for argument types: (java.lang.String) values: [thermostatMode] @line XXX (funcName)
This is what happens when I try to list attributes:
groovy.lang.MissingPropertyException: No such property: supportedAttributes for class: java.lang.String @line XXX (funcName)
I’m starting to wonder if this is a bug? Or maybe thermostatMode wasn’t implemented properly in my thermostat’s device handler? The code for my thermostat is available in the SmartThings repository. I don’t see anything amiss but I could have missed something. I’m using a Zen thermostat:
@jmarkwell I do note that the attribute giving you problems is one where the device variable thermostatMode is also the name of an attribute of the Thermostat capability. Could it actually be that you are inadvertently calling currentValue() on the attribute string.
That could be complete nonsense but I woke up far too early.
I should probably note something else. In my prototype testing so far, thermostatMode.heat() throws this error:
groovy.lang.MissingMethodException: No signature of method: java.lang.String.heat() is applicable for argument types: () values:
Possible solutions: next(), getAt(java.lang.String), getAt(int), getAt(groovy.lang.Range), getAt(groovy.lang.IntRange), getAt(int) @line XXX (setHeatMode)
Keep in mind that my personal home thermostat is a Z-Wave non-cloud thermostat that DOES support capability.thermostat. The device handler includes the other capabilities as well, but I’ve never tried using them before.
@jmarkwell I was just wondering what would happen if you used, for example:
myThermostatMode.currentValue( "thermoStatMode" )
We both know what you are doing but I think Groovy has other ideas. Certainly the last error you posted while I was typing this confirms that it thinks thermoStatMode is a string and not a device object.
Well what the hell. It looks like its working. To be sure I’ve gotta get it to activate it’s call to change the mode which will take 15 minutes or so, but the reference to the thermostat mode worked this time.
Doesn’t make any sense to me but thanks alot for your help!
You know, I double-checked and I didn’t make any other references to that variable name anywhere. Something in the SmartThings code must not like it.
Well I will update my GitHub repository and will post an update on the main thread when it is available. The normal way to update is to add the repo through the IDE. Instructions are available on the main thread at the top:
If Thermostat Manager is available through the ST app I wasn’t aware. I submitted it a long time ago but I’m not sure that they ever added it. If they did, I guess it depends on how their repo works! The safer bet is probably to connect to my GitHub repo and run an update when it gets posted.