We have moved to a new Sailfish OS Forum. Please start new discussions there.

# We need a Scheduler or Automation tool like Profilematic or Situations [answered]

I would like to have the option to make the phone silent at ex. 10.30pm and enable sounds ex. 7.30am automatically. It would also be cool if you could make the phone go to power saving without automatic data connection (like email fetching), or run spesific commands on entering a particular mobile network cell.

The functionality of ProfileMatic in N9 made it possible for user to trigger various commands and actions (e.g. profile changes, entering power-saving mode etc) based on signals/triggers from the system like entering a particular gsm cell, being connected to a spesific WiFi access point, etc. or simply based on a date and time (used as a scheduler).

Now, it would be great to have this kind of scheduler/automation/personalization tool that could even be combined to the Ambience changes in Jolla.

edit retag reopen delete

### The question has been closed for the following reason "the question is answered, an answer was accepted"by Jolly-Jo close date 2015-02-11 15:24:47.518619

25

it is a "must have" feature. Including Cell/WLAN based location triggers.

( 2013-12-25 21:37:34 +0300 )edit
12

i suppose this is the most relevant answer at the moment: ajalkane, the creator of profilematic, intends to port profilematic to sailfish, if it's feasible. at the moment he is waiting for a jolla device. i don't know if that perhaps means donations would speed up the process :

( 2013-12-26 18:25:07 +0300 )edit

Hmm, don't you need possibility to run headless daemons for it (and start them during bootup)? Or possibility for running your app on schedule? Both things are possible, both won't let you get through Harbour criteria at the moment.

( 2013-12-30 00:58:55 +0300 )edit
3

Profilematic would be fantastic, I hope ajalkane could start working with the port, sooner the better. Anyway I think Jolla could add a simple automated silent feature similar to iOS "Do not disturb" feature. This is something we had already in Symbian devices.

( 2014-01-01 22:22:40 +0300 )edit
16

Actually, I think it would be a good idea to integrate the profilematic functionality with the Ambience idea. Currently, when you are marking as fav an ambience, you can set the ringtone volume and tones for that ambience. The idea would be to include WLAN/bluetooth/IM status/etc and trigger action

( 2014-01-02 15:27:50 +0300 )edit

Sort by » oldest newest most voted

Hello everybody,

I started to write some code (GitHub), to do something like profilematic, but with a much more modern architecture. It's still in the early days of prototyping, and there is nothing interesting to show yet. I didn't know until today that there were already quite a lot of nice preparation work done on TJC, so I will share what I did too, so that we can do it together (c)

I'm at Step 2 of this answer. I'm open to discuss my architecture and will edit the answer if you agree.

## Overview

I'm trying to write a library for having a bot reacting to events and executing actions, the phonebot library. Phonebot have

• libphonebot, a static library that provides the engine to read and execute rules
• plugins to have more capabilities
• phonebotd, the daemon that execute these rules
• jolla-settings-phonebot, a settings plugin to configure phonebot
• harbour-phonebot, a selfcontained daemon + app to pass harbour

Since most of the stuff is done inside libphonebot, I can create several packages that share the same basis, one for harbour, others for openrepos etc. Note that phonebotd and harbour-phonebot might be incompatible, so you would run either phonebotd + settings-phonebot or harbour-phonebot.

## Architecture

phonebot isn't trying to reinvent the wheel and takes inspiration from both profilematic, IFTTT and on{X}. The idea is simple: you build rules, either à-la profilematic-IFTTT, with if -> then conditions, or by writing scripts.

Since we are with Qt, we can take advantage of QML and JS to write rules. Actually phonebot is just reading QML files that contains rules. It uses the powerful QQmlEngine to do all the hard work of parsing, interpreting etc.

A Rule in phonebot is a QML component that have 3 properties

• trigger: something that triggers the rule
• condition: a condition (or conditions) to respect for the rule to be active
• actions: a series of actions to execute when the rule is triggered, and when conditions are respected

