Jump to content
Guides for the Forum Read more... ×
Poradniki na Forum Read more... ×
  • 0
Alex Rob

GPS Tracking HC2 and iOS App question to Fibaro developers.

Question

Hello,

 

i red about this function in many places in this forum. I also used google. 

It looks like there is a lot of issues in HC2 for gps tracking 

 

i got 2 users and one super user. Even I make block scenes as explained I can’t trigger scene by tracking of gps location.

family panel did not show up even I activated tracking on all devices within 1 min.

if I trigger scene manually it works. 

I see on android Fibaro app u can do adjustment of tracking range by gps location. This function is not on the iPhone app. Can Fibaro fix this? Do improvements on HC2 for get a better gos tracking function?

 

 

 

 

 

 

 

 

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Edited by Alex Rob

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

Hi. 

 

I have done a similar thing but not using the Fibaro app

 

I've done this using find friends on iOS and life360 which works on iOS and android

 

You might like to have a look

Please login or register to see this link.

 

I’m happy to help if you get stuck.

 

Ian

 

 

Share this post


Link to post
Share on other sites
  • 0

Interesting... for me it  works  (LUA code) and I have two Android and three iPhone users....

Probably stupid question, but did you set location permission on iPhone for fibaro app.?

 

 

Share this post


Link to post
Share on other sites
  • 0
  • Inquirer
  • Yes I did, maybe I should change to lua code ? The block scenes looks right ?

    Edited by Alex Rob

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • i konvertet the blocks to lua and even then there is no function. if i trigger scene manually everythings works, so i see that it stops by the GPS tracking.

     

    --[[
    %% autostart
    %% properties
    295 Location
    %% weather
    %% events
    %% globals
    --]]

    local startSource = fibaro:getSourceTrigger();
    if (
     ( (fibaro:calculateDistance(fibaro:getValue(295, "Location"), "68;15") <= 2500 and fibaro:calculateDistance(fibaro:getValue(295, "PreviousLocation"), "68;15") > 2500) )
    or
    startSource["type"] == "other"
    )
    then
        fibaro:call(45, "setValue", "85");
        fibaro:call(50, "setValue", "85");
        fibaro:call(55, "setValue", "85");
        setTimeout(function()
            fibaro:call(45, "setValue", "3");
        fibaro:call(50, "setValue", "3");
        fibaro:call(55, "setValue", "3");
        end, 600000)
    end

     

     

    and android user:

     

    --[[
    %% autostart
    %% properties
    298 Location
    %% weather
    %% events
    %% globals
    --]]

    local startSource = fibaro:getSourceTrigger();
    if (
     ( (fibaro:calculateDistance(fibaro:getValue(298, "Location"), "68;15") <= 4000 and fibaro:calculateDistance(fibaro:getValue(298, "PreviousLocation"), "68;15") > 4000) )
    or
    startSource["type"] == "other"
    )
    then
        fibaro:call(45, "setValue", "85");
        fibaro:call(50, "setValue", "85");
        fibaro:call(55, "setValue", "85");
        fibaro:call(298, "sendDefinedEmailNotification", "4");
        setTimeout(function()
            fibaro:call(45, "setValue", "2");
        fibaro:call(50, "setValue", "2");
        fibaro:call(55, "setValue", "2");
        end, 600000)
    end

     

    Share this post


    Link to post
    Share on other sites
    • 0

    I believe that you set " How frequently GPS position from the user's iPhone should be collected? "  to some value and Run scene is  Automatic.

    Since you have condition     startSource["type"] == "other" that's what executes the scene manually, but it doesn't mean anything.

    What I think that  the scene is triggered as required, but your coordinates in condition

    if (
     ( (fibaro:calculateDistance(fibaro:getValue(295, "Location"), "68;15") <= 2500 and fibaro:calculateDistance(fibaro:getValue(295, "PreviousLocation"), "68;15") > 2500) )

    are  not correct... are your sure about longitude and latitude?

    Have checked your coordinates and it points to the sea ( near to Norway)

    Please login or register to see this attachment.

     

    Since you already have LUA code, please correct the coordinates exactly to your location.

    If in the future if you'll use block scene please correct the coordinates at location panel as well

    Just to make sure that the scene works, please add follow line to your code (marked blue)

     

    local startSource = fibaro:getSourceTrigger();

    fibaro:debug(fibaro:getValue(295, "Location"))
    if (
     ( (fibaro:calculateDistance(fibaro:getValue(295, "Location"), "68;15") <= 2500 and fibaro:calculateDistance(fibaro:getValue(295, "PreviousLocation"), "68;15") > 2500) )
    or
    startSource["type"] == "other"
    )

    Run the scene a while and when the scene will triggered by user location, you will see user' coordinates, which approximately should be used by you in code.

    Add same debug line to second scene as well.

    Let me know if it helps

    By the way you can merge both scenes to one scene only.

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • Hello, thanks for your help.

    i thought I got the right location set, I pointed out from a map directly. as U see on the picture it should be right.

    i got a frequently pos poll about 1 min since I did not manage to work I use 5 min.

    so If i transfer block scenes to lua should they not be right Changed.

    can u also merge both scene as block scene? I just started with Fibaro so I’m not good at lua code. 

     

    I will do the fixes and see if this is working but unsure why the location is pointing into the see. 

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Edited by Alex Rob

    Share this post


    Link to post
    Share on other sites
    • 0

    Ok... let me know if it works after coordinates correction and I'll help you to merge the scenes

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • i will try to use block scenes but i check if the lua code got the right coordinates, as u see below it looks good now. will leave for work tomorrow so i will se if i get a email and light is triggered.

     

    --[[
    %% autostart
    %% properties
    2 Location
    %% weather
    %% events
    %% globals
    --]]

    local startSource = fibaro:getSourceTrigger();
    if (
     ( (fibaro:calculateDistance(fibaro:getValue(2, "Location"), "68.63000761962243;15.587984091824296") <= 3000 and fibaro:calculateDistance(fibaro:getValue(2, "PreviousLocation"), "68.63000761962243;15.587984091824296") > 3000) )
    or
    startSource["type"] == "other"
    )
    then
        fibaro:call(50, "setValue", "90");
        fibaro:call(55, "setValue", "90");
        fibaro:call(154, "setValue", "60");
        fibaro:call(2, "sendDefinedEmailNotification", "4");
        setTimeout(function()
            fibaro:call(50, "setValue", "2");
        fibaro:call(55, "setValue", "2");
        end, 900000)
    end

     

    Share this post


    Link to post
    Share on other sites
    • 0

    You need to have this section up and running first I think...

    Please login or register to see this image.

    /monthly_2018_12/image.png.7b44815318d1a701a0a8240eaadca0f2.png" alt="image.png.7b44815318d1a701a0a8240eaadca0f2.png" />

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • i try to get this but dont know how i can get access to it.

    I innstalled to phones one with i phone and one with android gps signal will be transmitted each 5 min, and in phone settings is location always active and the app goes not in sleep modus i set this on on too. But still i dont see family panel

    Share this post


    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    ×