Simple lighting

wish I knew what that was lol

I am not familiar with Homekit. Could you screenshot what you have there? It would be interesting to see how that rule is written.

Well yes and no. It isn't that hard to write a rule in general, but it is hard when you have conflicting logic, which you do here. You can't have something happen before it happens.

Take it back to the beginning and start with your requirements. Don't look at it from a rule perspective, just a wish list.

Here is what I think you want, but feel free to add or remove things here.

Off at 8 PM no matter what.
On at sunset OR when below a certain light level (cloudy days)?


I think this is the cause of most of the issues here. I agree with removing that, even if it requires more triggers or conditions.

That is what I am thinking too. However, that apparent requirement of light level being taken into account won't work if there isn't a Lux sensor of some type to feed that into this rule.

1 Like


that is exactly what i want for the outside lights, I recently had to mess around with my internet settings as I was dropping devices, I haven't got all the bugs out yet and my iPad that is the Registerd home has locked me out from editing etc. I will try a quick fix of removing myself and adding myself back into the home later so I can show you a photo of the time automations with HomeKit. for now I will send a pic of the main page but will get this too you later. I am currently a bit ill with covid and in isolation so can't walk around the house when I want and will need masks n gloves when I do stretch my legs later

that looks good, if I keep playing I might get there

I don't know what you did but is this in the right direction?

that's got to be close

You need to move the if(not time between) portion to the top of the "actions to run" and remove the "wait for event" action. The "if" statement should be "IF(Time between 4 PM and 7:59 PM)" like @kahn-hubitat posted above.

Use rule as i had it and write a second rule 8:00pm

1 Like

I think I just made it worse lol, the rule doesn't appear to be broken do you think it will work

Remove the second if statement.

Also be aware if using kasa tplink wifi switches (i have about 20) there are notoriously unreliable and go offline temporarily frequently. You may want to write another rule to check if on or off later to increase reliability.

Put an off command directly in the schedule in the kasa app for the switch at 8:00pm that should take care of thr reliability at least for the off command.

I'm still not sure we have the requirements straightened out.

From above it sounded like the goals were:

  • "set times sunset" - use Sunset as the trigger to turn on the lights. However, sunset times can fall after 8 pm (as late as 8:58 from the screen cap of the rule) so during the time when sunsets are very late, the lights wouldn't turn on using Sunset as a trigger, since you want to have the lights off after 8 pm.
  • "when its dark to turn on" - This sounds like a lux requirement, don't turn on unless it's "this dark." Do I get that right?
  • "but not after 8pm" - From this and other statements I get: 1) Don't turn on if sunset is > 8PM; and 2) Turn off the light at 8pm regardless of light level (keep doorbell dingers away)

Is that an accurate summary?

1 Like

is this looking better

Yes except the if is still wrong . You don't want the NOT!

I don't have a kasa app, these our Ajax online gu10s

1 Like

My bad must of confused it with another thread.

there is no lux requirement you our trying to make something very simple hard with unnecessary knowledge. at sunset normally means when its dark. I haven't asked for anything that you our offering

This is probably more along the lines of what you want. This is untested, but should turn on the lights with random color at sunset if sunset is between 4 PM and 7:59 PM. At 8 PM, the light will turn off.

Download the Hubitat app