FlipFlop - I'm such an idiot!


#7

Perhaps I don’t understand your suggestion, If condition #1 do this and if condition #2 do this (this is what I’m prevented from doing in Webcore)…else do nothing.


#8

My piston above basically says this:

When Momentary Button Tile is pressed, compare the switch on White Bulb 2 and White Bulb 4. If they are the same, do nothing. If they are different, then toggle both of them to the opposite.

Try pausing your piston, and importing mine.
It should work right out of the box.


#9

Here is the same piston with a few comments that might help:

temp


#10

I response…no, the two bulbs would not match. If bulb #1 is on and bulb #2 is off then do something, if bulb #1 if off and bulb #2 is on the do something else, otherwise (bulb #1 & bulb #2 is either both on or off) then do nothing. My question is related to the fact that WebCore does not allow me to create a set of ELSE IF actions. WebCore simply will not allow me to “Click” on Add Action and ignores this request.

I’ve also tried to copy/paste the actions of condition 1 (LINE 26 to LINE 35) to paste to LINE 43…but it will not allow me to do that.


#11

Ahhh. I did not know that you want DIFFERENT actions if (2 on/4 off) versus (2 off/4 on)…

Originally you said:

My piston above achieves this nicely…


#12

If you want different actions depending on which bulb is on, then here is a solid structure:

IF MomentaryButtonTile changes to on  <-- Trigger
Then
    IF WhiteBulb2 is on               <-- Condition
    Then
        IF WhiteBulb4 is off          <-- Condition
        Then 
            Do cool action #1  (2 was on, 4 was off)
        END IF
    ELSE
        IF WhiteBulb4 is on           <-- Condition
        Then
            Do cool action #2  (2 was off, 4 was on)
        END IF
END IF

(Be careful with the indents here)

If both bulbs are on (or both bulbs are off), then nothing happens…


#13

Nope, that’s still not what I want. There are 4 different possibilities (B1 and B2 are the both on, B1 and B2 are both off, B1 is off but B2 is on, and B1 is on but B2 is off). I only want actions if B1 and B2 are different.

By the way, the problem isn’t with my logic (at least I don’t think so). It’s the fact that WebCore will not allow me to create (or copy) code to the second condition at line 43.


#14

BOTH of my pistons above do this perfectly!!!

My last (hand written) piston gives you the bonus option of different commands depending on WHICH bulb was on…


#15

If you are having a hard time seeing all 4 possibilities in my last piston, here it is with extra info:

IF MomentaryButtonTile changes to on  <-- Trigger
Then
    IF WhiteBulb2 is on               <-- Condition
    Then
        IF WhiteBulb4 is off          <-- Condition
        Then 
            Log "2 was on, 4 was off = Do Action #1"
        ELSE (*)
            Log "2 was on, 4 was on = Do Nothing"
        END IF
    ELSE
        IF WhiteBulb4 is on           <-- Condition
        Then
            Log "2 was off, 4 was on = Do Action #2"
        ELSE (*)
            Log "2 was off, 4 was off = Do Nothing"
        END IF
END IF

The extra two ELSE blocks (starred) are not needed, but I added them so you can (hopefully) see all four variations.


#16

I tried what I think you are suggesting…but ended up with the same result. WebCore will not allow me to create a WITH/DO at line 51. Here it is:


#17

That is nothing like any of my pistons above…
(You have literally ignored everything I have said)

Honestly, I do not feel like investing any more of my free-time on this one… but I wish you the very best in all your endeavors…


#18

You’re right…I screwed up. However, correcting the code I end up the the same result in that I can not add actions at line 53.


#19

A question you might ask yourself is:

  • Are you determined to force your current piston to do what you want?
    or
  • Is your goal to get a reliable piston to do what you want?

I can only help with the second choice…


#20

I simply want it to work…it seems so simple but WebCore does allow the second ELSE IF with anything I try. I’m not trying to be difficult but what did I do wrong in my second posting…it seem to be exactly what you are suggesting.


#21

There are numerous things that I would change with every piston you posted here… Instead of trying to fix each and every issue, I took the time to share a clean/concise piston that does everything you asked for, with no hassles.

My recommendation would be to PAUSE your current piston, and try creating a new piston based on my code

If you are still in need, I can convert that text into an piston (that you can import) in about 40 hours from now…


#22

You keep reposting the same image (code ‘ivpn’) so can’t tell you are doing anything @WCmore is suggesting. I tried loading you code and there are links to add statements after every condition statement so I don’t understand where you are having a problem. You might have to capture a screen shot while you are in editing mode. I don’t see how what you are saying can actually happen in webcore.


#23

I’d say, stay away from ELSE statement until you get a really good grip on Webcore, even then still stay away:)))
Like @WCmore I have way over 100 active pistons and more paused pistons, with a very complex St home system, not a single ELSE usage in my pistons…


#24

I went back and looked at this again with fresh morning eyes and now got everything working as expected. I appreciate your help and patience.


#25

Excellent!

Perhaps you can share your piston so others can benefit from it?


#26

Sure…see below: