Thermostat Protection with Over Ride Option


#1

1) Give a description of the problem
Trying to prevent the thermostat wars in the house by having it automatically lower itself back to it’s preset unless I cancel the piston with an override.

2) What is the expected behavior?
When someone adjusts the heat above 68F, I want it to automatically lower back to 68F. However, I want to be able to override the piston by double-clicking a nearby switch or something similar. I have it set to just a simple state change for testing but ideally would like to double-click or make it a combination of two near-by light switches being turned on and off.

3) What is happening/not happening?
The thermostat is automatically going back to 68F is someone tries to raise the temp, but I can not over ride the function.

**4) Post a Green Snapshot of the piston!

5) Attach any logs (From ST IDE and by turning logging level to Full)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:51 PM: trace ║╔ Execution stage complete. (23ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:51 PM: debug ║║ Cancelling condition #2’s schedules…
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:51 PM: debug ║║ Condition #6 evaluated false (6ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:51 PM: debug ║║ Condition #1 evaluated true (5ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:51 PM: debug ║║ Comparison (string) :544a9b992c238a89c379073fefaa7fe1: is_any_of (string) :544a9b992c238a89c379073fefaa7fe1:,:aa4b274e22d2f4c0001b65e07d3b32bd: = true (2ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:51 PM: trace ║ Runtime (39677 bytes) successfully initialized in 6844ms (v0.2.102.20180116) (6877ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:51 PM: info ╔ Event processed successfully (6904ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:51 PM: debug ║ RunTime Analysis CS > 11ms > PS > 6844ms > PE > 21ms > CE
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:51 PM: debug ║║ Condition group #2 evaluated false (state changed) (8ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:51 PM: debug ║║ Condition group #null evaluated true (state did not change) (6ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:51 PM: trace ║╚ Execution stage started
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:51 PM: warn ║ Piston waited at a semaphore for 6808ms
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:44 PM: info ╚ Received event [KIT Thermostat].heatingSetpoint = 68 with a delay of 2852ms
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:44 PM: info ╔ Event processed successfully (3360ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:44 PM: trace ║╔ Execution stage complete. (3252ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:44 PM: debug ║║ Condition group #10 evaluated false (state did not change) (35ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:44 PM: debug ║║ Condition #13 evaluated false (33ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:44 PM: debug ║║ Comparison (enum) off changed = false (24ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:44 PM: trace ║║ Executed [KIT Thermostat].setHeatingSetpoint (3193ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:44 PM: debug ║║ Executed physical command [KIT Thermostat].setHeatingSetpoint([68.0]) (3191ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:41 PM: trace ║╚ Execution stage started
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:41 PM: trace ║ Runtime (39594 bytes) successfully initialized in 61ms (v0.2.102.20180116) (105ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:41 PM: debug ║ RunTime Analysis CS > 17ms > PS > 61ms > PE > 26ms > CE
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:04:41 PM: info ╚ Received event [Home].time = 1519423482458 with a delay of -1055ms
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:03:42 PM: info ╔ Event processed successfully (125ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:03:42 PM: info ║ Setting up scheduled job for Fri, Feb 23 2018 @ 5:04:42 PM EST (in 59.995s)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:03:42 PM: trace ║╔ Execution stage complete. (47ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:03:42 PM: trace ║║ Executed virtual command [KIT Thermostat].wait (0ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:03:42 PM: debug ║║ Cancelling statement #3’s schedules…
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:03:42 PM: debug ║║ Condition group #null evaluated true (state did not change) (5ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:03:42 PM: debug ║║ Comparison (decimal) 71.0 is_greater_than (integer) 68 = true (2ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:03:42 PM: debug ║║ Comparison (string) :544a9b992c238a89c379073fefaa7fe1: is_any_of (string) :544a9b992c238a89c379073fefaa7fe1:,:aa4b274e22d2f4c0001b65e07d3b32bd: = true (1ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:03:42 PM: debug ║║ Condition #1 evaluated true (5ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:03:42 PM: trace ║ Runtime (39605 bytes) successfully initialized in 36ms (v0.2.102.20180116) (68ms)
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:03:42 PM: trace ║╚ Execution stage started
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:03:42 PM: debug ║ RunTime Analysis CS > 12ms > PS > 36ms > PE > 19ms > CE
d6a97c0d-ea73-473f-b1ef-2195e1a6d194 5:03:42 PM: info ╚ Received event [KIT Thermostat].heatingSetpoint = 71 with a delay of 42ms

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

try this … you dont actually need the cancel all pending tasks but since it makes the piston more explicit no harm in leaving it in there:


#3

Thanks! When I tried adding the second execution, there is no option to cancel pending tasks or send push notifications. I just get the list with all my devices to select from. Is there an option I am missing?


#4

sure. just import this piston using the piston code then edit from there.

use the orange restore button after clicking the add a new piston.


#5

Thanks, imported and adjusted all the devices to what they should be. Unfortunately, it is still not canceling the piston if I turn the lights on and off real quick. Here are the logs…

f4e0b420-1681-4916-bfe8-008b41766374 1:01:52 PM: debug ║║ Cancelling condition #6’s schedules…
f4e0b420-1681-4916-bfe8-008b41766374 1:01:52 PM: trace ║╚ Execution stage started
f4e0b420-1681-4916-bfe8-008b41766374 1:01:52 PM: debug ║║ Condition group #10 evaluated false (state did not change) (7ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:52 PM: debug ║║ Condition group #2 evaluated false (state changed) (8ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:52 PM: debug ║║ Condition #6 evaluated false (6ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:52 PM: info ╔ Event processed successfully (6919ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:52 PM: debug ║║ Comparison (string) :544a9b992c238a89c379073fefaa7fe1: is_any_of (string) :544a9b992c238a89c379073fefaa7fe1:,:aa4b274e22d2f4c0001b65e07d3b32bd: = true (2ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:52 PM: debug ║║ Condition #1 evaluated true (6ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:52 PM: trace ║ Runtime (39710 bytes) successfully initialized in 6841ms (v0.2.102.20180116) (6881ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:52 PM: debug ║║ Comparison (decimal) 68.0 rises_above (integer) 68 = false (1ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:52 PM: warn ║ Piston waited at a semaphore for 6767ms
f4e0b420-1681-4916-bfe8-008b41766374 1:01:45 PM: info ╚ Received event [KIT Thermostat].heatingSetpoint = 68 with a delay of 3025ms
f4e0b420-1681-4916-bfe8-008b41766374 1:01:45 PM: info ╔ Event processed successfully (3621ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:45 PM: trace ║╔ Execution stage complete. (3524ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:45 PM: debug ║║ Condition group #10 evaluated false (state did not change) (7ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:45 PM: debug ║║ Condition #13 evaluated false (6ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:45 PM: trace ║║ Executed [KIT Thermostat].setHeatingSetpoint (3495ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:45 PM: debug ║║ Executed physical command [KIT Thermostat].setHeatingSetpoint([68.0]) (3494ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:42 PM: trace ║╚ Execution stage started
f4e0b420-1681-4916-bfe8-008b41766374 1:01:42 PM: trace ║ Runtime (39622 bytes) successfully initialized in 56ms (v0.2.102.20180116) (94ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:01:42 PM: debug ║ RunTime Analysis CS > 15ms > PS > 56ms > PE > 22ms > CE
f4e0b420-1681-4916-bfe8-008b41766374 1:01:42 PM: info ╚ Received event [Home].time = 1519495303299 with a delay of -942ms
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: debug ║║ Cancelling statement #3’s schedules…
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: info ║ Setting up scheduled job for Sat, Feb 24 2018 @ 1:01:43 PM EST (in 59.995s)
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: trace ║║ Executed virtual command [KIT Thermostat].wait (1ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: info ╔ Event processed successfully (122ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: trace ║╔ Execution stage complete. (47ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: debug ║║ Condition #6 evaluated true (6ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: debug ║║ Condition group #2 evaluated true (state changed) (8ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: debug ║║ Cancelling condition #6’s schedules…
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: trace ║║ Requesting a wake up for Sat, Feb 24 2018 @ 1:01:43 PM EST (in 60.0s)
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: debug ║║ Comparison (decimal) 71.0 rises_above (integer) 68 = true (1ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: trace ║║ Executed virtual command [KIT Thermostat].sendPushNotification (7ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: debug ║║ Condition group #null evaluated true (state did not change) (7ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: debug ║║ Cancelling condition #2’s schedules…
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: debug ║║ Condition #1 evaluated true (5ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: debug ║║ Comparison (string) :544a9b992c238a89c379073fefaa7fe1: is_any_of (string) :544a9b992c238a89c379073fefaa7fe1:,:aa4b274e22d2f4c0001b65e07d3b32bd: = true (1ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: trace ║╚ Execution stage started
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: trace ║ Runtime (39635 bytes) successfully initialized in 37ms (v0.2.102.20180116) (65ms)
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: debug ║ RunTime Analysis CS > 12ms > PS > 37ms > PE > 16ms > CE
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: info ╚ Received event [KIT Thermostat].heatingSetpoint = 71 with a delay of 40ms


#6

Post a green snapshot of the piston please.


#7

Oh sure, sorry. Here it is, I just imported what you sent previously.


#8

no worries. please send with trace turned on so i can confirm the line number reference is the same.

thanks.


#9

taking a quick look at the logs there is no event from switch 23 logged. since its a trigger if the switch changed before the wait expired it should have been logged. could you try once again please and see if the switch on/off triggers the piston or not? dont change the thermostat just turn the switch on/off and that should trigger the piston.

here are 3 events i see … there should be at least one switch event between the first and second event from the bottom:

f4e0b420-1681-4916-bfe8-008b41766374 1:01:45 PM: info ╚ Received event [KIT Thermostat].heatingSetpoint = 68 with a delay of 3025ms
f4e0b420-1681-4916-bfe8-008b41766374 1:01:42 PM: info ╚ Received event [Home].time = 1519495303299 with a delay of -942ms
f4e0b420-1681-4916-bfe8-008b41766374 1:00:43 PM: info ╚ Received event [KIT Thermostat].heatingSetpoint = 71 with a delay of 40ms

#10

Okay, here are the logs from just hitting the switch and not touching the thermostat.

f4e0b420-1681-4916-bfe8-008b41766374 7:03:59 PM: debug ║║ Comparison (decimal) 68.0 is_different_than (integer) 68 = false (2ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:59 PM: debug ║║ Condition #13 evaluated true (4ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:59 PM: debug ║║ Condition group #2 evaluated false (state did not change) (10ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:59 PM: debug ║║ Condition #15 evaluated false (8ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:59 PM: debug ║║ Condition #6 evaluated false (8ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:59 PM: debug ║║ Condition group #null evaluated true (state did not change) (8ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:59 PM: debug ║║ Condition #1 evaluated true (7ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:59 PM: trace ║╚ Execution stage started
f4e0b420-1681-4916-bfe8-008b41766374 7:03:59 PM: debug ║║ Comparison (string) :544a9b992c238a89c379073fefaa7fe1: is_any_of (string) :544a9b992c238a89c379073fefaa7fe1:,:aa4b274e22d2f4c0001b65e07d3b32bd: = true (2ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:59 PM: trace ║ Runtime (39624 bytes) successfully initialized in 53ms (v0.2.102.20180116) (98ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:59 PM: debug ║ RunTime Analysis CS > 22ms > PS > 53ms > PE > 23ms > CE
f4e0b420-1681-4916-bfe8-008b41766374 7:03:59 PM: info ╚ Received event [KIT Lights].switch = off with a delay of 1016ms
f4e0b420-1681-4916-bfe8-008b41766374 7:03:57 PM: trace ║╔ Execution stage complete. (41ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:57 PM: debug ║║ Condition #1 evaluated true (5ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:57 PM: debug ║║ Comparison (enum) on changes = true (0ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:57 PM: debug ║║ Condition #13 evaluated true (4ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:57 PM: debug ║║ Condition group #2 evaluated false (state did not change) (9ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:57 PM: debug ║║ Comparison (string) :544a9b992c238a89c379073fefaa7fe1: is_any_of (string) :544a9b992c238a89c379073fefaa7fe1:,:aa4b274e22d2f4c0001b65e07d3b32bd: = true (2ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:57 PM: debug ║║ Condition #6 evaluated false (7ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:57 PM: trace ║╚ Execution stage started
f4e0b420-1681-4916-bfe8-008b41766374 7:03:57 PM: debug ║║ Condition group #null evaluated true (state did not change) (7ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:57 PM: debug ║ RunTime Analysis CS > 16ms > PS > 52ms > PE > 21ms > CE
f4e0b420-1681-4916-bfe8-008b41766374 7:03:57 PM: info ╚ Received event [KIT Lights].switch = on with a delay of 980ms
f4e0b420-1681-4916-bfe8-008b41766374 7:03:57 PM: trace ║ Runtime (39623 bytes) successfully initialized in 52ms (v0.2.102.20180116) (89ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: debug ║║ Condition group #10 evaluated false (state did not change) (14ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: info ╔ Event processed successfully (138ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: debug ║║ Condition #15 evaluated false (8ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: trace ║╔ Execution stage complete. (44ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: debug ║║ Comparison (enum) off changes = true (1ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: debug ║║ Condition group #2 evaluated false (state did not change) (11ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: debug ║║ Comparison (decimal) 68.0 is_different_than (integer) 68 = false (2ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: debug ║║ Condition #13 evaluated true (4ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: debug ║║ Condition #6 evaluated false (9ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: debug ║║ Condition group #null evaluated true (state did not change) (7ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: debug ║ RunTime Analysis CS > 16ms > PS > 55ms > PE > 19ms > CE
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: debug ║║ Condition #1 evaluated true (6ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: debug ║║ Comparison (string) :544a9b992c238a89c379073fefaa7fe1: is_any_of (string) :544a9b992c238a89c379073fefaa7fe1:,:aa4b274e22d2f4c0001b65e07d3b32bd: = true (2ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: trace ║╚ Execution stage started
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: trace ║ Runtime (39623 bytes) successfully initialized in 55ms (v0.2.102.20180116) (90ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:53 PM: info ╚ Received event [KIT Lights].switch = off with a delay of 978ms
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: info ╔ Event processed successfully (140ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: trace ║╔ Execution stage complete. (47ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: debug ║║ Condition group #10 evaluated false (state did not change) (16ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: debug ║║ Condition #15 evaluated false (9ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: debug ║║ Comparison (decimal) 68.0 is_different_than (integer) 68 = false (2ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: debug ║║ Comparison (enum) on changes = true (0ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: debug ║║ Condition group #2 evaluated false (state did not change) (10ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: debug ║║ Condition #6 evaluated false (8ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: debug ║║ Condition group #null evaluated true (state changed) (9ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: debug ║║ Cancelling condition #null’s schedules…
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: debug ║║ Comparison (string) :544a9b992c238a89c379073fefaa7fe1: is_any_of (string) :544a9b992c238a89c379073fefaa7fe1:,:aa4b274e22d2f4c0001b65e07d3b32bd: = true (2ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: debug ║║ Condition #1 evaluated true (7ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: debug ║║ Cancelling condition #1’s schedules…
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: trace ║ Runtime (39626 bytes) successfully initialized in 55ms (v0.2.102.20180116) (89ms)
f4e0b420-1681-4916-bfe8-008b41766374 7:03:49 PM: trace ║╚ Execution stage started


#11

thanks, that confirms the switch subscription is working.

ok lets try the full deal this time:

  1. set log to full
  2. clear logs
  3. turn thermostat to higher than 68
  4. after 10 seconds turn switch on or off

wait a few seconds then share everything logged.

thanks.

EDIT: remember to turn trace on and share a green snapshot of the piston taken after step #4 above along with the logs.


#12

When I first saw your post I came up with a solution, but it looked like you were on to something that would work for you and it was much simpler than what I came up with. (At that point I finished my solution more as a learning exercise for myself.) But since you’re still working on it, maybe you might find what I came up with useful. I’ll include the full piston below.

I used a dimmer switch instead of a thermostat, but if you change Dimmer 1 to your thermostat, and change “switch changes to on” to “thermostat rises above 68”, and “switch changes to off” to “thermostat drops to or below 68”, and “Turn off” to “Set heating point at 68”, I think it will work for you. Oh, and change the log statements as appropriate. (If not, let me know and I can change it to use a simulated thermostat and retest.)

It uses a second switch as the “override”. If you toggle that switch twice within 5 seconds, it cancels the 1 minute countdown to turning off the dimmer (i.e., resetting the thermostat setpoint.)

Anyway, the piston follows. Let me know if you have any questions or need me to change it over to a thermostat for you. FWIW, I did test it out and it seemed to work for me.

One thing you will definitely have to do if you try to use this: Initialize the state variable to ‘Inactive’ before it runs the first time.


#13

Just tried it out and the heat lowered back down to 68 again. I don’t see anything in the logs with the switching state changing either in the logs. I turned the switch on and off several times to be sure too.

My live logging seems not be working currently in the IDE either. Just rebooted my hub and not getting anything. Here are the logs from webcore.

2/25/2018, 10:11:37 AM +388ms
+1ms ╔Received event [KIT Lights].switch = on with a delay of 431ms
+102ms ║RunTime Analysis CS > 19ms > PS > 57ms > PE > 27ms > CE
+105ms ║Runtime (39624 bytes) successfully initialized in 57ms (v0.2.102.20180116) (103ms)
+106ms ║╔Execution stage started
+114ms ║║Comparison (string) :544a9b992c238a89c379073fefaa7fe1: is_any_of (string) :544a9b992c238a89c379073fefaa7fe1:,:aa4b274e22d2f4c0001b65e07d3b32bd: = true (2ms)
+116ms ║║Condition #1 evaluated true (5ms)
+117ms ║║Condition group #null evaluated true (state did not change) (6ms)
+128ms ║║Condition #6 evaluated false (9ms)
+129ms ║║Condition group #2 evaluated false (state did not change) (10ms)
+135ms ║║Comparison (enum) on changes = true (0ms)
+136ms ║║Condition #13 evaluated true (4ms)
+143ms ║║Comparison (decimal) 68.0 is_different_than (integer) 68 = false (2ms)
+144ms ║║Condition #15 evaluated false (7ms)
+145ms ║║Condition group #10 evaluated false (state did not change) (13ms)
+147ms ║╚Execution stage complete. (42ms)
+149ms ╚Event processed successfully (148ms)
2/25/2018, 10:11:31 AM +189ms
+2ms ╔Received event [KIT Lights].switch = off with a delay of 375ms
+105ms ║RunTime Analysis CS > 21ms > PS > 56ms > PE > 28ms > CE
+108ms ║Runtime (39624 bytes) successfully initialized in 56ms (v0.2.102.20180116) (105ms)
+109ms ║╔Execution stage started
+117ms ║║Comparison (string) :544a9b992c238a89c379073fefaa7fe1: is_any_of (string) :544a9b992c238a89c379073fefaa7fe1:,:aa4b274e22d2f4c0001b65e07d3b32bd: = true (2ms)
+119ms ║║Condition #1 evaluated true (5ms)
+120ms ║║Condition group #null evaluated true (state did not change) (6ms)
+131ms ║║Condition #6 evaluated false (9ms)
+132ms ║║Condition group #2 evaluated false (state did not change) (10ms)
+138ms ║║Comparison (enum) off changes = true (1ms)
+139ms ║║Condition #13 evaluated true (4ms)
+148ms ║║Comparison (decimal) 68.0 is_different_than (integer) 68 = false (2ms)
+150ms ║║Condition #15 evaluated false (10ms)
+151ms ║║Condition group #10 evaluated false (state did not change) (16ms)
+153ms ║╚Execution stage complete. (45ms)
+154ms ╚Event processed successfully (154ms)
2/25/2018, 10:11:29 AM +941ms
+2ms ╔Received event [KIT Lights].switch = on with a delay of 394ms
+92ms ║RunTime Analysis CS > 15ms > PS > 53ms > PE > 23ms > CE
+94ms ║Runtime (39623 bytes) successfully initialized in 53ms (v0.2.102.20180116) (92ms)
+95ms ║╔Execution stage started
+103ms ║║Comparison (string) :544a9b992c238a89c379073fefaa7fe1: is_any_of (string) :544a9b992c238a89c379073fefaa7fe1:,:aa4b274e22d2f4c0001b65e07d3b32bd: = true (2ms)
+104ms ║║Condition #1 evaluated true (5ms)
+105ms ║║Condition group #null evaluated true (state did not change) (6ms)
+115ms ║║Condition #6 evaluated false (8ms)
+116ms ║║Condition group #2 evaluated false (state did not change) (9ms)
+122ms ║║Comparison (enum) on changes = true (0ms)
+123ms ║║Condition #13 evaluated true (3ms)
+130ms ║║Comparison (decimal) 68.0 is_different_than (integer) 68 = false (2ms)
+131ms ║║Condition #15 evaluated false (8ms)
+132ms ║║Condition group #10 evaluated false (state did not change) (13ms)
+134ms ║╚Execution stage complete. (39ms)
+135ms ╚Event processed successfully (135ms)
2/25/2018, 10:11:27 AM +298ms
+2ms ╔Received event [KIT Lights].switch = off with a delay of 366ms
+101ms ║RunTime Analysis CS > 17ms > PS > 62ms > PE > 21ms > CE
+103ms ║Runtime (39625 bytes) successfully initialized in 62ms (v0.2.102.20180116) (101ms)
+104ms ║╔Execution stage started
+112ms ║║Comparison (string) :544a9b992c238a89c379073fefaa7fe1: is_any_of (string) :544a9b992c238a89c379073fefaa7fe1:,:aa4b274e22d2f4c0001b65e07d3b32bd: = true (1ms)
+114ms ║║Condition #1 evaluated true (6ms)
+115ms ║║Condition group #null evaluated true (state did not change) (7ms)
+128ms ║║Condition #6 evaluated false (11ms)
+129ms ║║Condition group #2 evaluated false (state did not change) (12ms)
+135ms ║║Comparison (enum) off changes = true (0ms)
+136ms ║║Cancelling condition #13’s schedules…
+137ms ║║Condition #13 evaluated true (5ms)
+145ms ║║Comparison (decimal) 68.0 is_different_than (integer) 68 = false (2ms)
+146ms ║║Condition #15 evaluated false (9ms)
+147ms ║║Condition group #10 evaluated false (state did not change) (15ms)
+150ms ║╚Execution stage complete. (45ms)
+151ms ╚Event processed successfully (151ms)


#14

Thanks! I will it give it a try as well. If anything, I can use it to help me learn more about webcore. My abilities are very basic at this point…lol. I adjusted your piston as you suggested and added push notifications. Does this look correct?


#15

Yep, looks good to me. Let me know if you use it and how it works. I’m still learning myself! :slight_smile:


#16

do see the switch events this time but not the thermostat event changing the heat setting from 68 to higher?


#17

so you mean its working as it should but nothing for the switches is showing up in the piston log?


#18

Unfortunately no, the temperature is lowering back to 68 and I am not getting that second push notification. It looks like it’s not seeing the switch state changing, despite me hitting it several times.


#19

that’s odd. if you hit the switches by themselves thought that event did show up in the logs. I will take another look when not on mobile.


#20

took another look. why switch 23 events would not show up is really odd.

can you create a second piston containing just the lines 30 to 37 in this piston and save it as a new piston. note this is lines 30 - 37 as shown in the snapshot above not those line numbers when in edit mode. you can restore piston 2cg2 again with a different name then delete the first if and save it. then try and see if that piston gets triggered when the switch is flipped.

btw, when you made the last attempt was the location mode one of home or night?