Capability ThermostatMode

Hello,

I am the developer of Thermostat Manager:

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:

thermostatHeatingSetpoint.currentValue(“heatingSetpoint”)
thermostatCoolingSetpoint.currentValue(“coolingSetpoint”)
thermostatFanMode.currentValue(“thermostatFanMode”)

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?

Thanks.

Update:

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?

These are:

capability “Thermostat Heating Setpoint”
capability “Thermostat Setpoint”
capability “Thermostat Mode”

@Andremain

That’s what I’m currently working on :slight_smile:

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.

@orangebucket

Well, I generally try accessing it like this:

thermostatMode.currentValue(“thermostatMode”)

Where the preference variable thermostatMode is setup like this:

input “thermostatMode”, “capability.thermostatMode”, title: “Thermostat Mode Controller”, multiple: false, required: false

If I’m doing anything wrong, I’m not seeing it. I am able to access the other variables in this way:

thermostatHeatingSetpoint.currentValue(“heatingSetpoint”)

and

input “thermostatHeatingSetpoint”, “capability.thermostatHeatingSetpoint”, title: “Thermostat Heating SetPoint Controller”, multiple: false, required: false

thermostatHeatingSetpoint works properly… for accessing it anyway.

@orangebucket

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.

1 Like

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.

1 Like

@orangebucket

Worth a try. BRB

@orangebucket

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.

@orangebucket

Success! Everything is working properly. Looks like that was all it was. Solution to you sir. Thanks again!

@andremain, I should have something out sometime this week. I’ll keep ya’ll posted in the main thread. Good night!

1 Like

Excellent! Good night. Will you update the app that is used officially in smartthings or will i need to install it through the ide?

You are welcome. I don’t pretend to understand exactly what was happening in Groovy terms but I could see what was different at the capability level.

1 Like

@Andremain,

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.

Yeah sorry my mistake it isn’t. You can try to submit it again now i guess :slight_smile: