Library to call Pilight (currently pilight-send) from php.

v0.1-beta 2013-12-11 08:03 UTC

This package is not auto-updated.

Last update: 2020-07-06 05:26:10 UTC



Latest Stable Version SensioLabsInsight

Library to call pilight (currently via pilight-send) from php.

Dev branch is master branch.

Build Status

Table of Contents
  1. Installation
  2. Usage


The recommended way to install is through Composer.

    "require": {
        "se/pilight": "dev-master"

Basic usage

Require the composer autload file and import the namespace.

require_once __DIR__.'/vendor/autoload.php';

use \SE\Component\Pilight;


$sender =  new Pilight\Sender();
// or set a custom ip and port
$sender =  new Pilight\Sender($host = '', $port = 6535);

$protocol = 'elro';
$arguments = array(
    's' => 31,
    'u' => 1,

$device = new Pilight\Device($protocol, $arguments);
// or add the arguments later via setArguments

// turn it on

// send it!

If you need root permissions to call pilight-send, call setSudo(true) on $sender.


You can add the pilight-send executable to your sudoers configuration to make it callable via sudo without the need to enter a password. This is in case your pilight-send needs to be called via sudo rights you can get some unexpected output during runtime if setting it not.

$ sudo nano /etc/sudoers.d/pilight


www-data ALL= NOPASSWD: /usr/local/sbin/pilight-send
pi ALL= NOPASSWD: /usr/local/sbin/pilight-send
<REPLACE YOU USER> ALL= NOPASSWD: /usr/local/sbin/pilight-send