Pistons to chng T-Stat settings


I am a log time CoRE user but new to webCoRE and not in any way a pro at coding so this is so far an interesting challenge I am enjoying. I have all electric heat w/heat pump. I have 2x pistons to change my honeywell t-stat to Emergency heat and back to normal heat depending on outdoor temps using the $twcweather command as I don’t like the noise my heat pump makes when it gets too cold out, typically around 32F it does not seem to put much if any heat into my home around these temps. I also had similar pistons set up in old CoRE and they behaved the same way. I am planning on moving away from old CoRE solely to webCoRE once I get all my pistions migrated. Thank you for any help on this matter.

At or below 33F, one piston is set to change my t-stat to emerg. heat and not use the heat pump for as long as the temp is at or below 33F. Once outdoor temps get to 34 or higher, the 2nd piston is set to change the t-stat from emerg. heat back to normal heat to use the heat pump.

Both pistons seem to work at the correct temps, but only if I go in to the dashboard and hit the test button for each, depending on temps. it don’t seem like they are ‘polling’ to see what the outside temps are or what my t-stat is set at for comparison automatically.

Below are the upload imgs of both pistons, 1st one is to change to Emerg. heat, 2nd is to change back to heat.

This is the log to change from heat to emerg heat at desired temp. It returned false, no state change as the temps outside are not in the specified range:

11/15/2019, 1:41:01 PM +691ms
+1ms ╔Received event [Home].test = 1573843261689 with a delay of 2ms
+79ms ║RunTime Analysis CS > 17ms > PS > 48ms > PE > 14ms > CE
+82ms ║Runtime (37535 bytes) successfully initialized in 48ms (v0.3.110.20191009) (79ms)
+83ms ║╔Execution stage started
+195ms ║║Comparison (dynamic) 35 is_less_than_or_equal_to (integer) 33 = false (1ms)
+197ms ║║Condition #2 evaluated false (107ms)
+198ms ║║Condition group #1 evaluated false (state did not change) (109ms)
+203ms ║╚Execution stage complete. (120ms)
+205ms ╚Event processed successfully (204ms)

This is the log of the piston to change from emerg heat back to heat when temp gets above setting. note it only worked once i hit the test button to get the log generated:

11/15/2019, 1:43:49 PM +544ms
+2ms ╔Received event [Climate HVAC T-Stat].thermostatMode = emergency heat with a delay of 52ms
+91ms ║RunTime Analysis CS > 22ms > PS > 58ms > PE > 11ms > CE
+94ms ║Runtime (37586 bytes) successfully initialized in 58ms (v0.3.110.20191009) (91ms)
+95ms ║╔Execution stage started
+145ms ║║Comparison (dynamic) 35 is_greater_than_or_equal_to (integer) 34 = true (1ms)
+147ms ║║Condition #2 evaluated true (47ms)
+151ms ║║Comparison (enum) emergency heat is (string) emergency heat = true (1ms)
+153ms ║║Cancelling condition #3’s schedules…
+154ms ║║Condition #3 evaluated true (5ms)
+155ms ║║Cancelling condition #1’s schedules…
+155ms ║║Condition group #1 evaluated true (state changed) (56ms)
+157ms ║║Cancelling statement #4’s schedules…
+1327ms ║║Executed physical command [Climate HVAC T-Stat].heat() (1166ms)
+1328ms ║║Executed [Climate HVAC T-Stat].heat (1167ms)
+1330ms ║╚Execution stage complete. (1236ms)
+1332ms ╚Event processed successfully (1332ms)

Thanks again for any help.


I would make the following changes:


I would change to drops below 34


I would change to rises above 34

Both of these changes will put your trigger on the outside temperature and will trigger your pistons appropriately and they will only fire ONCE when the conditions are met. As you have them now, your pistons could fire multiple times…at temperature less than 33, 32, 31, 30… or greater then 34, 35, 36, 37…

Also, before changing all of your CORE pistons over to webcore, I would read through this:


Also, for clarification, normally math and weather changes cannot be used as a trigger… Something ELSE needs to trigger the piston first… Then the temperature can be calculated.


I made the changes to drops below/rises above and did notice a msg that I didn’t see before on the piston page that said:
“This piston does not subscribe to any events. Unless executed by other means, it will never run on its own.”


Correct. TWC cannot be used as a trigger.

IE: No piston will ever fire when the TWC temperature changes.


Thank you both for the info, I’ll look into subscriptions etc and see if I can get them to fire on their own.


You need some OTHER logic to trigger the piston… Once the piston is executing, the temp can be checked, and the logic can continue.

That trigger can be thermostat changing to X or any other normal trigger


Did not know that…:grinning:
I didn’t test it, but I certainly thought that “rises above” and “drops below” would act as a trigger. @WCmore, thanks for the clarification.


@WCmore, I tested the TWC and sure enough, it does not work as a trigger. Not that I didn’t believe you. I just wanted to test it. Do you know why it does not work as a trigger?


TWC gathers the data, but does not PUSH itself out to every single device. We have to actually make the query to see the data.

Most weather apps are basically automations to gather weather data at timed intervals… At that point, it can display it to the user. (IE: the temp displayed on your phone’s notification tray updates every X minutes)

This also means at any moment, the temp might actually be off a few degrees…
(Depending on how recent the last update)


@WCmore, So for @MyDog8em, should he add something like


timers… why I didn’t think of that? I’ve made this change on both pistons to test. Set the timer for emheat to some seconds to test and it seemed to work… I’ll let it cook and the outdoor temps naturally rise/fall, think its gonna be lo 40’s tomorrow day and low 20’s tomorrow nite which will make for a good test. Thanks for the insight, I’ll let you know how goes it.


The temps rose today and the switch from emheat to heat worked, dropped below threshold not long ago and the switch back to emheat worked so it seems alls well. Thank you all for your help in this!