Is my repeat command right?

Trying to figure out why this isnt working as I thought. At one point I clicked on this rule and it briefly showed in orange lettering "Repeating...", so I think it's starting the repeat section, but it's never actually changing the dimmer.

The idea is this:

  • Button 5 pushed: Toggles my light strip to most common setting
  • Button 5 held: Each time I hold it, it will move to the next pre-set color, and then cycle the light level up and down until....
  • Button 5 released: Exit the rule "Button 5 held" immediately (so that whenever I let go of the button it stays at that color and level)

I havent tried to interrupt Button 5 held yet, cause I can't even get the dimmer cycle to work.

You didn't specify a time interval for your repeat. I'm not sure what the behavior of that repeat would be, but I wouldn't be surprised if not running at all was it. :slight_smile: It's undocumented behavior, in any case. Some interval is always required; in fact, the interval is all that is required, and then you just need some mechanism to stop the repeat, with "n times" being one way you can do that (I know it looks tempting to try that all on its own, but it won't just loop back to the beginning on its own like you think it might).

If that still doesn't help, try turning on logging for the rule (at least "Actions" logging). Then, in "Logs," you can see what the rule is running or skipping. If the actions inside the repeat are running but not working, my guess is that the Start Level Change command on your lightstrip is either not implemented (you'd see an error for that in the logs) or doesn't work in the way it would need for this to work (specifically, with the new level getting reported back in a reasonable timeframe; you could monitor "Current States" on the lightstrip's page in "Devices" to see if that's the case).

Ugh, looks like the Zooz Zen31 just doesnt support "Start Raising" and "Start Lowering"

No idea how to replicate this functionality. I can do "adjust level +10", but without some kind of loop/condition there's no way to keep doing it.

You can still loop, but you'd need different actions inside (and a defined repetition interval). Does the ZEN31 respond to transition times on a "Set Level" command? You can play around with this on the device page to see how it reacts. For example, if you start with the level at 50% like your rule would (put "50" for the first parameter in the "Set Level" box, leave the second one blank, then click the "Set Level" button to do this), then you could try doing a "Set Level" with paramaters 99 and, say, 5, which should fade it up to level 99 over 5 seconds if the ZEN31 supports that. If not, you could try a smaller time (2 or 3 seconds?), as devices may differ in what times they allow here, though some just don't support it and might ignore it.

If the ZEN31 does respect transition times on "Set Level," then that would be a good alternative to the somewhat awkward "Start changing..." and "Wait..." here (in general, I think this would be preferable even if the device did support the "Start Level Change" and "Stop Level Change" commands, which is what those RM actions run; this way, you get control over the rate of the transition and a defined end/destination level). If not, then this is apparently not a device high on features. :slight_smile: In that case, I'm not sure what to suggest besides a loop that keeps bumping the brightness up or down by a few percent at a time every so often, but that's likely to not work well (you're simulating what should be one command with any of the above options with multiple, repeated commands that is likely to make your entire network unhappy if they're very frequent).

So i'm playing with it. The parent-device supports raise/lower. But the problem there is that if you set the parent device to 50...the child will never go above 50.

But then you cannot set color of the parent, only the child RBG device.

I may look for a different driver.

Here's my next attempt but doesnt seem to be working. Is this right?

I think that will work, though normally I'd use something like:

IF (Dimmer level >= 91) Repeat every xx:yy:zz
   Adjust level

(that's a simple conditional on the repeat, sort of a "repeat while"). I've never tested it but would assume that what you have does the same thing, just with a few more clicks.

However, I'd be extremely cautious using a 0.01s repeat interval. RM will likely let you, but anything that fast seems like a good way to cause problems. :slight_smile: At the very least, I'd start testing it with larger intervals (it would be easier to log and see what's happening, too) and see how far you can work your way down until it both creates the effect you want but also gives Rule Machine some time to breath.

I didnt know you could combine an IF and repeat! That's almost a proper "LOOP" now i can do things a whole lot of different ways. THANKS!

Let me change the logic here...

Excellent! Here's a post from Bruce on repeated notifications in RM, but the fact that notifications are happening inside the loop isn't really relevant if you ignore that and consider it a demonstration of different styles of creating repeats instead:

Wait no that doesnt work. How would I know when it has reached 100% to stop repeating?

I need a "Repeat While (condition)" if i wanted to not have to check status every repeat cycle.

In my example, if the level is >=91, the repeat will stop. (See the post I linked to above for an explanation if you're not sure how this works.) You have to have a way out of the repeat somehow, and either of these methods is checking the level--mine before the next repetition starts, yours as the last action inside the repetition.

That being said, all of these options are poor alternatives to startLevelChange and I'm not sure most people who try to fake the same effect with a repeat ever have much luck, so while it theoretically should work, I wouldn't be surprised if real-world outcomes were not always as ideal. :slight_smile: If there's a way you could make that work instead, you'll probably be happier in the end. Alas, I don't have a ZEN31 so can't tell you much about how this would work with that device.

At this point it's more about learning RM properly and how to make it do what I want it to for other things in the future.

I just wouldn't expect an IF to ever be re-evaluated if the repeat is contained INSIDE the IF

It seems like it might not work, but it does. It's a simple conditional on the repeat action, not technically a repeat inside a "full" IF. I'd say that's what gives it the magic here. Again, the post I linked to above has a few examples and explanations. It's written by the RM author, so you can trust it. :slight_smile:

1 Like

So my whole problem here, in the end was the Hubitat Driver for Zen31. its kind of a mess with it's child devices.

The parent device level, trumps the child device level....but you cant use "Set color and level" from RM on the parent device, only the child....butt then the child device doesnt support "Start Raising Level"... etc

The ported ST driver that @agnes.zooz linked in the thread below is SO much better! Something should be done between HE and ZooZ to get this functionality in the default HE Zooz driver.

I spoke too soon. There's still so much weirdness with it.

Frustrating because this cheap Chinese made RGB Zigbee controller I bought does pretty much everything right just using the generic driver....but the Zooz device is superior in every way....except that I can't make it behave properly because of the driver.

Wish i had the time to fix it myself. I want to use all RGB strip lighting when I re-do my dining room and lounge/bar area. But this control isnt quiet right yet