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

Ping iPhone instead of GPS localization


SDeath

Question

Instead of using the GPS localization which consumes enormous amounts of power from the iPhone, I want to let the HC2 ping every minute if it can find the iPhone on my local network.

And based on that set a value if somebody is home or not.

Since 3.486 os.execute doesn't work.

Anybody have an idea how to use that function?

This is what I want to do:

Please login or register to see this code.

Edit:forgot the while true do.

Link to comment
Share on other sites

  • Answers 102
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Posted Images

Recommended Posts

  • 0
Guest deraaij
My wife was quite surprised when the garden door has opened, and lights at the hall has switched on at her arrival close to our house. Start to like this solution

Please login or register to see this image.

/emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

Anyway, real PING would be even more usefull.

Nice!

Link to comment
Share on other sites

  • 0
Guest sgbirch

+1

This is a truly brilliant idea. I add my vote encouraging Fibaro to implement it as a standard feature of the HC2, I am sure many users unable to write lua would also be grateful.

Link to comment
Share on other sites

  • 0
Guest Dennis
Works here 99,9% of the time.

With an iPhone 4 and 5 both running 6.1.2.

Couple of times it said it was not online.

But my wife came home 3 hours ago iPhone is still in her bag and HC2 pings it just fine.

I run the script every 10 seconds. See no extra battery drain.

E-mails get pushed to the device like always when they arrive.

Short question.

I have a iPhone 4S. Whit the latest iOS. When i unlock my screen the the ping works fine, and i am "at home". But after i lock the iPhone then after 2 min i ,am "not at home". Even when i run the "check " scene every 10 sec.

So my iPhone lost in 1 min the wifi connection.

What can i do about it?

Link to comment
Share on other sites

  • 0
Guest jrkalf

Dennis, is your "lock" on your iphone set to 1 or 2 minutes after the device goes to sleep?

This would confirm issues I've read on the apple discussions forums about the device stopping wifi when it locks.

Link to comment
Share on other sites

  • 0
I have a iPhone 4S. Whit the latest iOS. When i unlock my screen the the ping works fine, and i am "at home". But after i lock the iPhone then after 2 min i ,am "not at home". Even when i run the "check " scene every 10 sec.

Me and my wife both have iPhone 4S and don't see such problems after the screen locks..autolock is set to 5 and 15 mins respectively.

