Subscribing to events from multiple devices breaks piston


#1

1) Give a description of the problem
I have a somewhat elaborate scheme for controlling the lights in my office based on the time of day and the light switch. It has worked great, as the time changes I have a global variable change from “morning” to “midday” to “afternoon”, etc. and the lights change. Similarly when I turn the lights on it sets the appropriate level for the time of day. Both the variable change and the light switch are subscribed to.

Where it went sideways is I wanted to also add the function to a smartthings button I have, so I added another condition to each block to say “if the light switch is on or the button gets held and the time of day variable = X” but the effect was now the piston ONLY subscribes to the button and ignores the light switch and variable.

2) What is the expected behaviour?
I expected it to operate off the switch or global variable, or button.

3) What is happening/not happening?
The piston stopped subscribing to the switch and the variable when the button was added, when the button was removed the subscriptions to the other two returned.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
2/6/2022, 6:13:35 PM +185ms
+1ms ╔Starting piston… (v0.3.114.20220203)
+1455ms ║╔Subscribing to devices…
+1581ms ║║Subscribing to Office Desk Button.button…
+1778ms ║║Subscribing to Laptop…
+1780ms ║║Subscribing to PC…
+1781ms ║║Subscribing to Desk Light…
+1782ms ║║Subscribing to Office Cabinet…
+1783ms ║║Subscribing to Office Lamp…
+1785ms ║║Subscribing to Office TV Left…
+1786ms ║║Subscribing to Office TV Right…
+1788ms ║╚Finished subscribing (351ms)
+1828ms ║Comparison (enum) on is (string) off = false (3ms)
+1866ms ║Comparison (enum) on is (string) on = true (1ms)
+1880ms ║Comparison (dynamic) night is (string) night = true (1ms)
+1914ms ║Comparison (enum) on is (string) on = true (2ms)
+1921ms ║Comparison (dynamic) night is (string) morning = false (2ms)
+1928ms ║Comparison (dynamic) night is (string) evening = false (2ms)
+1963ms ║Comparison (enum) on is (string) on = true (2ms)
+1969ms ║Comparison (dynamic) night is (string) midday = false (2ms)
+1992ms ║Comparison (dynamic) night is (string) afternoon = false (2ms)
+2007ms ║Comparison (enum) on is (string) on = true (2ms)
+2028ms ╚Piston successfully started (2027ms)


#2

Did you try forcing the subscription? The default is automatic but you can force the piston to subscribe by setting it Always subscribe.


#3

To embellish a bit, the above is a trigger, so all other conditions will remain conditions, unless you force subscribe.


#4

When you add a condition that is classed as a ‘trigger’, webCoRE interprets that as an explicit indication of when you want the piston to be executed. When you don’t have any triggers, just ordinary ‘conditions’, webCoRE doesn’t know when you want the piston to run so it tries to help you out by making the piston execute when the conditions might have changed.

As the others have suggested, you can actually override this ‘automatic’ behaviour for each condition/trigger and choose to ‘always subscribe’ or ‘never subscribe’.

The other alternative is to change ‘is on’ and ‘is off’ to ‘changes to on’ and ‘changes to off’ to make those triggers as well, or just add an extra condition for ‘switch changes’ that does nothing but will give you the subscription.


#5

Every so often you run into an issue where the resolution unlocks some new, critical fundamental understanding, this was definitely worth the journey, thank you all for the help!!