Temperature trigger


#1

1) Give a description of the problem
I am trying to get a light to change colour when a ST sensor exceeds a temperature threshold

2) What is the expected behaviour?
When threshold is exceeded a light flashes and changes colour

3) What is happening/not happening?
The piston is not responding to the temperature threshold being exceeded.
If I click TEST the expected light change sequence executes
Sensor increment is 0.1C. Piston increment appears limited to integer. Piston doesn’t initiate whether I wait for 0.1 or 1increment.
I can trigger a light change from a motion sensor. Problem appears specific to temperature threshold.

Thanks for any ideas/guidance

Log (from pressing TEST

04/11/2020, 17:36:05 +71ms
+0ms ╔Received event [Home].time = 1604511366370 with a delay of -1299ms
+71ms ║RunTime Analysis CS > 17ms > PS > 38ms > PE > 16ms > CE
+73ms ║Runtime (37088 bytes) successfully initialized in 38ms (v0.3.110.20191009) (72ms)
+74ms ║╔Execution stage started
+101ms ║║Executed physical command [mango Light].setColor([[hex: #000000, hue:0, level:0, saturation:0]]) (23ms)
+103ms ║║Fast executing schedules, waiting for 1296ms to sync up
+1414ms ║║Executed physical command [mango Light].on() (13ms)
+1423ms ║║Cancelling statement #5’s schedules…
+1448ms ║║Executed physical command [mango Light].setColor([[hex: #FF0000, hue:0, saturation:100, level:50]]) (22ms)
+1449ms ║║Executed [mango Light].setColor (24ms)
+1451ms ║╚Execution stage complete. (1376ms)
+1452ms ╚Event processed successfully (1451ms)
04/11/2020, 17:36:00 +92ms
+0ms ╔Received event [Home].time = 1604511361370 with a delay of -1279ms
+83ms ║RunTime Analysis CS > 19ms > PS > 47ms > PE > 18ms > CE
+85ms ║Runtime (37088 bytes) successfully initialized in 47ms (v0.3.110.20191009) (84ms)
+86ms ║╔Execution stage started
+225ms ║║Executed physical command [mango Light].setColor([[hex: #000000, hue:0, level:0, saturation:0]]) (135ms)
+227ms ║║Fast executing schedules, waiting for 1052ms to sync up
+1294ms ║║Executed physical command [mango Light].setColor([[hex: #DC143C, hue:97, level:58, saturation:83]]) (12ms)
+1296ms ║╚Execution stage complete. (1209ms)
+1297ms ║Setting up scheduled job for Wed, Nov 4 2020 @ 5:36:06 PM GMT (in 4.981s), with 2 more jobs pending
+1304ms ╚Event processed successfully (1304ms)
04/11/2020, 17:35:55 +31ms
+1ms ╔Received event [Home].time = 1604511356369 with a delay of -1338ms
+62ms ║RunTime Analysis CS > 15ms > PS > 33ms > PE > 14ms > CE
+65ms ║Runtime (37088 bytes) successfully initialized in 33ms (v0.3.110.20191009) (64ms)
+66ms ║╔Execution stage started
+86ms ║║Executed physical command [mango Light].setColor([[hex: #000000, hue:0, level:0, saturation:0]]) (15ms)
+88ms ║║Fast executing schedules, waiting for 1251ms to sync up
+1364ms ║║Executed physical command [mango Light].setColor([[hex: #DC143C, hue:97, level:58, saturation:83]]) (21ms)
+1365ms ║╚Execution stage complete. (1299ms)
+1368ms ║Setting up scheduled job for Wed, Nov 4 2020 @ 5:36:01 PM GMT (in 4.972s), with 4 more jobs pending
+1374ms ╚Event processed successfully (1374ms)
04/11/2020, 17:35:51 +214ms
+2ms ╔Received event [Home].test = 1604511351213 with a delay of 1ms
+73ms ║RunTime Analysis CS > 18ms > PS > 31ms > PE > 23ms > CE
+79ms ║Runtime (37089 bytes) successfully initialized in 31ms (v0.3.110.20191009) (74ms)
+80ms ║╔Execution stage started
+92ms ║║Comparison (decimal) 22.1 is_greater_than (integer) 21 = true (1ms)
+94ms ║║Cancelling condition #2’s schedules…
+95ms ║║Condition #2 evaluated true (10ms)
+96ms ║║Cancelling condition #1’s schedules…
+97ms ║║Condition group #1 evaluated true (state changed) (12ms)
+99ms ║║Cancelling statement #3’s schedules…
+147ms ║║Executed physical command [mango Light].setColor([[hex: #DC143C, hue:97, saturation:83, level:58]]) (17ms)
+157ms ║║Executed virtual command [mango Light].flashColor (50ms)
+159ms ║║Requesting a wake up for Wed, Nov 4 2020 @ 5:36:06 PM GMT (in 15.1s)
+181ms ║╚Execution stage complete. (101ms)
+195ms ║Setting up scheduled job for Wed, Nov 4 2020 @ 5:35:56 PM GMT (in 4.961s), with 6 more jobs pending
+205ms ╚Event processed successfully (205ms)


#2

The temperature has to change for this piston to be triggered. The way you have this laid out right now, every time the temperature changes the light will be turned on. For testing, you might want to hit the sensor with a blow dryer or something.

Ultimately, I suggest you use ‘rises above’ as a trigger rather than the condition you have. Then it will only execute what is in the if-then when the temperature goes from below the value to above the value. You also need to move your actions inside the if statement.


#3

Thanks. I did realise that it was necessary for the temperature to change, and had been testing accordingly :wink:

I will try the ‘rises to’. I will try to work out how to move the action into the ‘if’
The dashboard seemed to invite it to be done the way I did it.


#4

Hmmm. Made changes but still not triggering scratches head
{UPDATE} It DID trigger the colour change ( I wasn’t in the same room, but saw nothing in the log - set to full)

However, it didn’t send the SMS. Does there have to be some payment mechanism for SMS?

05/11/2020, 11:37:44 +96ms
+1ms ╔Starting piston… (v0.3.110.20191009)
+139ms ║╔Subscribing to devices…
+145ms ║║Subscribing to lounge.temperature…
+194ms ║║Subscribing to mango Light…
+196ms ║╚Finished subscribing (68ms)
+283ms ╚Piston successfully started (281ms)

Temperature has reached 20.2 at time of writing.

What am I missing please?


#5

Hi,
SMS is only available in certain countries. US is included, UK is not, not sure of others. I believe there’s also a limit on how many you can send in a day.


#6

In addition to Paul’s tip… the code “rises above 20” means that one data point has to come in below 20 (where nothing happens) and then another data point has to come in above 20… (Thereby, rising above 20)

IE: The THEN block should only execute as the temp crosses the threshold.


#7

That explains it! Thanks


#8

New problem, same piston.
Once the condition is met and the action executes, it doesn’t run again until the next day.

Is there something I need to do eg to reset it, say if the temperature falls through a threshold?

BTW, the purpose of the piston is to remind us to switch off the gas fire, which has no thermostat or wireless controls, when a comfortable temperature is reached.

So the requirement arises if the room has cooled down, the fire turned back on (manually) and the temperature risen again.


#9

If you want a second “safety net”, you can copy your current block to a new block down below… and on the new block, change 20 degrees to 22 degrees (or whatever)

This gives you two events, in case the first one does not reset.


#10

If it truly cools down (19° or less), then there’s no need for any edits…
Piston “q4fw5” will trigger a second time when it gets hot again.

What I suspect is sometimes happening is:
The gas fire is manually turned back on before the temp drops below 20°.
In this case, the original piston will not trigger a second time.
Adding a second block to the bottom can force another trigger at 21°.


Setting your logs to Full can help clarify the details.
(you will see each temperature change)


#11

Thanks. I had created the second trigger, but as two separate pistons so far.

It seems to be resuming ok today, but for some reason did not seem to be working yesterday. It seemed to be failing to respond to the trigger and to log. I will keep an eye on it

Fingers crossed

Thanks