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

Car GPS Location (The Easy Way)


Question

Posted

I just need a tiny bit of advice from someone who is good with API information!

 

I need to use the following...

 

Please login or register to see this link.

 

this is the GET command i am trying to send... what am i doing wrong... i am testing this in a chrome extension called Postman!

 

The following is the data i want to send... except for a few changes

Please login or register to see this image.

/emoticons/default_icon_wink.gif" alt=";-)" /> to make sure i do not let go credentials etc... or imei

 

---

 

GET /api/api.php?api=user&ver=1.0&key=8dfsdf9sdf7sdf9sdf89sd8fsd7f9&cmd=OBJECT_GET_LOCATIONS,34530450934508934 HTTP/1.1
Host: gpslivepremium.co.uk
Authorization: Basic ssd5345345345GDGDFG45345345DDY=

 

Could anyone help... because if i can get it to work it means i can use this method to switch heating/lights etc on when the car gets home! no more killing phone battery with gps

9 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Posted

    step closer... getting the data (now they enabled it on my account) GRRRRRRRRR!

    Please login or register to see this image.

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

     

    but am struggling with the following...

    Please login or register to see this code.

    i want to grab the speed from the above! can anyone advise

     

    fibaro:debug(jsonTable.476893023456312.speed)

     

    i am missing something SOOOOOOO simple what is it

    Please login or register to see this image.

    /emoticons/default_sad.png" alt=":(" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> i keep getting malformed number as error...

    • 0
    Posted

    I was thinking of using Json for this, but it's not a valid return..

     

    PS: Nothing on that location!

    54.546735 -2.334727

     

    Please login or register to see this link.

    • 0
  • Inquirer
  • Posted

    I was thinking of using Json for this, but it's not a valid return..

     

    PS: Nothing on that location!

    54.546735 -2.334727

     

    Please login or register to see this link.

     

    Of course there is nothing at that location

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" /> privacy reasons i made it up

    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" />

     

    But thank you for trying... the above code should have been valid json but it seems to be like a child table within a table? i can debug it to a log if i substract the brackets

     

    jsonTMP = string.sub(response, 1, -1)

     

    but cannot work it out from there

    • 0
    Posted

    Maybe string.match might work?

     

     

    See:

    Please login or register to see this link.

     (have a look at Captures)

    • 0
  • Inquirer
  • Posted

    Maybe string.match might work?

     

     

    See:

    Please login or register to see this link.

     (have a look at Captures)

     

    I think that will work quite well! Now time to do some more learning

    Please login or register to see this image.

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

    • 0
    Posted

    Żaden problem

    • 0
  • Inquirer
  • Posted
    local angle = string.match(jsonTMP, 'angle":"%d+"')

    fibaro:debug(angle)

    local angle2 = string.match(angle, '%d+')

    fibaro:debug(angle2)

     

    got round one of the values doing this... if you can see a better way please share

    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" />

     

    but thank you for the right direction

    • 0
  • Inquirer
  • Posted

    Excellent thanks for you help it all works now even using longitude and latitude i can set variable to home/away and have garden lights switch on etc... detect when the ignition on the car is on or off so ignition off and home = garden lights on

     

    ignition on and away then garden lights off and arm alarm at home

     

    been after a solution for this for a long time that has low battery impact and its perfect

    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" /> thanks Guest for the string.match idea!

    • 0
    Posted

    You are welcome!

     

    PS: Well done!

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