sometimes the only issue is when at far end of my house I loose wi-fi connection.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • I have a iPhone 4S. Whit the latest iOS. When i unlock my screen the the ping works fine, and i am "at home". But after i lock the iPhone then after 2 min i ,am "not at home". Even when i run the "check " scene every 10 sec.

    Me and my wife both have iPhone 4S and don't see such problems after the screen locks..autolock is set to 5 and 15 mins respectively.

    sometimes the only issue is when at far end of my house I loose wi-fi connection.

    iPhone 4 and 5 here, no problems whatsoever with the lockscreen. Both set to a couple of minutes.

    Your WiFi range can be extended with a range extender, that will solve your phone loosing connection.

    Link to comment
    Share on other sites

    • 0
    Guest Dennis
    I have a iPhone 4S. Whit the latest iOS. When i unlock my screen the the ping works fine, and i am "at home". But after i lock the iPhone then after 2 min i ,am "not at home". Even when i run the "check " scene every 10 sec.

    Me and my wife both have iPhone 4S and don't see such problems after the screen locks..autolock is set to 5 and 15 mins respectively.

    sometimes the only issue is when at far end of my house I loose wi-fi connection.

    strange. my lock is set to 5 min. and full wifi connection (and strength).

    So i don't move my iPhone and after the lock (5 min + 1 min) the wifi connection on my iPhone has disabled and fibaro tels me i am "not at home".

    run the scene every 5 sec has no effect.

    Strange ?

    The pings form fibaro don't keep my wifi alive on my iPhone

    Link to comment
    Share on other sites

    • 0
    My wife was quite surprised when the garden door has opened, and lights at the hall has switched on at her arrival close to our house. Start to like this solution

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    The boss here finds it spooky...

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" />

    Link to comment
    Share on other sites

    • 0
    Guest deraaij
    My wife was quite surprised when the garden door has opened, and lights at the hall has switched on at her arrival close to our house. Start to like this solution

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    The boss here finds it spooky...

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" />

    Hahahhaha

    Link to comment
    Share on other sites

    • 0
    Guest jrkalf

    Ok,

    Don't ask how, had to pull some strings and do a lot of digging. But the wifi issue in iOS6.x is related to having cellular data and wifi both enabled on the phone.

    If you have both enabled and the phone goes into sleep/lock mode, it'll turn off wifi and rely on cellular data.

    This is a known apple bug filed under:

    Apple bug ID 11897952 - wifi drops to cellular when phone locked, causes VoIP app to miss incoming calls.

    This bug report comes from a previously reported bug of the VOIP application created by Cisco. Their bug ID is: CSCub14854

    Please login or register to see this link.

    Limitations and Restrictions

    Due to an Apple iOS issue, the device sometimes drops from the Wi-Fi data network to the mobile voice network while the device is in sleep mode (CSCub14854). This issue can lead to missed incoming calls. To prevent this issue, turn off Cellular Data in the native Settings app.

    Link to comment
    Share on other sites

    • 0

    Now I understand why sometimes I have had missed calls w/o the reason !

    Thanks for the information.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Ok,

    Don't ask how, had to pull some strings and do a lot of digging. But the wifi issue in iOS6.x is related to having cellular data and wifi both enabled on the phone.

    If you have both enabled and the phone goes into sleep/lock mode, it'll turn off wifi and rely on cellular data.

    This is a known apple bug filed under:

    Apple bug ID 11897952 - wifi drops to cellular when phone locked, causes VoIP app to miss incoming calls.

    This bug report comes from a previously reported bug of the VOIP application created by Cisco. Their bug ID is: CSCub14854

    Please login or register to see this link.

    Limitations and Restrictions

    Due to an Apple iOS issue, the device sometimes drops from the Wi-Fi data network to the mobile voice network while the device is in sleep mode (CSCub14854). This issue can lead to missed incoming calls. To prevent this issue, turn off Cellular Data in the native Settings app.

    Still Strange as I have both enabled without problems.

    But I agree Fibaro should make this a standard feature.

    Link to comment
    Share on other sites

    • 0
    hort question.

    I have a iPhone 4S. Whit the latest iOS. When i unlock my screen the the ping works fine, and i am "at home". But after i lock the iPhone then after 2 min i ,am "not at home". Even when i run the "check " scene every 10 sec.

    So my iPhone lost in 1 min the wifi connection.

    What can i do about it?

    Have solved it

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" /> - if you stll need it send me PRIV messge

    Link to comment
    Share on other sites

    • 0
    hort question.

    I have a iPhone 4S. Whit the latest iOS. When i unlock my screen the the ping works fine, and i am "at home". But after i lock the iPhone then after 2 min i ,am "not at home". Even when i run the "check " scene every 10 sec.

    So my iPhone lost in 1 min the wifi connection.

    What can i do about it?

    Have solved it

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" /> - if you stll need it send me PRIV messge

    It's more simple to explain to everybody no?

    Link to comment
    Share on other sites

    • 0

    I have added a code that would only change the status to OUT if the time difference between the status OUT and IN is more then certain amount of time. This way if my iPhone loses WiFi for some reason for a 1-2 minutes I'm not informed that I have left the house and of course after few minutes the system doesn't believe that I'm back

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    I use a global variable: "rshome" with the following values:

    0 - not at home (OUT)

    1- at home (IN)

    -1 - probably OUT but give some time to make sure

    If status switches back to IN within the defined time period it wouldn't change the "rshome" variable so scenes triggered by that change wouldn't start.

    Here is a modified code of virtual device that I run every 10 seconds:

    Please login or register to see this code.

    And here is a code of a scene that starts if the status of "rshome" changes:

    Please login or register to see this code.

    Link to comment
    Share on other sites

    • 0

    Great piece of code...

    Can anybody tell me how to adapt it to use with my android smartphone,please ? (I do not have Iphone).I would like the same functionality..

    Thanks

    Link to comment
    Share on other sites

    • 0
    Galaxy S3 1108/tcp

    strange! this port has just stopped working on two devices! any ideas? rom update?

    I had tried 1 month to find an permanent open port on my samsung galaxy S3 phone,but no luck till now. Is this possible that android is not having any permanent open ports available ?

    Link to comment
    Share on other sites

    • 0

    To me it seem that it would be a better plan of action to see if the MAC-adress of the device you wish to keep track of is in the ARP-table of the local network.

    THat way nothing needs to be running on the device, apart from the network itself.

    Yes, there would be a lag between the unit being removed from the net, and the ARP-record being cleansed if one sticks to the standard ARP timeouts.

    Edit: Or being more evil... for those of us with a "intelligent" wifi-system (I personally use the Ubiquiti UniFi at home) I can use the API to query wether or not a certain MAC is associated with my Wireless Network. Thats even better.. and no ARP-lag

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    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...