Why is this piston not triggering automatically?


#1

1) Give a description of the problem
I’ve got a simple piston to turn a light on and off based on time of the day (for certain days in the week) but it doesn’t trigger automatically despite me forcing a subscription on the time condition.

2) What is the expected behavior?
Every weekday at 9pm the piston should switch the light off and send me a notification. And then turn it back on at 10:15pm and send me another notification.

3) What is happening/not happening?
Piston is not automatically triggering and I see a message at the top of the piston which says “This piston does not subscribe to any events. Unless executed by other means , it will never run on it’s own”

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
10/13/2017, 8:59:59 PM +153ms +1ms ╔Received event [Home].time = 1507924800000 with a delay of -847ms +144ms ║RunTime Analysis CS > 28ms > PS > 60ms > PE > 55ms > CE +155ms ║Runtime (39187 bytes) successfully initialized in 60ms (v0.2.0fa.20171011) (153ms) +156ms ║╔Execution stage started +169ms ║║Comparison (enum) off is (string) on = false (1ms) +170ms ║║Cancelling condition #6's schedules... +171ms ║║Condition #6 evaluated false (9ms) +172ms ║║Condition group #1 evaluated false (state did not change) (10ms) +173ms ║╚Execution stage complete. (18ms) +179ms ╚Event processed successfully (179ms)


#2

its triggering, but the condition group is not true because the keypad switch was off.


#3

Ahh right, so how do I code it so that it doesn’t matter if the physical switch is set to off? Because it’s a 2 way switch so the switch will often be in the off position even though the light will be on…


#4

you seem to be turning off and on the keypad instead of turning off and on the light … not sure why?


#5

Erm what do you mean “keypad”?


#6

from the snapshot the turn off / on actions seem to be done with the keypad not the light?

image


#7

Oh, that’s just the anonymous snapshot anonymising the device being used isn’t it? I’ve noticed it does that with all my anonymous screenshots and picks a random different device type. That on off logic is being applied to the light om wanting to control…


#8

yes its anonymized but i havent seen anonymous screenshot use the same token for 2 different devices so a little puzzled with that.

in the if where it says keypad 1 switch is on, is that a keypad or the light?


#9

What do you mean 2 different devices? There is only one device involved in my Piston…

And in that if, it’s the light, no keypad.

I’m basically saying if the light is on, then at a certain time swith it off and then back on again a bit later. If the light isn’t on in the first place, then do nothing…


#10

got you. sorry was thinking you were using a keypad push to turn on a light :slight_smile:

you mentioned previously that there is 2 way switch involved? is this 2 way switch a smart switch? the light you are controlling is also a smart bulb? if the light is behind this switch, trying to understand how the light can be on when the switch is off?


#11

No probs :slight_smile:

So this light can be controlled by two physical switches. Behind one of those physical switches I’ve installed a Fibaro module so I can control the light via ST and webcore. So because it can be controlled by two physical switches it may end up on even though the physical switch the Fibaro module is connected to is off (because we’ve used the other physical switch to turn the light on)

Does that help?


#12

thanks yes. how about the light is it smart light? if its not a smart light and it was turned on using a physical switch which is not smart then there isnt really no a way to check if its on or not.


#13

The light itself isn’t smart. Hmm but say I switch the light on from the physical switch which is not smart, if I look in ST it says the light is on. So it knows the light is on even though it wasn’t switched on via the app or the switch controlled by the Fibaro module. So if that’s the case, why can’t I have a Piston which checks the status of the light (regardless of position of physical switches) and turns it off and on based on timings…?


#14

as you said the light is not smart and not connected to ST. so when you are checking in ST for the light, what device are you checking?


#15

It is connected to Smartthings though, using the Fibaro module behind one of the physical switches which controls it…:face_with_raised_eyebrow:

With that I can turn the light on and off from ST. Therefore I should be able to control it using a webcore Piston. The Piston did work for a week or two turning the light on and off as per my timings but then randomly stopped and I’m not sure why. You’re suggesting it’s because the Piston is checking the position of the physical switch the Fibaro module is connected to and if the swith is in the off position the Piston thinks the light is off even though it may be on. So if that’s the case I guess my question is, can the Piston check for the status of the light itself rather than the physical switch?


#16

the light itself is not connected to ST, its the fibaro module thats connected. when checking if the light is on its really checking if the fibaro module is on. for this to work when the light is switched on using the physical switch that does not have the fibaro module connected, does the switch with the fibaro module connected show on or off in ST?


#17

It shows on. The light was on and it was showing as on in ST. I then turned it off from the physical switch that doss not have the Fibaro module connected, and in ST the light changed to being off. Then I switched it back on with the same physical switch and the light showed as on in ST.


#18

ok. keypad 1 refers to the fibaro switch I am assuming.

I think I see what’s going. change the time happens daily to time is between. that should fix it.


#19

Yep keypad 1 is the Fibaro switch. OK, I’ll make the change and report back…thanks!


#20

Looks like this did the trick :+1:t4: