I have this flow where I set a variable, and to test it I’m doing something like “output current variable state, do actions, change variable, output state again”. The problem is that the first output gives the wrong value - which means the planned if test won’t work.
Anyone know if there’s something I should do to get the correct’s value?
What happens here is that I manually set my variable, and based on the change in the variable I start the flow. Entering the flow, the variable still isn’t set correctly, but the call is still made. That’s pretty strange…or did I just have a mind fart?
EDIT You created a loop. When you let the var be set to ‘No’,
the same var is changed back, and it then triggers the flow again.
No, I accidentally created a loop, i used the ON instead of OFF in the "set ‘var’ to NO card.
Just out of curiosity - are you sure there’s a loop? There are two similarly named vars - one AllOn and one AllOff. When AllOn is set to yes, the AllOff is set to no and vice versa. The start block is just to test by setting one of them to yes and make sure the other one is set to no.
Please correct me if I’m wrong. I really appreciate the help
It kind of makes me wonder why there’s a event for changed variables, if the variables take time to set. The only reason I can see for an event like that is to react, but then you have to test the value first. If there’s a delay, then the event shouldn’t have been raised until the variable had been set?
Or am I missing something? I my head, I need to do the following:
Listen for the event that my variable changed
Test it and react according to the value
Execute my actions
This translates to:
Listen for the CompoundAll[On|Off]Active
Find if it’s set to “yes”, then
Set all the other variables to “no”
I’d love to hear your (or anyone elses) opinion about this.
@Peter_Kawa Sorry about the last one. For some reason, copying the field in the app doesn’t copy everything - and I’d never seen the output before and didn’t know what to look for. Hopefully this will work.
That’s really strange…Mine comes in as “yes”, I change it, when I write the variable again it’s still “yes”…Maybe I need to contact support, then? The whole behavior is contra to everything I know from development, and I just created this little snippet to test it out.
Excuse me, but I don’t quite get it.
If I change “CV_Off” from No to Yes, then “CV_On” is automatically changed from Yes to No. And of course vice versa. And this doesn’t work for you?
Are there any other flows with these two variables?
Hmmm…that shouldn’t be an issue. I know I have flows setting these variables, but as far as I know there are no flows intercepting the change. I did try to change the variables (I had to reboot the Homey to access them, which was strange), and that seemed to work - so I’m not ruling anything out.
Do you know a way to see which flows uses variables, like you can look at a device and see which flows they are in?
Actually, you dont need to copy the TEF yourself.
After you press Create TEF, the TEF is automaticly placed in your clipboard, so you just need ctrl+v to paste it somewhere
Flow import worked, I adjusted it with added ms timestamps.
It seems to work well. @Tiwas How did you test?
When I switched the start button I saved the flow every time. Then I ran the flow by rightclick on it’s name and hit ‘start’.
ON 2 - var AllOn: true (--- var AllOff: false) @ 04T15:51:13.950Z
ON 1 - var AllOn: true @ 04T15:51:13.828Z
ON 1 - var AllOn: false @ 04T15:51:02.367Z
OFF 2 - var AllOff: true (--- var AllOn: false) @ 04T15:51:02.354Z
OFF 1 var AllOff: true @ 04T15:51:02.255Z
OFF 1 var AllOff: false @ 04T15:50:52.300Z
ON 2 - var AllOn: true (--- var AllOff: false) @ 04T15:50:52.291Z
ON 1 - var AllOn: true @ 04T15:50:52.199Z
ON 1 - var AllOn: false @ 04T15:50:34.232Z
OFF 2 - var AllOff: true (--- var AllOn: false) @ 04T15:50:34.224Z
OFF 1 var AllOff: true @ 04T15:50:34.123Z
Anyway - it showed what I believed to be true: those two variables are only in use in two places, they are set in scripts. No other events for handling them if they change.
One question, though - does the script look in advanced flows as well?