Last update broke global variable subscription


#1

**1) Give a description of the problem
Changes to the global variable will fire the piston but it takes no action and just cancels out.
As you can see from the logs below it is subscribed to a wierd piston that is not mine… :f5de12400c39d52389952a4d4a0c4b04:
Also when running a trace it keeps referring to #1 but there is not a #1 in my piston.

**4) Post a Green Snapshot of the piston


Global variables update faulty
#2

Would someone mind importing and testing this piston, It is not working properly and I want to know if its just me!
you will also need to create a global variable @string


#3

It works using if @string changes instead, did the on events block previously trigger for variable changes?


Pistons aren't firing off variable change
#4

Yes it did, but I will gladly go through and change my pistons if what you say is correct…
THANK YOU!


#6

Hmm well there’s still some work to be done here but at least that is a temporary workaround. I noticed that there is no lightning bolt icon when a variable is used in on events which indicates that a subscription is not being made.

I’ll take a look now that we have something to compare. Can you please drop a link in your other forum and GitHub threads to this one so we keep the discussion in one place?


#7

Thanks for your persistence on this, the sample piston was very helpful.

I pushed out a new release today which fixes on events from for both global and superglobals. The addition of superglobals (spans multiple webCoRE installs for the same location) changed the event name for normal globals and on events from was filtering out events based on the prior name. Please update and give it a try, you may need to re-save pistons that used on events from with globals.


#8

Seems this change may also have affected the ability to use a global variable as a trigger. In my pistons I have several triggers based on global variables that no longer work as expected. They do show a “lightning bolt” next to them indicating they are subscribed to, but the piston is not firing when the variable changes. I have worked around it by creating a virtual switch and using it’s status to trigger the actions, but IMHO using the variable trigger was more “elegant”.

I have one piston that using virtual switches to trigger will be a bit more complicated so if this change that is preventing me from using the global variable as a trigger was unintentional I would love to see it fixed.


#9

Are you using the latest update from Nov 9, v0.2.0fe? Part of the test for that update was a set of two pistons where one changed the value of a global variable and the other triggered on changes to that variable. It’s still working properly for me using either an if @myVar changes or on events from @myVar.


#10

Yes, using the latest version.

I am currently using both:

  1. if @myvar changes
  2. if @myvar changes to whatever

it seems # 1 works, but #2 no longer does?


#11

I’ll need to see an example piston, both work here.


#12

my pistons seem to be working again, perhaps it was just a glitch.