Notices


Reply
Thread Tools
Posts: 344 | Thanked: 1,345 times | Joined on Aug 2012 @ Paris, FR
#1
Hi everybody,

After some discussions on TJC and some brainstorm, I'm proud to introduce phonebot, a scheduling daemon that takes inspiration from profilematic, IFTTT and on{X}

It has the following features
  • React to phone events, just like profilematic
  • If {events occurs} then {do something}, a bit like IFTTT (and profilematic too)
  • Scriptable using JS, just like on{X}, and QML

Architecture

phonebot isn't trying to reinvent the wheel. 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).

Code:
import org.SfietKonstantin.phonebot 1.0
import org.SfietKonstantin.phonebot.debug 1.0

Rule {
    name: "SimpleRule"
    trigger: DebugTrigger { path: "/test" }
    actions: LoggerAction {}
}
Rules are stored inside ~/.config/harbour-phonebot/<rule-folder>/rule.qml, you can add your own rule or take a look at rules generated by the client.

How to use

If you are running the harbour version (that is the only version being released), you should keep the application always on to have rules working.

To add a rule, use the pull down menu on the main page, you will then have to
  • Give a name (optionnal)
  • Configure a trigger
  • Configure a condition (optionnal)
  • Add some actions

Configure a component (Trigger, Condition or Action)

First, select the component you want to configure. A dialog will appear, asking you to select a component type. By clicking on this entry, you will be shown a list of components. Select the one you want.

Then, you will come back to the previous dialog. You will see that the selected component is shown in the component type, and you will be able to configure it.

Configure it, and accept to have the component configured. Remember that you need at least a trigger, to trigger an action, and an action to be triggered.

Download
  • harbour-phonebot 0.1.1: OBS
  • phonebot source code: GitHub

Of course, this post will be updated when new features comes.
__________________
Developer of Friends Facebook client, patchmanager, Phonebot
Blogger at Jollafr and random thoughts on my personnal blog
Support my work

Last edited by Sfiet_Konstantin; 2014-12-29 at 13:13.
 

The Following 32 Users Say Thank You to Sfiet_Konstantin For This Useful Post:
TMavica's Avatar
Posts: 2,021 | Thanked: 1,060 times | Joined on Apr 2010 @ Hong Kong
#2
OBS link not set correctly
__________________
The Glorious Lady T.Mavica
Twitter https://twitter.com/TMavica
 
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#3
Links will be added when links will be ready, obliviously
__________________
Telegram | Openrepos | GitHub | Revolut donations
 
Posts: 344 | Thanked: 1,345 times | Joined on Aug 2012 @ Paris, FR
#4
OBS always fails the first time you build your project
Sent a fix, hope this works.
__________________
Developer of Friends Facebook client, patchmanager, Phonebot
Blogger at Jollafr and random thoughts on my personnal blog
Support my work
 
Posts: 84 | Thanked: 79 times | Joined on Dec 2013
#5
Nice started, started to write something like this. Now I can use the time to ignore my other projects instead. (:
 
Posts: 123 | Thanked: 108 times | Joined on Oct 2008 @ Prague, Czech
#6
I was little modify and add list of cond&actions on Together..

For example Jolla as all MeeGo devices have Ring volume and Media volume separately ..
 
Posts: 344 | Thanked: 1,345 times | Joined on Aug 2012 @ Paris, FR
#7
One rule for your own entertainment. Better rules will come at some point

Code:
import org.SfietKonstantin.phonebot 1.0
import org.SfietKonstantin.phonebot.debug 1.0
import org.SfietKonstantin.phonebot.profile 1.0

Rule {
    trigger: DebugTrigger { path: "/silent" }
    action: [ ProfileAction { profile: "silent" }, LoggingRule {} ]
}
qdbus org.SfietKonstantin.phonebotdebug /silent org.SfietKonstantin.phonebotdebug.Ping will silent your phone (how impressive )
__________________
Developer of Friends Facebook client, patchmanager, Phonebot
Blogger at Jollafr and random thoughts on my personnal blog
Support my work
 
Posts: 752 | Thanked: 2,808 times | Joined on Jan 2011 @ Czech Republic
#8
Thank you, this looks very promising!

Have you looked into timedclient support integration? I'm using it (in a very hackish way though) in one of my apps and it's a great tool.
 
Posts: 344 | Thanked: 1,345 times | Joined on Aug 2012 @ Paris, FR
#9
Originally Posted by nodevel View Post
Thank you, this looks very promising!

Have you looked into timedclient support integration? I'm using it (in a very hackish way though) in one of my apps and it's a great tool.
I'm using https://github.com/nemomobile/nemo-keepalive right now.
I might use timed to do some alarm clock integration though.
__________________
Developer of Friends Facebook client, patchmanager, Phonebot
Blogger at Jollafr and random thoughts on my personnal blog
Support my work
 
Posts: 344 | Thanked: 1,345 times | Joined on Aug 2012 @ Paris, FR
#10
Right ... you should get a first release of the harbour enabled phonebot today for testing ... Right now, OBS is building it.

EDIT: 3 fails

And it's out. First release is very raw but lay down basis for enhancements. Please test and tell what you want next

Download here

PS: as it's the harbour verion, you need to keep the app open. The more integrated version will come quite soon.

EDIT2: hum, the release is pretty broken: no cover, and failing to create the rules. Will provide a fix asap
EDIT3: fix online: grab 0.1.1.
EDIT4: huhu, you actually got a SIGBUS when trying to save a rule, not nice ...
EDIT5: finally fixed, use the 0.1.1 link to DL.
__________________
Developer of Friends Facebook client, patchmanager, Phonebot
Blogger at Jollafr and random thoughts on my personnal blog
Support my work

Last edited by Sfiet_Konstantin; 2014-08-01 at 23:56.
 

The Following 2 Users Say Thank You to Sfiet_Konstantin For This Useful Post:
Reply

Tags
phonebot, task scheduler

Thread Tools

 
Forum Jump


All times are GMT. The time now is 12:11.