Table Of Content

Plugin geoloc

Purpose

The geoloc plugin is used to follow people or object. This plugin implements a webserver which can be called on various url by a smartphone or any device connected to internet.

Dependencies

There is no dependency.

Plugin configuration

You have to configure the webserver parameters for this plugin:

Key Type Description
host ipv4 Ip or hostname of the service which will make the url available.
port integer Port of the service which will make the url available.

You will surely need to configure you internet box (or whatever else) to add port forwarding in order the webserver to be available from anywhere in the world.

Create the domogik devices

Domogik device type : geoloc.position

1 parameter is needed for a domogik device creation:

Key Type Description
device string The geolocated device id. This device id will be used in the urls.

Start the plugin

You can now start the plugin (start button) and use the created domogik devices.

Plugin dedicated user interface

In order to show the API and test the plugin easily, the plugin included also a HTML interface. It is available on http://127.0.0.1:40445 from your Domogik server with the default configuration.

Set up your widgets on the user interface

You can now place the widgets of your devices features on the user interface.

Use directly the url from... what you want :)

Purpose

If you plan to use your own scripts (for an embedded project) or create your own application (Android, iOS, HTML5, ....), you just need to call an url like this to use the plugin:

http://<ip>:<port>/position/<device id set during the device creation>/<longitude>,<latitude>

Example:

http://192.168.1.10:40445/position/foobar/-1.6781616210925,46.790657811998

If all is OK, you will get a HTTP CODE 200 and this response as text:

Position successfully processed (degrees): -1.6781616210925,46.790657811998

Else, you will get a HTTP CODE 500 and this kind of response as text:

No device 'foobar' exists.

or:

Unrecognize position type!

Set up Domogik Butler android application

Domogik butler android application

This android application is part of the Domogik project. It is an interface to Domogik’s butler. It is mainly used to speak with the butler but it also have the feature to send GPS location each X minute(s).

You can find this application on Domogik website : http://www.domogik.org

Set up

Launch the application and go in settings. In the menu GPS configuration :

  • enable GPS tracking
  • set the Geoloc plugin url with the public url (see examples below)
  • set the Delay to a value in minutes. The shorter the delay will be, the more the battery of your device will be used!

Url:

http://<ip>:<port>/position/<device id>/

Example:

http://192.168.1.10:40405/position/foobar/

Restart the application.

Set up tasker for this plugin

Set up Trip Tracker for this plugin

Trip Tracker

Trip Tracker is an Android application which can send your position on an url with the POST method. The interval can be set from 5 min to 2 hours.

This is quite a basic application and 5 minutes can be too long for some usages, but it works :)

Sources are available on GitHub : https://github.com/jcs/triptracker

The APK can be found also on GitHub : https://github.com/jcs/triptracker/downloads

Set up Trip Tracker

Launch Trip Tracker and set the url like this:

http://<ip>:<port>/position/<device id>/

Example:

http://192.168.1.10:40405/position/foobar/

Click on Enable Tracking and check on the screen that no error occurs. If this is ok, you should be able to see your current position with one of Domoweb map widgets.

Development informations

Tests

There is no automated tests for this plugin.

Timeout on sensors

The timeout is set to 0 for all sensors : the tracking of a person or an object may be shut for several hours/days (at people convenience)

xPL messages

xpl-stat

The sensor.basic message is used:

xpl-stat
{
...
}
sensor.basic
{
type=position_degrees
device=<device id>
current=<value : longitude,latitude>
}

xpl-trig

n/a

xpl-cmnd

n/a

Changelog

1.2

  • Add tests (they work only in local for now, not on travis)
  • Upgrade json : devices MUST BE recreated
  • Add travis-ci

1.1

  • Logs improvment

1.0

  • Plugin creation
  • Supported urls : GET for tasker and test page, POST for Trip Tracker Android app