MagicMirror² v2.8.0 is available! For more information about this release, check out this topic.

Who is home? Presence tracking



  • We use IFTTT to sense when someone comes home or leaves, and we use it to track when the kids arrive at and leave school. Pretty easy, all you need to do is connect into web hooks and you can POST the data.

    I’d like to show: Where is everyone?
    Dad: Home / Work / Club / “Other” - left: X min ago / home for: Y min
    Mom: Same
    Kid 1:
    Kid 2:
    Kid 3:

    I’m a python guy, not a javascript guy. Anything around that could get me started – yes, I will RTFM, but if anyone has pointers to something close, I’ll be grateful.

    Also - custom icons for family members would be nice - how?

    Thanks!



  • @tc60045 so, can u collect the info in python, then pass that info to the module and have it display?

    home do you want this to look?



  • @tc60045 how do u track them via IFTTT? specially at school?

    tnanks, Zdenek


  • Module Developer

    @zdenek show us IFTTT recipe, we can make webhook easily with existing module or by creating one.



  • Thanks everyone for your interest on this – this is quite a nice welcome!!

    The process on IFTTT is pretty simple, with caveats:

    • I’m not sure it works on Android, but I know it works with iOS
    • Users (family) must have IFTTT accounts, have IFTTT app on their phones, and have location / privacy / background settings on so that it reports location. Battery drain from that is nothing that I have noticed, ever
    • Then you set up rules specific to any locations that you want

    There is no way that I know of to take all the rules from one user and transfer them to another user, so sadly, I’ve just had to gut it out and reproduce all the rules in each account. Oh well.

    The “this” is a location trigger; the “that” is whatever you want (email, text, action from something else). In this case, the “that” we want to use is a web hook, so that we can POST or PUT the information to a web server with certain pieces of information: who (multiple users), did what (entered/exited), location (where), when (timestamp).

    I will post the pictures of the process in just a second, but let’s talk guts. I use docker, python and Redis for everything that I can. So I had intended to set up a small apache container on a custom port to receive the POST, then have a python script running to parse the log and push location states to Redis, and then have a small .js module simply grab location state information from Redis. That setup works for me, but it won’t work for everyone. I’m happy to re-factor that logic and learn some new things to make this happen – in a way that doesn’t require docker, redis or python, but nevertheless maintains persistent data stores.

    Here’s the IFTTT setup:
    0_1561041379657_by default 2019-06-20 at 9.16.17 AM.jpg

    0_1561041395943_by default 2019-06-20 at 9.16.29 AM.jpg

    0_1561041409387_by default 2019-06-20 at 9.17.09 AM.jpg

    0_1561041421400_by default 2019-06-20 at 9.17.17 AM.jpg

    0_1561041444769_by default 2019-06-20 at 9.17.28 AM.jpg

    0_1561041465040_by default 2019-06-20 at 9.17.39 AM.jpg

    0_1561041480364_by default 2019-06-20 at 9.18.07 AM.jpg

    0_1561041517877_by default 2019-06-20 at 9.18.33 AM.jpg

    0_1561041496943_by default 2019-06-20 at 9.18.23 AM.jpg

    0_1561041547646_by default 2019-06-20 at 9.18.45 AM.jpg

    0_1561041559020_by default 2019-06-20 at 9.18.55 AM.jpg

    Note that you can push information in the body or url to reflect the of the person whom you are tracking, and you can specify a if you like, too, like “Work”, “Church”, “Club”, “Grocery”, “Boyfriend!!!”, “Beach”, “etc”. I think the only limits are your creativity and time, as IFTTT doesn’t make this easy to replicate from family member to family member…

    Thoughts welcome – let’s collaborate and get started!



  • And this is what I was thinking about for layout:

    0_1561043129182_by default 2019-06-20 at 10.04.34 AM.jpg


  • Module Developer

    @tc60045
    Like this?
    0_1561061779723_ttt.png

    After more tests, will be released.

    ADDED
    Now I’m adding additional feature - command executing when Someone entered or exited. (e.g: Play Spotify when Dad entered Home)



  • @Sean – yes! But please tell me you are using geo location and not MAC address / ARP results snippet from iOS security guide discussed here?

    I want to create many locations based on geofencing. How can I / we help you with this?


  • Module Developer

    @tc60045 I didn’t use MAC Address. I just put who: "dad", location:"Home" in body of IFTTT recipe. I think each recipe should be created per people and location, so hardcoded is enough.



  • @Sean PERFECT – thank you. Can’t wait to test!