Introducing KumoApp BETA

KumoApps are rules that run on the cloud ("くも"/kumo in Japanese). They work instantly without delay. Everything from as simple as "turn off AC when a window is open", to some of the very complex ones, can be configured with a few taps from your smartphone and tablets. Choose from tens of existing ones or define your own in just a few lines of code in Javascript.

Why KumoApp

It is amazing the variety of feature requests we receive since the release of Motion Sensor Tags in 2012. Some user wants to receive push notification every x minutes until door is closed, another user wants to receive notification when no motion is detected for y minute. With the introduction of Kumostat and the new types of sensors, there will be even wider variety of possible features that are useful to some, but not to everyone to make it worthwhile to add even more buttons/options into the already cluttered option screen. It is almost inevitable that we ended up with KumoApp.

With KumoApp, we can implement these variety of features very quickly with a few lines of Javascript code. Thanks to the KumoApp configuration interface, one can immediately install&use them from the native app interface with a few taps, as if they were integrated features.

Not only is it quick to use, but also it is quick to write your own KumoApp. It is designed such that people can help themselves by writing their own full-fledged algorithms with only basic knowledge of Javascript.

KumoApp is different from our Web Service JSON API, which is a lower level API on which our iOS and Web Apps are built. Some key benefits of KumoApp are
  • While our Web Service API is uni-directional (except you can define URL callbacks), KumoApp is naturally event-driven with "actions" and "events".
  • The actions and events in KumoApp are readily available from JavaScript, so that you can write your algorithm in just a few lines of code without knowing anything about AJAX/HTTP/JSON etc. You have tens of existing examples to start from.
  • We host your KumoApps 24/7 on our Cloud server, so you can define event triggers and scheduled tasks, without having a computer always turned on that runs your programs to receive URL callbacks or run scheduled tasks.
  • We automatically store all global variables/state of your app in our database and restore them the next time it runs, so complicated algorithms that span over multiple events can be defined. Examples are learning, adaptive and statistics/report generation apps.
  • We store the log output of your App in our database so that you can download it anytime to analyze data.

Advantages over IFTTT

KumoApp complements IFTTT rather than competes with it.

IFTTT KumoApp
Delay events are polled every 15 minutes Natively event driven. Delay is determined by network latency only, typically < 1 second
Logic only if(this){that} everything Javascript provides, if, forEach, some, switch, average, for loops, recursive function calls, binary search, Math.*, deviation, ....
Supported triggers 50 or so types of Internet based events. Motion, temperature too low/too high/change, humidity too low/too high/change, door/window open/close, PIR sensor detection/timeout, iOS device entering/exiting a location, water detection + every trigger in IFTTT by using KumoApp.Wp
Supported actions 50 or so types of Internet based actions. Turning on/off thermostat, fan, temperature sensor setting, beep a tag, light on/off, send push notifications to iOS/Android devices, posting a Tweet, and activating other network connected devices that support HTTP, such as Phillips Hue Lamp, using the KumoApp.httpCall action.
Statistics/logging IFTTT generated format Any format you define using Javascript and utility functions, given to KumoApp.Log function
Learning/adaptive algorithms Cannot be defined with the "if(this){that}" logic Everything is possible. See below time to temperature KumoApp for example
Cost Free with possible Ads Free with purchase of Tag Manager and at least one Wireless Sensor Tag


Getting Started


Here is a simple example for the KumoApp "When any of the window or door is opened, turn off AC/heat."
var sensors = <#door or window_[12|52|53]_N#>;
sensors.forEach(
function (sensor) {
    sensor.opened = function () {
        <#thermostat_[62]_1#>.turnoff();
    };
});

Standard Javascript language features are all supported. In this example, for each of the specified tag object, a property "opened" is assigned a call back function instance, where the specified thermostat's method "turnoff" is called.

