[edit] Proximus

This is a page discussing the implementation of a daemon which can trigger certain actions (e.g. change sound settings, open application) when certain states or conditions change (e.g. location, network connections, time)

Thanks to Jaffa for the name ("Mix of "proximity" and "tempus" - the original use cases")

Actions should be pluggable or scriptable by users, so they can add new features easily, the same is potentially true of the conditions (depends how hard that is to implement).

Ideally this daemon could be used as a backend for various potentially useful applications: e.g. reminder that your bus-stop is coming up; turn wifi off at night; change to silent mode during a meeting (from calendar), etc.

Please feel free to add more details, comments, etc.

[edit] Conditions

These are the things to be checked and if true will cause some action to be performed.

Time based

  • Current time [earlier than, later than, equal to]
  • Current hour [<, <=, ==, >, >=, !=]
  • Current minute [<, <=, ==, >, >=, !=]
  • Current second [<, <=, ==, >, >=, !=] - perhaps somewhat excessive -lardman

Location based

  • Current location [within some radius, outside of some radius] - implement by looking at the transitions, rather than continually running a rule while true/false? -lardman

Depending on the radius (and perhaps some hints) we can work out whether we can use cell id (free if we cache the relevant ones offline) or require GPS accuracy. In any case we can avoid turning the GPS on until we are close by using the known/cached cell id close to the location as the first part of the check.

  • Connected to X wifi network

Connection based

  • Connected to a wifi network
  • Bluetooth connection?


  • Specific application starts running
  • Specific application is running
  • Specific application stops running
  • Specific application isn't running
  • headphones plugged in/out
  • Charger plugged in/out
  • Specific type of calendar event is ongoing (e.g. meeting in progress)
  • NFC tag nearby (on N9)

[edit] Joins

  • AND
  • OR
  • NOT

How to allow combinations? Expressions supporting parentheses? e.g.

 wifi_connected(" WLAN") AND NOT (headphones_connected OR bluetooth_connected("Headset"))

[edit] Actions

  • Sound [on, off]
  • Profile select [General, Silent]
  • Bluetooth [connect, disconnect to/from known device?]
  • Bluetooth [on, off (visible)]
  • Wifi [connect, disconnect]
  • Wifi [auto-connect on/off]
  • Wifi [Auto change to wifi on/off]
  • Random Application [Start, stop]
  • Flight mode [on, off]
  • Mobile network [Dual, 3g, gsm]
  • predefined SMS to predefined number

Actions should be pluggable or scriptable by users, so they can add new features easily.

[edit] Interface

As this is a daemon, the user will need some way of interacting with it to produce their desired behaviour.

One option is for applications to be able to talk to the daemon via some API so that they can use its functionality themselves without exposing much to the user.

Some examples of applications that could use this functionality:

One would also want an overview of the rules that are in place (much like looking at the alarms list), and this would allow the user to set/delete different rules, and also to add priorities to the rules (otherwise we will end up with a case where rules conflict).

Would the user be allowed to delete rules that are set by external applications? They should be able to see them, so that they can alter the priority, but perhaps not be able to alter their specifics. Something to consider.

lcuk pointed out the Windows 7 parental controls as one thing to think about:

My initial thought was to be able to create a rule which contains potentially multiple conditions joined by Boolean operators (AND, OR, NOT, XOR) and have this composite rule trigger one or a number of Actions to be performed. I have seen this kind of thing used before for data analysis, I'll try to dig out a screen shot.