Why is this bulb dimming rule not working as expected?

I completed writing this rule at 10:46 AM. When 10:48 AM occurred the bulb never dimmed to 10. You can see in the log it doesn't look like the script did anything after 10:46 AM. I did refresh the logs several times. I'm simply trying to dim a bulb to 10 at one time, then dim it back to 100 at a later time. There must be a better approach.

"Time is..." triggers aren't susceptible to timing or repetition issues, so using a PB isn't necessary with them.

Using the very same time at both ends of a "Time is between" conditional isn't good logic.

You're sending an Off command immediately after each Dim command - what are your intentions with that?

Why not this...

Trigger = time is xx:xx
Actions:
Dim light - 10
Delay 2 minutes
Dim light - 100

4 Likes

Adding to the above, which would be a better way to do this, the logs are clear about why this happened: your required expression is false (both in the logs and in your screenshot). Your trigger will never fire the rule when that is the case, as spelled out in the documentation, which I'd again encourage you to read, and many previous discussions, which I'd encourage you to review to help retain.

5 Likes

I concur.

A simpler way to do this would be, assuming you are looking to flash the light at power 10 for a set time (ex.: 10 seconds) and then flash it again at power 100 for the same:

(If it should remain on, then the Ā« Wait for elapsed time: 0:00:10 Ā» and the Ā« Off: Patio Light Ā» should be removed in both instances.)

Define Required Expression:
None

Trigger:
When time is 10:48 AM

Select Actions to Run:
Dim: Patio Light: 10
Wait for elapsed time: 0:00:10
Off: Patio Light
Wait for elapsed time: 0:02:00
Dim: Patio Light: 100
Wait for elapsed time: 0:00:10
Off: Patio Light

2 Likes

I'm trying to dim the bulb to 10 at 11:30 PM. Then set it back to 100 at 7 AM (Or sunrise). These times are just for testing purposes.

-Thanks

1 Like

In that case (long period in between, especially crossing over from one day into another), I'd just use 2 seperate rules - one for each time trigger.

ETA... "Time of Day" is an option to use when building a conditional. Leveraging that should enable you to keep it all in one rule with both times as triggers.

1 Like

I did not originally use a PB, but thought I'd try it. Yes! Your solution of using a delay is much better. The reason I was using two identical times was that there is no "time is" action parameter like there is for the trigger.

-Thanks

Here is what I wound up with after discovering the "wait for event" command. Once I receive my dimmable bulb for my bedroom I plan on setting it to 10 shortly after bedtime. Then when getting up in the middle of the night the light is less harsh. Then restoring to 100 in the morning.

Thanks again.

image

You still have this problem with your new rule, so I'd look at this question again:

Unless you're maybe just looking for a brief flash of light, you might as well just use the off and get to the same result faster. :slight_smile: But I suspect that's not what you're wanting. What is?

3 Likes

Because if I do a Dim: Patio Light: 10 the light remains on. I didn't see any other way to handle it so I just turn it off after each Dim command.

2 Likes

After reading through this thread, I still can’t understand what your goal in creating this rule is.

It has something to do with setting light levels late at night, I think.

You would probably help others by describing, in words, what you’re trying to accomplish.

ETA: when you keep changing the times in your rule screenshots, that adds to the confusion IMO.

7 Likes

Is the purpose of this rule to turn your bedroom lights on at 10% late at night (from an off state)?

2 Likes

I'm also confused, but without an answer, my new guess is that it's to set the "default" state of the light for future "on" commands or perhaps physical switching. The exact behavior of the latter depends on the device and the options it offers, but many will default to the last level.

About any automation/app should have a less awkward way to do the former (do it there instead?), but I suppose it's an interesting workaround for the latter if the device can't do anything else on its own.

In any case, questions like these were an attempt to figure that out:

Next time, please also share such a description of your rule (what you want it to do, in plain language, not Rule Machine terminology or assuming any intentions from what is already written), in addition to Logs, to make this kind of help easier. Thanks!

2 Likes

In my original post I said:

"I'm simply trying to dim a bulb to 10 at one time, then dim it back to 100 at a later time."

I have the rule below which does what I want. To clarify I'm using the patio light for testing. Once I get the dimmable smart bulb for the bedroom this will change somewhat.

Thanks

That rule in your screenshot is dimming a bulb to 10%, then turning it off.

Then some amount of time later, it’s turning it back on at 100%, and immediately turning it off again.

3 Likes

Right, but that's not what you're doing. You are dimming it to 10 and then immediately turning it off. Assuming the off is intentional, there was no mention of this desire in your description (or any reason as to why you might want to, a question that still remains).

1 Like

That's only because dimming it turns it on and I want it off after dimming. Unless there's a way I'm unaware of to keep it off when dimming?

No, that's probably the way, but the "why" would still be interesting to know. It's possible another approach would work better if turning it on later uses an automation, assuming my guess (which is just that without more information) is correct. Again, the reason so many people asked is because this information was neither shared originally nor after many attempts at clarification.

Again, I still don’t understand what you’re trying to do.

It’s impossible to help if you don’t explain the actual goals you have in mind.

Your screenshots are about a patio light.

You mentioned something about a bedroom light.

What is it you want to have happen in your bedroom related to lighting late at night?