Homey Community Forum

Help needed with a presence flow based on a motion sensor

Hello all,

I’m trying to create a flow for the time someone is present in my house. I have a Fibaro motion sensor in the room I want to monitor. Before I just checked my insights and then (pre 2.0) you could perfectly see the motion diagram and there you go. But since 2.0 that’s gone (I still don’t know why because it’s the main feature to read in a motion sensor) and now I want to create a flow for this.

Basicly it should do the following;

when the motion sensor is inactive for more than 20 minutes mark a start time
when the motion sensor is again inactive for more then 20 minutes mark an end time
Report the total time between the two marks by message on phone.
Flow ends.

What could be a smart flow for this?
Tia,

Martijn

Erm, would the result not be always 20 minutes if no motion is registered?
And nothing happens when there is motion registered?

True, and that’s exactly where I run into.

Let’s say, we leave the house before 0930. Between 1000-1030 someone enters. Then the flow should notice this by a lenght of time there wasn’t activity. Assuming that the person moves a bit the motion sensor keeps seeing this. And ends when there is a pauze greater then 20 mins, assuming the person has left the house.

Hmm, i think then you have to use the “motion alarm turned off” card with a timer or variables.

Something with

  • if the motion alarm turned off, start timer
  • if motion detected and timer > 20 then notify and stop timer else do nothing

Also i seem to remember there was already a topic about this but then with switching on and off some lights…

Something like; WHEN motion sensor turns on, THEN Stop 24-hour Timer, Stop 8 hour Timer(10 sec delay). WHEN motion sensor turns off, THEN start 24-hour Timer(86400 sec).
WHEN 24-hour Timer value changes, AND Logic(24-hour timer) is less then 85200, THEN Start 8-hour Timer.
WHEN motion sensor turns on, AND 8-hour Timer is running, THEN mobile send a push message Motion detected: Total off {{28800-tag 8-hour Timer}} seconds

Using countdown app? I have bad experience using the motion off, but good experience with the motion on.

  • IF motion detected AND countdown =-1 THEN set countdown to 20 minutes AND notify (Someone came home) ELSE set countdown to 20 minutes
  • IF countdown = -1 [AND no motion] THEN notify (Nobody at home), LOG(No more motion detected)

Yep, I’m using the countdown app as well, and I’m also very satisfied with it

I have something similar set up and I think you should consider to disable the flow that triggers the action and sets the countdown, while the countdown is running. One reason was that countdown reset its value back to start everytime movement happened , another was that Homey had to process a pile of requests from the IR sensor every time movement was discovered (alot because people seems to move their body all the time:-)

Thanks for the help but I can’t get it to work. I’m trying to convert your input to flows but I can’t find the right syntax. And I can’t find the ELSE option?

Would anybody be so kind to post a screenshot from such a flow?

https://community.athom.com/search?q=where%20is%20the%20else%20part

First result:

@M_a_r_c_o Now I have this, is this correct? I don’t fully understand how the countdown works…

and a second flow