Auto light on

Hello,

I have installed node red on my hassio install.

when i come home hassio detects that i’m home.

but how can i configure a flow that when i come home.
and the time is behind sunset the light in my hallway burns for 5 minutes?

Here’s how I’d start:

You need the Big Timer in this example. It uses your location to determine sunset/sunrise.

Arrival (events state):
image

Big Timer:
I’ve highlighted the only things you need to change,

Light On (call service):

Then a simple delay and then light off you can just copy the light on.

hello thanks for youre help.

but it is not working.

in home assistand it shows away en when i connect with wifi it says home
so that is working.

but the flow is not triggering

Ok. I’m learning too so I could have misinformed you.

Try moving the output to the bottom of the three outputs of the Big Timer.
image

EDIT: you may also need a switch, configured like this after the Big Timer.

What I end up doing is checking each step of the flow with a debug node, seen here:
image

Put that after your arrival node, then kill the WiFi on your phone, then turn it back on after a few seconds. See if you get a message.
After that put the debug node after the big timer. As long as it’s between your designated times, kill the WiFi and turn it back on. See that you get a debug message.

No message bij the first one arrival

I wouldn’t use Big Timer for this but instead would use the Time Range node. It will also need you to enter your Lat/Lon coordinates and you can set the time between sunset and sunrise.

Basically use the Change State node to trigger the flow. Use a switch to only pass on when it has changed to home and then check with the Time Range node if it’s after sunset but before sunrise.

Sorry I can’t post examples but I’m at work and can’t access my HA.

If you want to use Big Timer in this way, its doc says input must be “on” (or 1) or “off” (or 0). So “home” is unlikely to work without converting it (not tried though).

My preference would be to decouple the two - Big Timer by itself triggering on sunrise/set and storing the result in a flow/global variable (ensuring it’s persisted to cater for restarts). Then after the Arrival node you have a Switch node which checks the variable. Advantages of this process are you can see the content of the variable to gain confidence it’s working, and re-use it elsewhere rather than having multiple sunrise/set Big Timers (which is why a global variable might be useful).

it is working now.

it was verry simple haha.