Odd WebCore device variable behaviour

I use the device variable almost everywhere but I have one piston that now refuses to let me save the If statements when I change the actual device with the variable.
e.g. Garage Motion 1 can't be substituted with the MotionDevices var as the drop down doesn't let me pick active/inactive.
I have notice all my other pistons change to "If Any of devName" when they are saved but this one is just "If devName "
Most likely a corrupt piston? It does happen to me once a year usually.


With a physical device
image
With a variable
image

I'm not totally clear on your use case, but why can't you just use an expression and type in "active" or "inactive"?

I certainly can work around this. The post was just to see if anyone else has noticed this anomaly.
I have 111 pistons and I can substitute defined device variables and not loose the drop-down choices that you get by using the actual device itself.
I will most likely delete and recreate this piston or restore from an old backup and see if the drop-down populates properly.

I would think the device variable takes on the attributes of the device assigned to it, so have you tried just deleting the device variable and recreating it?

I have tried creating a whole new piston and I can't get the drop-down to populate like it does in other pistons. It's like it doesn't parce the items in the local var and see what capabilities are exposed.
Curiously, I can copy a statement from a "working" piston and paste it in a new piston and it works as I expect; the "Any Of" is fine and the capabilities of active/inactive are there.
Maybe something is amiss, I don't know. @ipaterson

Does a similar thing happen when the variable is populated with other device types in that same piston or does it only seem to affect the garage motion type?

I would try deleting the variable and recreating with the same name to see if the variable value is corrupted with a deleted device or something. However, if the new piston you created was from scratch rather than from a backup code that probably won't change the behavior.

The piston is created from new.
I tried a different device of type, Lock.
If I create a device var and try to use it in an If statement I get the same behaviour; the section is only Physical or Expression an no choice of Value for Lock/Unlocked.
If I cut and paste an "If Any of {devxxx}" from another piston the dev var works as expected.

  1. Are there any errors in the browser's dev console, particularly any that recur when opening the condition editor?
  2. Does motion appear above this line or below "Generic attributes" for devMotionDevices?

Ok, run away and don't bother Ian anymore. :wink:
Finally clicked after staring at your example.
I was picking "If variable compares to" like some nube because it is indeed a variable.
In reality it's really treated as a Device and I forgot to choose Physical (as it's really just a pointer to a list of Physical)) scroll all the way to the bottom of the Device list so see the Device variable name.
So focused on picking the local variable name as that's the one that shows at the top of the list.
Confusing explanation I know.

1 Like