The Trigger is in charge of emitting signals to run the Rule. Triggers could be: when it's 10pm, when you enter in the home wifi zone, when Battery reached a certain level etc.

The Condition do not provide any signal, and represent more a state. A Condition could be "when driving", "when at home" etc. (even if implementing this kind of condition is rather tricky).

An Action is what to run: execute a program, turn on / off some settings, change an ambience, or use DBus to do stuff.

Here is an example of scripted rule. You will also be able to configure rule with a friendly UI (using default Triggers, Conditions and Actions).

import org.SfietKonstantin.phonebot 1.0

Rule {
name: "SimpleRule"
trigger: TimeTrigger { hour: 22; minute: 0 }
actions: ActionSilent { silent: true }
}


## Technologies

I need to check if the QtMobility modues got ported to Qt 5. It's unsure if QSystem* are available. However, a lot of APIs are actually open-source, and, even if they are forbidden in harbour, they can be integrated (statically) in phonebot.

Here is a non-exaustive list of libraries I plan to use

## Testing versions

Initial POC is done, and I have some testing versions, that allows you to play with time and profile. Have a look at TMO and test them !

more

Seems to be a very good start to me. Thanks for joining in :)

Let us know if you need help !

( 2014-07-08 12:08:49 +0300 )edit

Wow. IFTTT support sounds very interesting. Your initial proof of concept release seems to have a good key features I miss in sailfishos. In addittion to that I would like too see some time based network management like " turn wifi/mobile data off from 8.00 to 16.00. Thanks for your contribution in bringing new functionalities to jolla :)

( 2014-07-08 19:24:46 +0300 )edit
4

Initial proof of concept is out, see TMO

( 2014-07-08 20:39:37 +0300 )edit

Right way .. thank's for ideas .. I like systematic soulutions..

( 2014-07-09 13:35:49 +0300 )edit

This sounds interesting. The programmability is what was lacking in Profilematic. But this reminds me of Mobots, which was available for Symbian.

( 2014-07-09 18:58:30 +0300 )edit

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Since a lot of people want this, and since we are on http://together.jolla.com, why don't we do it together ?

ProfileMatic is certainly a good start. It's under GPL, let's port it to Sailfish OS !

Here's what I suggest :

## Events

Time based events :

• ☐ Weekdays
• ☐ Start/End time
• ☐ Idle time
• ☐ Calendar event

Kaacz example: On N9 I have rule "In week night & Idle 10min set LPM on" & "In weekend & Idle 10min set LPM on".

Location based events :

• ☐ Entered/Exited specified location based on mobile cell-IDs
• ☐ Entered/Exited specified location based on GPS

Network based events :

• ☐ Connected to any WLAN
• ☐ Connected to specified WLAN (rely on router MAC address)

Battery based events :

• ☐ Status (charging, not charging)
• ☐ Level

## Actions

Netword related actions :

• ☐ Set WiFi on/off
• ☐ Connect to specified WLAN (this one also turns WiFi on if needed)
• ☐ Set BlueTooth on/off
• ☐ Set 3G/4G on/off
• ☐ Set Plane mode on/off
• ☐ Set GPS on/off
• ☐ Set mobile data connectivity on/off (I no need data in night for.ex.)

Phone related actions :

