Controlling Niko Home Control
Update

I was able to control Niko HC with help from @wouter.

I've installed a Android Emulator on my mac. Then with Wireshark I was able to sniff the communication.

Once you find the IP of the controller it's relatively simple:

First you need to send a TCP command: {"cmd": "startevents"}. This enables you to get feedback from the controller (to verify if the light turned on or it failed)

Then you can send a new TCP command: {"cmd": "listactions"}. This give you an overview of the available "actions" and their status (lights, actions,...)

If you want to know which rooms are available you'll need following command: {"cmd":"listlocations"} (Thanks to @Wim Deblauwe)

If you want to control an action you'll need following command: {"cmd": "executeactions", id="{ID}", "value1" = "{VALUE}"}

People with the energy module can use following TCP command: {"cmd": "listenergy"}. This should give you an overview of the energy consumption (I don't own this module so I'm not 100% sure).

If you want info about the system, then you can use following TCP command: {"cmd": "systeminfo"}. This gives you information like language, currency, api version,...

With Laravel I've build a little API which allows me to call an simple URL to control the lights:
/api/lights/{LIGHT}/{VALUE}

This calls following function:

Route::get('/api/lights/{light}/{value}', function($light, $value){

$service_port = 8000;
$address = '192.168.0.233';

/* Create a TCP/IP socket. */
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if ($socket === false) {
    return "socket_create() failed: reason: " . socket_strerror(socket_last_error()) . "\n";
}

$result = socket_connect($socket, $address, $service_port);
if ($result === false) {
    return "socket_connect() failed.\nReason: ($result) " . socket_strerror(socket_last_error($socket)) . "\n";
}

$in = json_encode(array(
    'cmd' =&gt; 'executeactions',
    'id' =&gt; intval($light),
    'value1' =&gt; intval($value)
));

socket_write($socket, $in, strlen($in));
$message = socket_read($socket,1000000);
socket_close($socket);

return $message;
});


Then I've build a little interface to easily turn on/off the lights:



Next steps


a custom 'presence simulation'.
add some more 'house data' with the help of Arduino (waterlevel status, weather station, ...)
...


Again, thanks @wouter for the provided information!