User Tools

Site Tools


settings

This is an old revision of the document!


settings.json

To alter the default behavior of the daemon, a settings file can be created / edited. The default location of this file is /etc/pilight/settings.json. All options and its default values are shown below:

{
	"port": 5000,
	"mode": "server",
	"log-level": 4,
	"pid-file": "/var/log/daemon/pilight.pid",
	"config-file": "/etc/pilight/config.json",
	"log-file": "/var/log/pilight.log",
	"send-repeats": 10,
	"receive-repeats": 1,
	"hw-socket": "/dev/lirc0",
	"hw-mode": "gpio",
	"gpio-sender": 0,
	"gpio-receiver": 1,
	"webserver-enable": 1,
	"webserver-root": "/usr/local/share/pilight/",
	"webserver-port": 5001,
	"webserver-cache": 1,
	"whitelist": "",
	"update-check": 1,
	"update-mirror": "http://apt.pilight.org/mirror.txt",
	"update-development": 1
}

However, not all settings options are compatible with each other. The two most important settings are those used with the different hw-mode. So, first an example of the default settings for each hw-mode:

Examples

GPIO

{
        "port": 5000,
        "mode": "server",
        "log-level": 4,
        "pid-file": "/var/run/pilight-daemon.pid",
        "config-file": "/etc/pilight/config.json",
        "log-file": "/var/log/pilight-daemon.log",
        "send-repeats": 10,
        "receive-repeats": 1,
        "hw-mode": "gpio",
        "gpio-receiver": 1,
        "gpio-sender": 0,
        "webserver-enable": 1,
        "webserver-root": "/usr/local/share/pilight/",
        "webserver-port": 5001,
 	"webserver-cache": 1,       
	"whitelist": "",
	"update-check": 1
}

Module

{
        "port": 5000,
        "mode": "server",
        "log-level": 4,
        "pid-file": "/var/run/pilight-daemon.pid",
        "config-file": "/etc/pilight/config.json",
        "log-file": "/var/log/pilight-daemon.log",
        "send-repeats": 10,
        "receive-repeats": 1,
        "hw-mode": "module",
        "hw-socket": "/dev/lirc0",
        "webserver-enable": 1,
        "webserver-root": "/usr/local/share/pilight/",
        "webserver-port": 5001,
        "webserver-cache": 1,
	"whitelist": "",
	"update-check": 1
}

Settings List

The following settings can be set in the settings file. If you leave a setting out, then the default value will be used:

Descriptions

NameDescription
portchange the default port the daemon will run at
modeshould the daemon be ran as the main server or as a client
serverthe server the client should connect to
log-levelthe default log level of the daemon
pid-filethe default location of the process id file
config-filethe default location of the config file
send-repeatshow many times should a code be send
receive-repeatshow many times should a code be received
hw-modewhat sender / receiving (interface) are we using
hw-socketwhat lirc socket should we read from
gpio-senderto what pin is the sender connected
gpio-receiverto what pin is the receiver connected
webserver-enableenable the built-in webserver
webserver-portwebserver port
webserver-rootwebserver root path
webserver-cacheread webgui files from memory
webserver-authenticationenable protected login to webgui
webserver-passwordwebgui password
webserver-usernamewebgui username
whitelistallow only certain ip (ranges) to connect to pilight
update-checkcheck for updates
update-mirrorlocation of the apt mirror file
update-developmentcheck for developmental updates

Format and Defaults

NameFormatDefault
portnumber5000
mode“client” / “server”“server”
server[ x.x.x.x, xxxx ]
log-level1 till 54
pid-filepath/var/run/pilight-daemon.pid
config-filepath/etc/pilight/config.json
send-repeatsnumber10
receive-repeatsnumber1
hw-modegpio / modulegpio
hw-socketdev path/dev/lirc0
gpio-sendergpio0
gpio-receivergpio1
webserver-enable1 or 01
webserver-portnumber5001
webserver-rootpath/usr/local/share/pilight/
webserver-cache1 or 01
webserver-authentication1 or 00
webserver-password
webserver-username
whitelist x.x.x.x, x.x.x.x, …127.0.0.1
update-check1 or 01
update-mirrorurlhttp://apt.pilight.org/mirror.txt
update-development1 or 00

Conflicts and Requirements

NameConflictRequires
port
mode
server “mode”: “client”
log-level
pid-file
config-file“mode”: “client”
send-repeats
receive-repeats
hw-mode
hw-socket“hw-mode”: “gpio”“hw-mode”: “module”
gpio-sender“hw-mode”: “module”“hw-mode”: “gpio”
gpio-receiver“hw-mode”: “module”“hw-mode”: “gpio”
webserver-enable
webserver-port “webserver-enable”: 1
webserver-root “webserver-enable”: 1
webserver-cache “webserver-enable”: 1
webserver-authentication “webserver-enable”: 1
webserver-password “webserver-enable”: 1
webserver-username “webserver-enable”: 1
whitelist
update-check
update-mirror “update-check”: 1
update-development “update-check”: 1

The bold settings are part of the developmental versions of pilight

settings.1386152894.txt.gz · Last modified: 2015/11/27 21:08 (external edit)