Trigger lights when returning home

I have a flow for when I return home, but currently it turns on the lights when I get into my home area. I'm having trouble trying to figure out how to only turn on the lights when I open the door from returning home. Is there a way to do this in nodered or the only other way I can think of is create a input boolean to flag just got home and then reset it.

How do you plan to detect that you are coming home and not already at home? Opening a door does not provide such information in itself

I'm using our phones to determine when we return home and everything is working as expected, but I want the lights only to turn on when I open the door and not when I am in range of my home. I was trying to see if there was a way to do this without having to create another entity in home assistant.

Hi @CAL37, How does it detect when the door is open or close? i think you need something (door sensor) for detect that the door is open or close...

if you have this signal, will be easy to do in Node-RED. I think with a switch node, for example.

@MecatronicaMADE I do have a door sensor on my entry door, but how does the switch node come into play?

You have to trigger the other way round. So let your door sensor trigger and the filter with a switch node that you are in your home area.

If you have not a node to ask the status of your home node - you let the home node set a flow variable and then use the switch node to filter the trigger only in case you are @home.

1 Like

I do not understand why you start talking about Home Asssistant, here we focus on solving solutions with Node-RED

You ask for hints to a solution that would turn on lights when you arrive home and then open a door. So an approach could be that you break up the use case into several parts

  1. How do you separate between arriving home and being at home? With your phones, how do you do that? This is the first thing to be sorted out

  2. When you open the door, you then need to check if you just arrived home and only then, turn on the lights. So you need to figure out how this shall be done

  3. How long is the period "just arrived home"? It is just during that period, the lights shall go on if you open the door. And I guess you would need an additional condition based on the state of the sun??

Yes, all this that I have listed is possible with Node-RED if you have the necessary sensors and the phone thing working. But this forum is not a code factory, is a place where you can get guidance so you have to take it from here

1 Like

@mickym2 your right, I had it backwards. Thank you!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.