Pistons aren't firing off variable change


#1

1) Give a description of the problem
Variable change isn’t triggering other pistons.

2) What is the expected behavior?
When the variable (integer) @homePopulation changes, things happen.

3) What is happening/not happening?
Nothing is happening.

4) Post a Green Snapshot of the pistonimage
Here is the piston that tracks my home population:

And here’s a fuel stream that keys off that variable. This piston has not run since 10/26, even though we’ve left the house quite a bit since then.

5) Attach any logs (From ST IDE and by turning logging level to Full)
This is a log of the population tracker piston running last night.

11/7/2017, 8:29:33 PM +88ms
+1ms ╔Received event [Zac’s Pixel].presence = present with a delay of 104ms
+142ms ║RunTime Analysis CS > 21ms > PS > 30ms > PE > 92ms > CE
+157ms ║Runtime (40407 bytes) successfully initialized in 30ms (v0.2.0fd.20171105) (155ms)
+158ms ║╔Execution stage started
+172ms ║║Comparison (enum) present changes_to (string) present = true (0ms)
+173ms ║║Condition #5 evaluated true (10ms)
+177ms ║║Comparison (integer) 1 is_less_than (integer) 2 = true (1ms)
+178ms ║║Condition #6 evaluated true (4ms)
+179ms ║║Condition group #1 evaluated true (state did not change) (16ms)
+181ms ║║Cancelling statement #3’s schedules…
+187ms ║║Calculating (integer) 1 + (integer) 1 >> (integer) 2
+190ms ║║Executed virtual command setVariable (1ms)
+196ms ║║Calculating (string) Current population: + (string) 2 >> (string) Current population: 2
+199ms ║║Executed virtual command setState (0ms)
+211ms ║║Comparison (enum) present changes_to (string) not present = false (1ms)
+213ms ║║Condition #9 evaluated false (11ms)
+214ms ║║Condition group #13 evaluated false (state did not change) (12ms)
+216ms ║╚Execution stage complete. (59ms)
+223ms ╚Event processed successfully (223ms)

I also have another piston that keys off @homePopulation rising. That piston hasn’t run since 11/2.


#2

I may be wrong, but I believe global variables cannot act as a trigger, only a condition. Notice not lightning bolt next to the statement.


#3

Well this is weird. I just got home and the fuel stream had run. What the…


#4

You can definitely use global variables as triggers. just make sure to always subscribe to them and it’ll give you the lightning bolt.

I use this type of stuff all the time


#5

@elmetal I created a topic the other day stating that my global variables are not subscribing properly and therefore not firing properly. Would you mind confirming/testing one of your pistons that subscribe to a global variable event, and let me know if it is working?


#6

as you said, some update somewhere must’ve done it. my Away piston which uses some global variables is not working. Dangit. It used to work fine!


#7

A temporary fix to this problem has been found by @ipaterson in the following thread, post #3.
Last update broke global variable subscription