• ☐ Set ring volume level
• ☐ Set media volume level
• ☐ Set brightness level
• ☐ Set specified ambiance
• ☐ Set locking on/off (I don't need a lock screen when at home)

App related actions :

• ☐ Launch specified app
• ☐ Set IM status (available, not available, disconnected)

Misc. :

• ☐ Send email to specified recipient(s) (the email content is generated from a template)
• ☐ Send SMS to specified recipient(s) (ie: your kid just got home : his/her phone sends you a SMS)
• ☐ Create a new backup

## Step 2 : Figure out how to technically do these things.

### Events

Time based events :

Location based events :

The QSystemNetworkInfo from Qt Mobility seems to be interesting here. It provides a cellId property and a cellIdChanged SIGNAL that should allow us to know where we are.

Network based events :

These are probably available if we listen to QNetworkConfigurationManager::configurationChanged SIGNAL. We then have a QNetworkConfiguration instance, and we can probably test it.

Battery based events :

Here again, Qt Mobility has a QSystemBatteryInfo class which seems to provide everything needed. There are batteryStatus, chargingState and remainingCapacityPercent properties. And of course, there also are batteryStatusChanged, chargingStateChanged and remainingCapacityPercentChanged SIGNALs.

QSystemDeviceInfo also has the necessary properties : batteryLevel, batteryStatus and currentPowerState.

Step 3 : Prioritize things depending on the OMGIWantThis-factor and what's doable on a technical POV.

Step 4a : Define a good architecture so it's easy to add Events and Actions.

Step 4b : Define what we want for UI/UX. (ProfileMatic seems great to me)

Step 5 : Code ! We'd need a team to work on the C++ part and another one to work on the UI (QML).

Step 6 : Improve. Add functionnalities from the lists defined in Step 1 as soon as they are technically available. Fix bugs. Improve the UI/UX.

• I can start a wiki post for Step 1. - DONE Feel free to edit/reorganize the lists above.
• I don't have the required skills for Step 2, but I can keep track of things and centralize everything if it's needed. I can also spend some time on searching/exploring source code, SDKs, etc.
• Step 3 must be voted.
• Step 4 must be debated.
• For Step 5, I'd like to help on the QML part since I don't know C++ :(
• And for Step 6, I'll probably be able to keep track of things, triage bugs, etc. We'll see until then :)

What do you guys think about that ? Who's in ?

more

5

Key point for me is the question, what Jolla's vision for ambiences is. Should it go towards a system adjusting the phone to a certain situation, i.e. something such as discussed here or will it just remain a fancy word for themes?

( 2014-06-27 21:02:46 +0300 )edit

Agree, maybe Jolla could inform us how long will it take to make something more out of the Ambiences. See https://together.jolla.com/question/397/screenborder-swipe/#post-id-9299

( 2014-06-28 16:05:19 +0300 )edit

Thanks for the link, I didn't realize I could get some information about this subject in a post titled "Screenborder Swipe"... But that's another issue :)

What's described in the post you're referring to is very interesting. I am convinced that providing system settings switches in ambiances is the way to go.

But we would still miss the ability to automatically change the ambiance, depending on some "Events". They are only talking about changing the ambiance manually.

One of the Actions I was thinking about is the ability to change the ambiance. If we manage to do that, and Jolla provide "extended ambiance" support, we achieve our goal.

Moreover, working on Step 1 and 2 could also benefit Jolla.

You know, I just watched Google I/O. And I also watched Apple's WWDC a few weeks ago. We have a lot to catch. We can't just sit here and wait for the small team at Jolla to provide everything, can we ?

( 2014-06-30 15:40:56 +0300 )edit

I am stay on this side and I want help with this ..

( 2014-07-10 18:50:23 +0300 )edit

A "Keep phone unlocked on [condition]" would be awesome. Correlates to https://together.jolla.com/question/51516/dont-lock-device-on-trusted-wifi/

( 2014-07-22 13:53:53 +0300 )edit

since today, there is Situations from Pastilli Labs available in Jolla-Harbour

more

2

This is Great news!

( 2015-01-01 17:03:23 +0300 )edit
3

Not very #SailfishOS type of UI, though :/

( 2015-01-01 17:21:12 +0300 )edit
3

And it can't start automatically at boot because of harbour limitations, unfortunately :(

( 2015-01-01 18:56:09 +0300 )edit
2

And takes more than 30% processor load and ~400 mW. It's a great idea, but completely useless under these circumstances.

( 2015-01-01 21:41:16 +0300 )edit