The region inside "<" and ">" is called a "place holder". They are like a blank box that the KumoApp user will fill in through the iOS and Web interface. The first part inside the place holder, e.g. "door or window" is the description that appears in the configuration interface. The next part [12|52|53] limits the type of tags that can be configured, and the last part "N" or "1" specifies if multiple or a single tag needs to be set for this place holder. "...N" will become a Javascript array (...) while "...1" becomes a single object.

For example, if you write "<#Infra-red sensors_[72]_N#>" and "<#the thermostat_[62]_1#>" in your code, the configuration screen for iOS/web app would look like below, allowing user to pick one or more tags with accepted tag types.



The complete app for this is just a few lines:
<#infra-red sensors_[72]_N#>.forEach(
function (sensor) {
    sensor.detected = function () { <#the thermostat_[62]_N#>.target = sensor; };
});


This is a the code for the KumoApp "Send push when no motion is detected for x minute".
var target = <#motion sensor_[12]_1#>;
function notify()
{
    <~devices to send notification~>.push(target.name + "is not moved for too long");
}
var timeout=<%interval (seconds)_N%>*1000;
var timer=KumoApp.setTimeout(notify, timeout);
target.moved=function(t){
    KumoApp.stopTimer(timer);
    timer=KumoApp.setTimeout(notify, timeout);
}
The global object "KumoApp" is like the "Math" object in Javascript, that exposes static utility functions such as "setTimeout" and "stopTimer" and many others.


All global variables are saved and loaded automatically between each event call. Therefore, you can implement complicated logic that spans over multiple events. Below is a KumoApp that notifies on your iOS/android devices whenever you set temperature on the specified Kumostat, estimated time to reach the set temperature based on historical statistics.
var Normal=1, TooHigh=2, TooLow=3;
var kumostat = <#Kumostat_[72]_1#>;
var setTime, tempToRaise, tempToCool;
var averageTimeToHeatPerDeg=0, averageTimeToCoolPerDeg=0;
var devices = <~devices to send estimate~>;
kumostat.target.lowThSet=function(target){
    if(target.tempState==TooLow && kumostat.hvacOn)
    {
        setTime=KumoApp.Tick;
        tempToRaise=target.th_low-target.temperature;
        tempToCool=0;
        if(averageTimeToHeatPerDeg>0){
            devices.push("Expected to take " + KumoApp.UserFriendlyTimeSpan(averageTimeToHeatPerDeg*tempToRaise) + " to reach " + target.th_low);
        }
    }
}
kumostat.target.highThSet=function(target){
    if(target.tempState==TooHigh && kumostat.hvacOn)
    {
        setTime=KumoApp.Tick;
        tempToCool=target.temperature-target.th_high;
        tempToRaise=0;
        if(averageTimeToCoolPerDeg>0){
            devices.push("Expected to take " + KumoApp.UserFriendlyTimeSpan(averageTimeToCoolPerDeg*tempToCool) + " to reach " + target.th_high);
        }
    }
}
kumostat.target.temperatureCross=function(target){
    if(target.tempState=Normal && kumostat.hvacOn){
        if(tempToCool>0){
            if(averageTimeToCoolPerDeg==0)averageTimeToCoolPerDeg=(KumoApp.Tick-setTime)/tempToCool;
            else averageTimeToCoolPerDeg=(KumoApp.Tick-setTime)/tempToCool/2+averageTimeToCoolPerDeg/2;
        }
        else if(tempToRaise>0){
            if(averageTimeToHeatPerDeg==0)averageTimeToHeatPerDeg=(KumoApp.Tick-setTime)/tempToRaise;
            else averageTimeToHeatPerDeg=(KumoApp.Tick-setTime)/tempToRaise/2+averageTimeToHeatPerDeg/2;
        }
    }
}
The saved state / global variables is reset when the app is uninstalled.

Use AppCoder (if you do not have account yet, use guest@demo.org and password "guest" to login) see other examples and try out your idea today.


Place Holders


Utility Functions