I am currently working on a way to support thermostats that don’t support capability.thermostat (it appears most of them are cloud based thermostats).
I’ve almost got it but I’ve run into a strange problem. There’s probably some small thing I’m missing but, traditionally I’ve used capability.thermostat’s:
thermostat.currentValue(“thermostatMode”)
In order to obtain the mode that the thermostat is currently in. Using the newer capabilities, I’ve been able to access all of them similarly using things like:
But for some reason, if I try to access capability.thermostatMode like this:
thermostatMode.currentValue(“thermostatMode”)
The app stops functioning and doesn’t report an error. I’ve read through the documentation and it appears that I am accessing everything properly. What am I doing wrong?
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:
Hi and thanks for updating your smartapp. As the thermostat capability is going away, can you add the 3 new thermostat capabilies that replace it so that i am able to select my thermostats?
I should have something for ya’ll soon. Just want to do the best that I can to make sure it works properly. Subscribe to the main thread and I’ll keep ya’ll updated there.
@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:
input "myThermostatMode"
and
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.
No idea really. I am not a developer. I am just trying to update an old thermostat that its creator left the platform years ago. I just like your app and like to use it.
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.