Coder Social home page Coder Social logo

tractive's Introduction

This is a simple Tractive GPS tracker API wrapper to make multiple types of requests to Tractive and recieve data on your account and pet(s).

Contents

Getting Started

const tractive = require('tractive');

/*
Check if Tractive has authenticated:
Return true if successful and connected or returns false is not connected.
*/
tractive.connect('TRACTIVE_ACCOUNT_EMAIL', 'TRACTIVE_ACCOUNT_PASSWORD')

/*
Check if Tractive has authenticated:
Returns true if the tractive.connect() is successful and connected.
*/
tractive.isAuthenticated() ? true : false;

tractive.getAllTrackers().then(function(trackers) {
    /*
    trackers = [
        {
            "_id":"ABCDEFGH",
            "_type":"tracker",
            "_version":"0000000e-0000000-0000000000"
        }
    ]
    */
});

/*
Gets a defined tracker and returns its latest report data along with address.
*/
tractive.getTrackerLocation("ABCDEFGH").then(function(tracker) {
    /*
    tracker = {
        time: 1669530259,
        time_rcvd: 1669530274,
        sensor_used: 'GPS',
        pos_status: [ 'STATIONARY_FIX' ],
        latlong: [ -30.234736, 129.16563 ],
        speed: 0,
        pos_uncertainty: 14,
        _id: 'ABCDEFGH',
        _type: 'device_pos_report',
        _version: '4daf8f322',
        altitude: 121,
        report_id: '00000000000000',
        nearby_user_id: null,
        power_saving_zone_id: null,
        address: {
            street: 'My Street Road',
            house_number: '10',
            zip_code: '0000',
            city: 'Anyville',
            country: 'AU',
            full_address: 'My Street Road 10, 0000 Anyville'
        }
    }
    */
});

// Turn on live tracking
tractive.liveOn("ABCDEFGH").then(function(tracker) {
    /*
    tracker = {
        active: false,
        started_at: null,
        timeout: 300,
        remaining: 0,
        pending: true,
        reconnecting: false
        }
    */
});

All Functions

getAccountInfo()
getAccountSubscriptions()
getAccountSubscription(subscriptionID)
getAccountShares()

getPets()
getPet(PetID)

getAllTrackers()
getTracker(trackerID)
getTrackerHistory(trackerID, from, to) // 'from' and 'to' are Date() functions or timestamps (in ms).
getTrackerLocation(trackerID) // Get the latest report that the tracker uploaded.
getTrackerHardware(trackerID) // Get the latest hardware report that was sent. This includes battery levels.

liveOn(trackerID) // Turns on live tracking
liveOff(trackerID) // Turns off live tracking
LEDOn(trackerID) // Turns on LED light
LEDOff(trackerID) // Turns off LED light
buzzerOn(trackerID) // Turns on buzzer sound
buzzerOff(trackerID) // Turns off buzzer sound

Other

Created by Weblutions

Disclaimer This personal project is maintained in spare time and has no business goal. Terms and logos related to Tractive are respective of their holders. This is not maintained or created by Tractive. However, Tractive you're welcome to have the package name if you ever have an official API ๐Ÿ’–

tractive's People

Contributors

faxes avatar hupfis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tractive's Issues

Is premium plan required to access location data via this API?

Hello, found your Tractive repo and wanted to ask before I got too far implementing it. At this point I'm mainly trying to get access to the map's location data (which expires every few days on the standard plan). Premium plan allows full history location data download, but it's expensive.
Any knowledge you have on this appreciated.
Matt

Activity history

Thanks for making this repository public.

I was wondering if it would be possible to also add some code to see the activity history of the pet.

Not authenticated :/

Hello, I have a problem with logging in. Could you advise me if it's necessary to enable access through the Tractive API first? It keeps showing me "Not authenticated." Can you also provide guidance on which variables I need to change for the initial login?
Thanks :)

Tractive X Siri Shortcuts

Hi! Thank you for sharing.
Unfortunatly I'm not a programer, I just play with Siri Shortcuts, and the other day I found your project and I was trying to make it work with Shortcuts to ask Siri where is my pet?, but I don't really know what I was doing, I don't know anything about Java.

The only thing I know is that you can run Java scripts on safari and on this way, use APIs like yours.

Here is what I was trying to do
https://www.reddit.com/r/shortcuts/comments/agh6ro/using_javascript_in_your_shortcuts/

So I was wondering if you don't mind, can you show me how to use your project?

Thank you again!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.