Created a Piston to turn off thermostat when door is open


#1

1) Give a description of the problem
The piston isn’t setting the mode back to the previous mode

2) What is the expected behavior?
The Variable should save the current mode (ie Heat) and then set it back in the else

3) What is happening/not happening?
The mode is not being set back to the previous state (ie: Heat)

4) Post a Green Snapshot of the pistonimage

**5) Attach any logs (From ST IDE and by turning logging level to Full) **ae3cf42d-e2f7-41df-917e-456d89728610 5:33:38 PM: debug pollDevice() - update attributes
ae3cf42d-e2f7-41df-917e-456d89728610 5:33:30 PM: error groovy.lang.MissingMethodException: No signature of method: script_dth_4d431334_00e9_4fef_aaac_f5a950ecb03d_ver_0_2.switchMode() is applicable for argument types: (java.lang.String) values: [off]
Possible solutions: switchMode(), switchToMode(java.lang.Object), switchFanMode() @line 1727 (executePhysicalCommand)
b9ca17f7-4a24-4832-af6a-03709e8937eb 5:33:30 PM: trace Not sending alert, no preferences set
b9ca17f7-4a24-4832-af6a-03709e8937eb 5:33:30 PM: trace oncePerDayOk = true
b9ca17f7-4a24-4832-af6a-03709e8937eb 5:33:30 PM: debug HH autoExecute(), newMode: null
ff82fe49-1700-432d-b8fe-8176e390c659 5:33:30 PM: debug HH auto execute Resume AC, Door Is Closed Something Opens or Closes
ff82fe49-1700-432d-b8fe-8176e390c659 5:33:30 PM: trace daysOk = true
ff82fe49-1700-432d-b8fe-8176e390c659 5:33:30 PM: debug evt.name: closed
ae3cf42d-e2f7-41df-917e-456d89728610 5:33:20 PM: error groovy.lang.MissingMethodException: No signature of method: script_dth_4d431334_00e9_4fef_aaac_f5a950ecb03d_ver_0_2.switchMode() is applicable for argument types: (java.lang.String) values: [off]
Possible solutions: switchMode(), switchToMode(java.lang.Object), switchFanMode() @line 1727 (executePhysicalCommand)
ff82fe49-1700-432d-b8fe-8176e390c659 5:33:14 PM: trace daysOk = true
ff82fe49-1700-432d-b8fe-8176e390c659 5:33:14 PM: debug evt.name: open
ae3cf42d-e2f7-41df-917e-456d89728610 5:32:23 PM: error groovy.lang.MissingMethodException: No signature of method: script_dth_4d431334_00e9_4fef_aaac_f5a950ecb03d_ver_0_2.switchMode() is applicable for argument types: (java.lang.String) values: [auto]
Possible solutions: switchMode(), switchToMode(java.lang.Object), switchFanMode() @line 1727 (executePhysicalCommand)

I tried setting the variable to a constant at the beginning- and tried as dynamic (seems to just stay off as well)


#2

A simple hiccup with this one that can’t be quickly fixed: Your variable is being reset every time the piston runs. To have a variable that holds a value from a previous piston run, leave the value blank when defining the variable.

I’ll throw together a sample real quick.


#3

I don’t have a thermostat to add so I had to use a light switch. For each instance of “Dimmer 2’s switch”, just change it to your Thermostat’s Mode.


Thermostat Mode Change based on Outdoor Temp with Window Sensors
#4

Thanks! That’s great help! I’m new at this and I couldn’t figure out how to add a set variable as an action.
I’ve got it now! Unfortunately, it doesn’t look like “Switchmode” works for my device handler- so I did nested if’s (Didn’t see a way to select “case”) to check the variable for the last state and select it directly.
Thanks again.


#5

Glad to help!

There should be a more direct way to set your mode than that. Can you do me a favor and select your Thermostat as a physical device, then click on the menu to the right of it, and post a screenshot of the parameters that are available? Like this:


#6

Here’s my modes-

I’m still searching to see if I can set it to only run the piston if it’s true for more than 1 minute (so if I run outside it doesn’t keep flipping the modes).
I’m searching the forums now and found time, and timers (but they seem to be set to an action, not an if statement).


#7

For the “switchMode()” I’m thinking it I prepend "to " before the mode it might work.


#8

Try choosing “set themostat mode” and then below that where it asks for the value, click the blue box, then choose variable, and CurrentMode.

That should do it.

Edit to add:

That’s an easy one too! Change this:

to this:


#9

Wow! Thanks a lot! My first day in webCoRE - Thanks for being patient-
Lots of stuff hidden up in the menus!
I guess I just need to tinker around more to get used to the interface.

Thanks again!