I want to turn off a lamp at sunrise. But if that is earlier than 8 o’clock in the morning, it may not go out until 8 o’clock in the morning.
To achieve this I have created the code below. But when I execute this the light still goes off at sunrise and not at 8 o’clock. Anyone have any idea why this turns off at sunrise?
Because you have no conditions. It will turn off when the first trigger of the two “off” triggers happens.
You create an is_true variable but then don’t use it to do anything — I suspect you’ve done this via copy-paste-modify, and I’m guessing the original was one of @123’s. Use this condition block, which tests whether is_true is true.
Your mixture of “31 minutes before after sunrise” and “above_horizon” make me wonder if there’s a set of circumstances where it won’t turn off. I think you’re OK though.
Simply for my understanding…In the first step, you want a light to turn off at sunrise unless it’s before 8:00 AM. If sunrise is after 8AM you want the light to go out at 8AM, correct?