Toggle brightness

I have things set up so that at a certain time of night, my front porch lights dim to 50%. But, sometimes I want to keep them at 100% if someone is coming over. I have a button that I use for this, but what I've had to do is as follows. I have a virtual switch called Porch Bright. I set up a rule that when that switch is on, it sets the brightness of the lights to 100%, another rule that sets the brightness to 50% when the virtual switch is off, and a third rule that when the button is pressed, it toggles the brightness.

I'd like to clean this all up, but here's the problem. When I tried making the rule to toggle the brightness, it only gives one brightness to toggle to, so say, 50%. When I tried that it toggled between that on off. Is there anyway to tell it to toggle between two brightness levels, and then any way to have a button do the toggle?

Is your goal to have a press of the button "toggle" the light between off, 50%, and 100%? (Sort of like a three-way bulb?) If so, rule actions (in Rule Machine) like the following should work if they are the actions to run for that button press:

IF (Light is Off) THEN
  Dim Light to 50%
ELSE-IF (Light is on AND Level < 75%)
  Dim Light to 100%
  Off: Light

You can adjust that middle conditional as needed; I just chose a value about half way in between your two "target" levels in case you want the light to act the same way should someone happen to have changed the level manually or if your light doesn't report the exact level you chose (with some devices, you might get some rounding that makes setting the bulb to 50% give you a reading back like 40% or 51%). If you've never used Rule Machine to create conditions before, by the way, in the first IF you'd want to use the "Switch" capability, while in the ELSE-IF you'd be creating an AND (complex) conditional that tests things from both "Switch" (on/off) and "Dimmer" (level).

And, of course, all of this assumes that your lights accurately report states back to the hub. It may take a second or so for some devices (so you might not be able to mash on the button in quick succession and have it do this right away). If this doesn't work, the alternative is to have a rule track the number of recent presses on your button and act accordingly, which is more complicated to set up (though I wrote a custom app that actually might do about what you're looking for if that is it).

When this would be in use is if the bulbs are already on. After a set time, they dim to 50%. I want to hit the button and have them go to 100%, then later hit the button again and go back to 50%.

Tinkering with what you have, I changed it to the following, and it's working. Thank You for pointing me int he right direction.

IF (Dimmer level of Porch 1, Porch 2(50, 50) any is > 99(F) [FALSE]) THEN
Dim: Porch 1, Porch 2: 50
IF (Dimmer level of Porch 1, Porch 2(50, 50) all < 100(T) AND
Dimmer level of Porch 1, Porch 2(50, 50) any is > 0(T) [TRUE]) THEN
Dim: Porch 1, Porch 2: 100