Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

davidneale

Question

is there a way to make home or away Variables by using your wifi at home so the Fibaro system nows when I ip dress comes into the area it know someone is home

Link to comment
Share on other sites

Recommended Posts

  • 0

you can simply use API call:

http://192.168.1.36:80/api/networkDiscovery/arp

for getting all devices in network. But it sometimes ugly and works not properly.

also, you can simply search some scripts in this forum. 

 

-----------------------------------------------------------------------------------------------------------------------

otherwise if you developer you can use my work :)

 

so, I wrote a script and call it every 5 mins 

notice: I created in HC global vars for each family member. 

Please login or register to see this code.

 

in HC LUA script I check if all members are 0 and send to device push popup notification with asking to arm house.

also, I have VD.

 

FNEWxWfzRC.png

 

  

 

 

Link to comment
Share on other sites

  • 0
  • Inquirer
  • can't see you vd to showing up 

    can I copy you Lua code but just change the ip address and Mac address and will it work

     

    Link to comment
    Share on other sites

    • 0

    yep

    Please login or register to see this image.

    /monthly_2018_04/image.png.a6c2b5c488308437ed4ff22bcade7ba4.png" />

    Please login or register to see this attachment.

    11 minutes ago, davidneale said:

    can I copy you Lua code

     

    btw. it's python. not LUA.

    python code works on my raspberry pi server.

    Edited by 10der
    Link to comment
    Share on other sites

    • 0

    omg. did you see my note here?

    ==============================================

    otherwise if you developer you can use my work :)

    ==============================================

     

    sorry. I can't.

    Link to comment
    Share on other sites

    • 0

    Hi,

     

    I use two solutions based on what fits best for the user/phone i want to track.

     

    Presence detection via Wifi:

    Please login or register to see this link.

     

    and

     

    Presence detection via IFTT:

    Please login or register to see this link.

     

    To translate the pages I use Google Chrome browser.

     

    Enjoy.

    Remi

     

    Link to comment
    Share on other sites

    • 0
    1 hour ago, Remi said:

    Please login or register to see this link.

    as I can see 

    1) phones should have static IP

    2) idk, what is a port pinging. this port closes for my IPhone. AFAIR 3500 it's RTMP Port. but again idk what mean the author of this post

    Please login or register to see this code.

    ... 

    your second link also useless for me. :)

    1 hour ago, Remi said:

     

    Please login or register to see this link.

     

     

    native FIBARO integration works with periodically requests (polling) user GPS location. It's not a good solution as for me for this task:

    1) not accurate at all

    2) require "GPS always on" 

    3) as a result -  FIBARO app ("eat") drain battery

    4) and last - main issue (as for me) - real IP address and your ISP must not use NAT firewalling for your router.

    Link to comment
    Share on other sites

    • 0

    Iam sorry if none of the solutions fit you well. I am sure there will be a lot more solution to achief the same.

     

    For the first solution.

    None of my phones has a static ip and its working like a charm. (Maybe i am just lucky to get the same IP every time :) )

    Your correct about the iPhone (I don't have a IPhone) but If I remember correct they had a solution/workaround for that.

    You have to read further in that topic I gues. (sorry)

    For me, as I am using android its working very good.

     

    As for the second link, you didn't read the whole article.

    They use the Fibaro solution as intro, in the second part of the page they explain the better solution I am using.

     

    Isnt a free DDNS registration a solution you can use for changing outside IP?

     

    I am using the first solution for my kids.

    Its often they have burned their MB's of their mobile subscription and without internet access solution 2 doesn't work :-)

    Also having a low battery has impact since it put (most) phones in a power save mode.

    So i use the first solution for my kids. When they get in range of the wifi they are registered "Home" and vice versa.

     

    For me and my wife i use the second solution.

    I like that better since the trigger to register me home is much sooner while the first solution has a delay of ~1 minute.

    In rare occasion's the second solution mis the trigger, but overall both solution work very well for me.

     

    Edited by Remi
    Link to comment
    Share on other sites

    • 0

    The topic has been moved from "

    Please login or register to see this link.

    " to "

    Please login or register to see this link.

    ".

     

    Temat został przeniesiony z "

    Please login or register to see this link.

    " do "

    Please login or register to see this link.

    ".

    Link to comment
    Share on other sites

    • 0
    3 hours ago, Remi said:

    Isnt a free DDNS registration a solution you can use for changing outside IP?

    ISP NAT firewalling mean what all (sic!) ports in your router are closed via your ISP

    trick with DDNS doesn’t work, Sir

    just FYI

    Edited by 10der
    Link to comment
    Share on other sites

    • 0
    19 hours ago, 10der said:

    as I can see 

    1) phones should have static IP

    2) idk, what is a port pinging. this port closes for my IPhone. AFAIR 3500 it's RTMP Port. but again idk what mean the author of this post

    Please login or register to see this code.

     

     

    @10der As this Vfib has been created by some smart guy on the French Fibaro forum and my LUA knowledge is limited (I can make simple scripts :) )

    How I think it works. You doesn't need a fixed IP for a phone. It doesn't need to know your IP at all.

    It does a scan (Ping) over the network and look in his own ARP cache if it find the MAC address of your phone.

     

    Maybe you have seen version 1.0 on the first page? (I think version 1.0 used a fixed IP indeed)

    Latest version is 2.1

     

    Vfib 2.1:

    Please login or register to see this attachment.

     

    Create global variable, for example your name with value's "Home" and "Away".

    Fill in MAC address in IP field of VD (Must be lowercase)

    You have to customize some things in the VD to your own.

    Like the icon's ID's and change the global variable name and value's to the one's you created.

     

    But your a lot smarter than me with LUA so maybe needless to explain this all :)

     

     

    Link to comment
    Share on other sites

    • 0

    thank for the answer. will do.

    but looking via ARP cache - it's bad. really bad. IMHO plus own experience

    Link to comment
    Share on other sites

    • 0

    btw

     

    local HC2 = Net.FHttp("127.0.0.1", 11111);

     

    you can simple replace 

    Please login or register to see this code.

     

    :)

    Edited by 10der
    Link to comment
    Share on other sites

    • 0
    47 minutes ago, 10der said:

    thank for the answer. will do.

    but looking via ARP cache - it's bad. really bad. IMHO plus own experience

     

    @10der I trust you about that, but iam wondering whats the bad thing about that?

    Is it the "overhead" of scanning the whole subnet while searching for only one device?

     

    It seems to work very well for months now.

     

    20 minutes ago, 10der said:

    btw

     

    local HC2 = Net.FHttp("127.0.0.1", 11111);

     

    you can simple replace 

    api(/networkDiscovery/arp)

     

    :)

     

    Is this the same but different notation, or better?

     

    Thanks,

    Remi

    Link to comment
    Share on other sites

    • 0

    also.  

    Please login or register to see this code.

    is too long operation and costly operation for HC2 - if you have 4 family users you should call this operation 4 times.

     

    Please login or register to see this code.

     

    Please login or register to see this image.

     

    or

     

    Please login or register to see this code.

     

    BLUsrhIyHt.png

    Link to comment
    Share on other sites

    • 0

     so. look like a complete solution for you:

     

    Please login or register to see this code.

     

    1) create globals params

    Please login or register to see this image.

     

    2) define the name in the script without suffix "Presence"

    3) create global param AutoPresence 

     

    profit!

    aAie5QIxtf.png

    Edited by 10der
    • Like 1
    Link to comment
    Share on other sites

    • 0

    @10der ROFL Sir! I am truly speechless! Awesome!

    You made this this morning? Amazing.

     

    I like the idea to have one script instead of 4 or 5 (in my case)

    And I love the VD layout with status and counter for family members.

     

    Would you be so kind to share the Vfib with me/us ? :)

     

     

    Edited by Remi
    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...