User Tools

Site Tools


config

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
config [2015/03/08 12:41]
pilino1234 Fixed link and updated page for pilight >5.0
config [2015/11/27 21:09] (current)
Line 6: Line 6:
  
 The pilight configuration has to be put in an external file called config.json. It is located under /​etc/​pilight/​config.json The pilight configuration has to be put in an external file called config.json. It is located under /​etc/​pilight/​config.json
 +
 +For any questions regarding JSON, [[http://​en.wikipedia.org/​wiki/​JSON|Wikipedia]] provides a brief introduction into JSON. In particular the section "Data types, Syntax and Examples"​ is helpful to understand where to use square and curly brackets, commas, double quotes and the colon.
  
 ===== Basic Syntax ===== ===== Basic Syntax =====
Line 85: Line 87:
 </​code>​ </​code>​
  
-As you can see, a single KlikAanKlikUit code was interpreted as three different devices. You need to choose carefully which device ​actually sent its code to make sure how to define it in the device setup. The difference is that a dimmer ​will have a slider option and a on/off button, a switch will just show an on/off button, and a screen will have momentary up/down buttons. Defining a screen as a dimmer just won't work as you might expect and as it seems logical.+As you can see, a single KlikAanKlikUit code was interpreted as three different devices. You need to choose carefully ​from which device ​the code actually originated in order to properly ​define it in the device setup. The difference is that the GUI will have an on/off button ​and a slider option for the dimmerfor a switch ​the GUI will just show an on/off button, and for a screen ​the GUI will show momentary up/down buttons. Defining a screen as a dimmer just won't work as you might expect and as it seems logical.
  
 ==== Multiple ID's ==== ==== Multiple ID's ====
-Each protocol needs to have at least one id defined so pilight knows what device ​has been controlled. However, it is possible that you have multiple KlikAanKlikUit remotes ​that control ​the same KlikAanKlikUit switch. ​In that case, you can define multiple ids to your devices. In case of a KlikAanKlikUit switch:+Each protocol needs to have at least one id to be defined so pilight knows what device ​it is controlling. However, it is possible that you have multiple KlikAanKlikUit remotes ​controlling ​the same KlikAanKlikUit switch. ​If this is the case, you can define multiple ids to your devices. In case of a KlikAanKlikUit switch:
  
 <​code>​ <​code>​
 [...] [...]
     "​devices":​ {     "​devices":​ {
-        "bookShelveLight": {+        "bookShelfLight": {
             "​protocol":​ ["​kaku_switch"​],​             "​protocol":​ ["​kaku_switch"​],​
             "​id":​ [{             "​id":​ [{
Line 186: Line 188:
  
 ===== Rules ===== ===== Rules =====
-Since pilight version 6, eventing has been introduced. To use events, you need to first define rules inside the pilight configuration.+Since pilight version 6, eventing has been introduced. To use events, you need to define rules inside the pilight configuration ​first.
  
 The basic pilight rule structure for the configuration looks like this: The basic pilight rule structure for the configuration looks like this:
Line 203: Line 205:
 As you can see, a rules object consists of various elements: As you can see, a rules object consists of various elements:
  
-   * Each rule is placed in its own object with unique identifier.+   * Each rule is placed in its own object with an unique identifier.
    * Each rule consists of the actual rule placed in the rule field.    * Each rule consists of the actual rule placed in the rule field.
    * Each rule consists of an active field that tells pilight if the rule is active or not.    * Each rule consists of an active field that tells pilight if the rule is active or not.
Line 210: Line 212:
  
 ===== GUI ===== ===== GUI =====
-pilight has an extensive API that allows developers to create custom control GUIs. A pilight GUI is actually nothing more then presenting those devices a user want to control easily. This means that a GUI doesn'​t have to show all devices added to the device setup and that not all GUIs have to show the same devices. You can have a create a more compact GUI for a small screen such as a mobile phone or a more extensive GUI for your computer screen.+pilight has an extensive API that allows developers to create custom control GUIs. A pilight GUI is actually nothing more then presenting those devices a user wants to control easily. This means that a GUI doesn'​t have to show all devices added to the device setup and that not all GUIs have to show the same devices. You can create a more compact GUI for a small screen such as a mobile phone or a more extensive GUI for your computer screen.
  
 ==== Elements ==== ==== Elements ====
Line 245: Line 247:
             "​name":​ "​Television",​             "​name":​ "​Television",​
             "​group":​ [ "​Living"​ ],             "​group":​ [ "​Living"​ ],
-            "​media":​ [ "​web"​ ],+            "​media":​ [ "​web"​ ]
         },         },
         "​bookShelfLight":​ {         "​bookShelfLight":​ {
Line 276: Line 278:
  
 ===== Settings ===== ===== Settings =====
-The way pilight ​functions ​can be altered by changing various settings. Some settings are more advanced then others, and some settings are required by others. The most important ones will be described here. For a full description of the pilight settings, check the appropriate [[settings|wiki page]].+The way pilight ​works can be altered by changing various settings. Some settings are more advanced then others, and some settings are required by others. The most important ones will be described here. For a full description of the pilight settings, check the appropriate [[settings|wiki page]].
  
   * port   * port
-  * send-repeats 
   * receive-repeats   * receive-repeats
   * webserver-enable   * webserver-enable
Line 297: Line 298:
  
 === send-repeats and receive-repeats === === send-repeats and receive-repeats ===
-The send-repeats setting will define how many times pilight must repeatedly send a code. This can depend on your environment. If you have a clear view between your Raspberry Pi and the devices you want to switch, then this number can be lower. When your Raspberry Pi is in a environment with a lot of interference this number needs to be higher. ​The same counts ​for the receive-repeats ​setting. This number defined ​how many times a code must be received before pilight interprets it as a valid code. This number is also relevant for those who aren't using a low-pass filter. When noise is received, it often happens that by chance a pattern of noise is the same as the codes sent by one of the supported protocols. This means that pilight will receive false positives. The chance that this noise actually represents the same ID as your device is really low, but if you want to be sure, just increase this number.+The send-repeats setting will define how many times pilight must repeatedly send a code. This can depend on your environment. If you have a clear view between your Raspberry Pi and the devices you want to switch, then this number can be lower. When your Raspberry Pi is in a environment with a lot of interference this number needs to be higher. 
 + 
 +''​Support ​for send-repeats ​ends with pilight V6 and is replaced with individual protocol settings.''​ 
 + 
 +This numeric value for receive-repeats defines ​how many times a code must be received before pilight interprets it as a valid code. This number is also relevant for those who aren't using a low-pass filter. When noise is received, it often happens that by chance a pattern of noise is the same as the codes sent by one of the supported protocols. This means that pilight will receive false positives. The chance that this noise actually represents the same ID as your device is really low, but if you want to be sure, just increase this number.
  
 <​code>​ <​code>​
-"​send-repeats":​ 10, 
 "​receive-repeats":​ 1 "​receive-repeats":​ 1
 </​code>​ </​code>​
Line 333: Line 337:
  
 === whitelist === === whitelist ===
-All pilight clients connect to pilight by using a TCP socket connection. If you want to restrict access to pilight to certain devices of IP ranges, and block others, you can add these to the whitelist. You can define specific IP addresses like 192.168.2.100 or IP ranges like 192.168.2.*. In the last case all IP addresses from 192.168.2.1 to 192.168.2.255 will be allowed to connect to pilight. In the first case only the device with the IP address 192.168.2.100 will be allowed to connect to pilight. You can add several of these IP addresses to the whitelist by separating them by a comma. The localhost IP address (127.0.0.1) ​is allowed ​by default and can't be blocked.+All pilight clients connect to pilight by using a TCP socket connection. If you want to restrict access to pilight to certain devices of IP ranges, and block others, you can add these to the whitelist. You can define specific IP addresses like 192.168.2.100 or IP ranges like 192.168.2.*. In the latter ​case all IP addresses from 192.168.2.1 to 192.168.2.255 will be allowed to connect to pilight. In the first case only the device with the IP address 192.168.2.100 will be allowed to connect to pilight. You can add several of these IP addresses to the whitelist by separating them by a comma. The localhost IP address (127.0.0.1) ​has to be enabled ​by default and can't be blocked.
  
 <​code>​ <​code>​
 "​whitelist":​ "​192.168.2.100,​ 10.0.0.*"​ "​whitelist":​ "​192.168.2.100,​ 10.0.0.*"​
 </​code>​ </​code>​
 +
 +See the [[settings]] wiki page for a full list of settings and descriptions.
  
 ===== Hardware ===== ===== Hardware =====
Line 345: Line 351:
 <​code>​ <​code>​
 { {
-    ​"​none":​ { }+  ​"​none":​ { }
 } }
 </​code>​ </​code>​
  
-In case the computer that the pilight-daemon is running does not have GPIO capabilities,​ choose this option.+In case the computer that the pilight-daemon is running ​on does not have GPIO capabilities,​ choose this option.
  
-==== 433.92Mhz ====+==== 433.92 MHz ====
 === lirc_rpi Kernel Module === === lirc_rpi Kernel Module ===
  
Line 357: Line 363:
 { {
     "​433lirc":​ {     "​433lirc":​ {
-        ​"​socket":​ "/​dev/​lirc0"​+      ​"​socket":​ "/​dev/​lirc0"​
     }     }
 } }
Line 364: Line 370:
 === Direct GPIO Access === === Direct GPIO Access ===
  
 +<​code>​
 { {
     "​433gpio":​ {     "​433gpio":​ {
Line 370: Line 377:
     }     }
 } }
 +</​code>​
  
 For pin numbering, please refer to the specification of the platform used on http://​www.wiringx.org. To disable either sending or receiving with 433gpio, just set the appropriate pin to -1. For pin numbering, please refer to the specification of the platform used on http://​www.wiringx.org. To disable either sending or receiving with 433gpio, just set the appropriate pin to -1.
 +
 +=== Arduino USB-Nano ===
 +
 +<​code>​
 +{
 +    "​433nano":​ {
 +        "​comport":​ "/​dev/​ttyUSB0"​
 +    }
 +}
 +</​code>​
 +
 +You can not configure the ports on the [[arduino]],​ the receiver is connected to pin D2 and the transmitter is connected to pin D5 of the nano.
 +
 +the only port you can configure currently is the USB port the Nano is connected to.
 +
 +<​code>​
 +{
 +    "​433nano":​ {
 +        "​comport":​ "​COM5"​
 +    }
 +}
 +</​code>​
 +
 +On Windows machines use the windows syntax for the com port.
 +
  
 ===== Registry ===== ===== Registry =====
-Besides all the fixed configuration objects, pilight also allows developers to use the integrated registry. This registry allows developers to store information ​that can later be retrieved when reading the configuration. pilight itself will for example store its current ​version and available ​version in the registry and the pilight webgui will store additional settings in there as well. You are therefore advised to leave the registry untouched so all additional information created by the different GUIs isn't lost.+Besides all the fixed configuration objects, pilight also allows developers to use the integrated registry. This registry allows developers to store information ​and to retrieve them later on. pilight itself will for example store its current version in the registry and the pilight webgui will store additional settings in there as well. You are therefore advised to leave the registry untouched so all additional information created by the different GUIs isn't lost.
  
config.1425818519.txt.gz · Last modified: 2015/11/27 21:08 (external edit)