Need help with conditional based on sunrise

Hi! I’m fairly new to FH and Thingsplex so I might be missing something

I’m planning to create a flow “morning lights”, that turns on a set of lights at e.g. 06:00 in the morning. BUT, I don’t want to do this if it’s already bright outside, i.e. if 06:00 is AFTER the time of sunrise.

I was planning to store the time of sunrise in a variable using astro events + “current time in seconds”, and then introduce an if-statement that compares this with the current trigger time (06:00) each morning.
However, it seems like I cannot compare two variables in an if-statement, only variable to static input.

Does anyone have a better idea to accomplish this?

You can compare with transform node and calculate function. There is a post on the forum regarding this.

Thank you @olek. I found this reference via the forum that explains what you refer to Data operations - docs

However, I settled for something simpler: Just tracking the astro events to a global variable, and then checking if it’s “sunset” before turning on the lights. Realized I couldn’t compare with a timestamp that hadn’t occurred yet :crazy_face: