Localization with eedomus (part 1) : smartphone side

Introduction

The eedomus smarthome controller includes an unusual feature which is location tracking. This feature could seem to be an anecdotic one for smart hone. But linked to special rules able to trigger actions regarding this location, it adds multiple automation possibilities.

This first part will focus on smartphone side, how to update location on eedomus transparently.

A second post will describe a scenario using location. The example will speak by itself.

References

I have surfed on internet, into blog to find some information. I have found.

A new free app is also available on google play store : eebud. It is promising but in alpha stage, and does’nt match perfectly my needs. You can have some information about this one on french eedomus forum.

Also a french post done by Antor have helped a lot : Désactivation de l’alarme avec Tasker. His solution is also based on the use of Tasker for Android. But he doesn’t use location capability of eedomus by itself.

The goal

On the smartphone side, the goal is to have a completely transparent solution for the user which updates location regularlyon eedomus.

I have the following requirements :

working when mobile is active or inactive

indistinguishable power consumption : for the function described here, you should have less than 4% of the power used by tasker

a flexible solution: if my needs are evolving ( location more precise, location at certain moment or certain locations, …) I can update it

I don’t need a very precise location : location update done by using cellular network antennas, without using internal GPS, is sufficient. This provides around 100m of precision most of time, with some important gaps sometime (>400m)

However if my navigation app is in use, and so the GPS, why not using precise coordinates, also speed, by using embedded GPS.

certain geographical location have to be detected quickly (home, work)

not to send location update if location have not changed to limit traffic and consumption

specific management when my smartphone is connected to my personal wifi : update has to be done locally on eedomus controller, and precise location of my house have to be sent.

Eedomus configuration

Before all a GPS tracker peripheral have to be available on controller to be updated. It can be done from configuration panel :

Use Add device button

Select Another type of device

At the bottom select

GPS tracker type

…

…

When peripheral is created, you have to note down the API code of it. It will be used to update it :

Android configuration

The Tasker for Android application will be configured and used on smartphone side. This app can automatize multiple tasks on it and communicate on network.

Particular smartphone, like my Sony, have consumption optimization features (Stamina mode). Tasker is to be permitted to wake up the device if this mode is activated (which I advise). On Sony devices it can be configure in Power configuration panel :

select stamina option (without selecting blue ON/OFF slider)

Add tasker in the exception list

It is also advisable to keep wifi constantly active, wifi access point that are detected are also used to define location of the mobile when not using GPS chip.

Programming tasker

Proposed configuration import

I provide different configuration in the form of xml files. You can directly import those in your mobile :

Tasker Vars

This chapter is only informative : those vars will be automatically created by tasks.

Two global vars will be used : %LOCALISATION containing last location value sent to eedomus and %LOCALISATION_OLD containing previous value. By comparing both the task knows if an update have to be done or not on the smarthome controller.

Tasker Tasks

Two tasks have to be created.

Do Nothing task

It is really doing nothing, then it contains nothing apart a Stop action.

If mobile is not connected to personal wifi network, update location at https://api.eedomus.com.

Same parameters have to be changed compared to step (8.) apart from local IP address.

http or https error management.

If feedback code is not 200, then something goes wrong. The variable %LOCALISATION is put to 0 to force an update the next time.

Tasker Profiles

Those profiles have to be adapted to your own needs. I have 3 different types of profiles.

Profile with condition relative to an App (Waze)

This profile is detecting the use of my GPS navigation app. This profile state is used by the task described before.

The profile is checking if Waze app is active in my case. Because a task link is mandatory into a profile, the Do Nothing task is linked.

Repetition profile (From ..)

This type of profile is activated regularly every x minutes. I have two ones :

the first have also a condition on GPS navigation app in use.

The profile is activated every 2 minutes everytime and trigger the eedomus localization task.

the second one have no condition. It is activated every 30 minutes from 6AM to 10PM and trigger also the eedomus localization task

Geographic profiles (Home, Work)

For each Tasker wakeup, it checks the location. If we enter (or go outside) a defined geographical location the corresponding tasks are immediately triggered. I configure for both case the same behaviour : update location on eedomus. Those profiles enable to update very quickly the location for certain areas.

Geographical zone configuration in Tasker is simple because graphically displayed. Current location can also be used by using the target icon in the top menu bar.

The location detection method is configured at the bottom of the screen : GPS or cellular network. Cellular network mode is less precise but using very small power, this is the one I select. The geographical radius used for detection have to be sufficiently important to match location error of this mode, but also inactivity period of tasker. In my case Tasker is active every 2 minutes, which means a movement of 1km for 30km/h speed. A radius of 500 m is really a minimum value if setting a passage area.

Tasker Configuration

General parameters of Tasker have also to be checked.

In particular, the different wake-up times have to be updated if necessary. The different rules configured by tasker will be checked regularly following those parameters, smartphone being active or inactive. If the delay is too short, battery autonomy may suffer. If too long, Tasker will take a long time to react.

I propose to take a maximum reaction time of 2 minutes (mean is 1 minute then), having mobile ON or OFF. This is the configuration you can see on the right. Major parameters are :