Condition Not Correct


#1

1) Give a description of the problem
My piston’s not firing

2) What is the expected behaviour?
Speach should happen stating bottle is done

3) What is happening/not happening?
It’s being evaluated as false instead of true

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
8/25/2019, 12:59:36 PM +227ms
+2ms ╔Received event [Bottle Warmer].switch = off with a delay of 106ms
+119ms ║RunTime Analysis CS > 29ms > PS > 48ms > PE > 41ms > CE
+121ms ║Runtime (37517 bytes) successfully initialized in 48ms (v0.3.10e.20190628) (119ms)
+122ms ║╔Execution stage started
+129ms ║║Comparison (enum) off changes_to (string) off = false (1ms)
+130ms ║║Cancelling condition #6’s schedules…
+131ms ║║Condition #6 evaluated false (5ms)
+132ms ║║Cancelling condition #4’s schedules…
+133ms ║║Condition group #4 evaluated false (state changed) (7ms)
+135ms ║╚Execution stage complete. (13ms)
+136ms ╚Event processed successfully (136ms)


#2

What is the switch? Brand/model? Hopefully not a TP-Link Kasa


#3

For something to ‘change’, the piston must have a benchmark to compare against.

Thus, an ‘on’ event is required before the piston will recognise an ‘off’ event as a ‘change’. (only required the once after saving a piston).

Are you saving the piston then turning off the switch? perhaps try toggling the switch on/off to see if that sets things in line.

Please post sequential logs for an ‘on’ event followed by logs for an ‘off’ event.

Anyway, as you only have a single trigger statement in your piston, try using the condition ‘is off’ instead of the trigger ‘changes to off’.


#4

It’s actually one of those Ikea plugs that are popular as a repeater.


#5

Yeah so this one has been hard to figure out cause some times it triggers and some times it doesn’t. It’s only within the last few weeks and it seems to be more frequent recently.

Yeah so if I switch it on and off it will trigger it.

I have smartthings putting a usage limit on it so after 5 minutes it turns off and as I mentioned doesn’t seem to be announcing that lately.

Would it be better to put my condition to “changes to on” followed by 6 minutes “changes to off”
Will the announce ment just keep going if a change the even to is off?


#6

The followed by statement is buggy as hell in my opinion… I avoid using it for everything I do.

The ‘is off’ statement will trigger every time it turns off, but if you only want an announcement if it was previously turned on within the past 6 minutes, try something like the following:

IF Switch 1 IS off
AND
previousAge(Switch 1 : switch) is less than 360000
   THEN
      do stuff

Change ‘switch 1’ in the previousAge() expression, to exactly match the name of your device.

btw 360000 = 6 minutes in ms


#7

That’s really to bad, I just discovered it and it made writing some stuff a lot easier.

Ok perfect, I’ll give this a go! Thanks!