@Robomike Would you mind sharing your setup where that kind of numbers are observed? Of course it is not supposed to do that.

( 2015-01-01 21:51:20 +0300 )edit

I have just made a similar posting as I had not seen this one. So I am going to delete my posting but add my ideas here as an answer (comments cannot be that long). I hope this is OK. In some sense it is an answer as it specifies details of how it can be done.

As a Jolla user I would like to

• get maxmium battery life by specifying in which locations (work, home, ...) certain phone functions should be enabled or disabled automatically.
• have my Jolla "learn" a location by scanning the cell IDs of the mobile phone base station antennas in range. This is a user-controlled process: A scan is initiated manually and all cell IDs detected within a few minutes will from now on identify this location. I want to give a name to that location. See the Android program "Actions" which implements this very well (also the "Tasker" app). It must be possible to "refresh" a location at a later point in time as cell IDs may change when a base station antenna is replaced/updated.
• specify which phone functions should be enabled or disabled upon entering or exiting a location that my Jolla has learned. In particular I want to do this for WLAN and possibly Bluetooth.
• when I manually turn on WLAN in a friend's place, the WLAN must stay on, even if this is a location unknown to my Jolla. Automatic enabling/disabling of functions must only occur when a transition from/to a defined location is detected (exit/enter the range of a set of base station antennas that define a known location).
• GPS or WLAN should NOT be used to determine location. This is all about battery life and the precision of location achieved by looking at base station antennas in range is sufficient for this purpose.

Usage example: My Jolla would know when I am "at home" and enable WLAN when I return to my place. When all "home antennas" have gone out of range, WLAN will automatically be turned off.

Of course this does not have to be limited to WLAN and Bluetooth. Maybe somebody wants to use a different ringtone or volume setting in a certain location. But I don't think Sailfish OS should implement all kinds of automation functions like the Android apps "Actions" or "Tasker". The OS itself should only be able to dermine location by cell IDs (it naturally has to know about base station antennas in range) and control those functions that have a heavy impact on battery life. An API can be offered so that native apps can be written that provide more features. But I do not want to have an additional program running just to save battery life.

more

Most of those functionalitues and features were present (and still are) in N9 Profilematic, and the Cell Id Identification of location was how I used my phone to detect wherger I was at home or at work, and trigger actions and profiles when enerering and exiting those zones. It also had time based action triggers to e.g. turn WLAN off/on at partticular times or automatically go to silent mode when entering specific places. Excellent for the battery life and really badly needed stuff in our Jolla's ;)

( 2014-02-22 12:16:39 +0300 )edit
1

I did not know Profilematic, but it seems to be an excellent example of how automation could work. I hope that knowing locations by cell ID will be integrated into the Sailfish OS itself. It could be a distinctive feature: As far as I know, all other mobile operating systems need an app running for this type of service. Also time-based control sounds like a good idea that could be an integral feature of the Sailfish OS.

( 2014-02-22 16:31:07 +0300 )edit

Well that's what this topic is all about, and most of the suggestions you made are already written in the question description. If something is missing feel free to edit it accordingly.

( 2014-02-22 17:14:09 +0300 )edit

All we need is to expand Ambience functionality and include things that Profilematic is doing for N9. For example there is no point changing "ambience" for work or sleeping time. An ambience should be configurable to say e.g. Mon-Fri from 09:00-17:00 go silent mode, etc.

( 2014-04-03 14:43:22 +0300 )edit
1

Lack of scheduled profiles is the main reason my Jolla has been in the drawer for last 5 months. Has enyone asked this ajalkane guy if he would be willing to invest his time on porting to SailFish? Jolla development should send him a unit with a "pretty please" note attached.

( 2014-04-17 13:43:21 +0300 )edit

There is "Night Silence" application in harbour store, that covers the automatec sound mute part of your question.

more

3

closed source thoug!

( 2014-06-30 19:57:15 +0300 )edit