Skip to content

Commit

Permalink
[pilight] Refactor some parts and texts of the binding
Browse files Browse the repository at this point in the history
Signed-off-by: Niklas Dörfler <[email protected]>
  • Loading branch information
niklasdoerfler committed Feb 5, 2021
1 parent 5ee4f93 commit 02452c7
Show file tree
Hide file tree
Showing 14 changed files with 187 additions and 246 deletions.
48 changes: 30 additions & 18 deletions bundles/org.openhab.binding.pilight/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# pilight Binding

The pilight binding allows openHAB to communicate with a [pilight](http://www.pilight.org/) instance running pilight version 6.0 or greater.
The pilight binding allows openHAB to communicate with a [pilight](http://www.pilight.org/) instance running pilight
version 6.0 or greater.

> pilight is a free open source full fledge domotica solution that runs on a Raspberry Pi, HummingBoard, BananaPi, Radxa, but also on *BSD and various linuxes (tested on Arch, Ubuntu and Debian). It's open source and freely available for anyone. pilight works with a great deal of devices and is frequency independent. Therefor, it can control devices working at 315Mhz, 433Mhz, 868Mhz etc. Support for these devices are dependent on community, because we as developers don't own them all.
> pilight is a free open source full fledge domotica solution that runs on a Raspberry Pi, HummingBoard, BananaPi,
> Radxa, but also on *BSD and various linuxes (tested on Arch, Ubuntu and Debian). It's open source and freely available
> for anyone. pilight works with a great deal of devices and is frequency independent. Therefor, it can control devices
> working at 315Mhz, 433Mhz, 868Mhz etc. Support for these devices are dependent on community, because we as developers
> don't own them all.
pilight is a cheap way to control 'Click On Click Off' devices. It started as an application for the Raspberry Pi (using the GPIO interface) but it's also possible now to connect it to any other PC using an Arduino Nano. You will need a cheap 433Mhz transceiver in both cases. See the [Pilight manual](https://manual.pilight.org/electronics/wiring.html) for more information.
pilight is a cheap way to control 'Click On Click Off' devices. It started as an application for the Raspberry Pi (using
the GPIO interface) but it's also possible now to connect it to any other PC using an Arduino Nano. You will need a
cheap 433Mhz transceiver in both cases. See the [Pilight manual](https://manual.pilight.org/electronics/wiring.html) for
more information.

## Supported Things

Expand All @@ -18,33 +26,30 @@ pilight is a cheap way to control 'Click On Click Off' devices. It started as an

## Binding Configuration

Things can be configured using Paper UI, or using a `.things` file.
The configuration in this documentation explains the `.things` file, although you can find the same parameters from the Paper UI.

### `bridge` Thing

A `bridge` is required for the communication with a pilight daemon. Multiple pilight instances are supported by creating different pilight `bridge` things.
A `bridge` is required for the communication with a pilight daemon. Multiple pilight instances are supported by creating
different pilight `bridge` things.

The `bridge` requires the following configuration parameters:

| Parameter Label | Parameter ID | Description | Required |
|-----------------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| IP Address | ipAddress | Host name or IP address of the pilight daemon | yes |
| Port | port | Port number on which the pilight daemon is listening. Default: 5000 | yes |
| Delay | delay | Delay (in millisecond) between consecutive commands. Recommended value without band pass filter: 1000. Recommended value with band pass filter: somewhere between 200-500. Default: 500 | no |

Important: you must explicitly configure the port in the pilight daemon config or otherwise a random port will be used and the binding will not be able to connect.
| Delay | delay | Delay (in millisecond) between consecutive commands. Recommended value without band pass filter: 1000. Recommended value with band pass filter: somewhere between 200-500. Default: 500 | no |

Important: you must explicitly configure the port in the pilight daemon config or otherwise a random port will be used
and the binding will not be able to connect.

### `contact`, `dimmer`, `switch`, `generic` Things

These things have alle one required parameter:
These things have all one required parameter:

| Parameter Label | Parameter ID | Description | Required |
|-----------------|--------------|------------------------|----------|
| Name | name | Name of pilight device | yes |


## Channels

The `bridge` thing has no channels.
Expand All @@ -57,20 +62,27 @@ The `contact`, `dimmer` and `switch` things all have one channel:
| `dimmer` | dimlevel | Dimmer | Dim level of the dimmer |
| `switch` | state | Switch | State of the switch |

The `generic` thing has no fixed channels and you have to add them manually. Currently, only String and Number channels are supported.
The `generic` thing has no fixed channels, so you have to add them manually. Currently, only String and Number channels
are supported.

## Auto Discovery

### Bridge Auto Discovery

The pilight daemon implements a SSDP interface, which can be used to search for running pilight daemon instances by sending a SSDP request via multicast udp (this mechanism may only work if the [standalone mode](https://manual.pilight.org/configuration/settings.html#standalone) in the pilight daemon is disabled.
After loading the binding this bridge discovery is automatically run and scheduled to scan for bridges every 10 minutes.
The pilight daemon implements a SSDP interface, which can be used to search for running pilight daemon instances by
sending a SSDP request via multicast udp (this mechanism may only work if
the [standalone mode](https://manual.pilight.org/configuration/settings.html#standalone) in the pilight daemon is
disabled. After loading the binding this bridge discovery is automatically run and scheduled to scan for bridges every
10 minutes.

### Device Auto Discovery
After a `bridge` thing has been configured in openHAB, it automatically establishes a connection between pilight daemon and openHAB.
As soon as the bridge is connected, the devices configured in the pilight daemon are automatically found via autodiscovery in background (or via a manually triggered discovery) and are displayed in the inbox to easily create things from them.

## Examples
After a `bridge` thing has been configured in openHAB, it automatically establishes a connection between pilight daemon
and openHAB. As soon as the bridge is connected, the devices configured in the pilight daemon are automatically found
via autodiscovery in background (or via a manually triggered discovery) and are displayed in the inbox to easily create
things from them.

## Full Example

things/pilight.things

Expand Down
14 changes: 0 additions & 14 deletions bundles/org.openhab.binding.pilight/src/main/feature/feature.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010-2021 Contributors to the openHAB project
See the NOTICE file(s) distributed with this work for additional
information.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0
SPDX-License-Identifier: EPL-2.0
-->
<features name="org.openhab.binding.pilight-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
public class PilightBridgeConfiguration {

private String ipAddress = "";
private Integer port = 0;
private Integer delay = 500;
private int port = 0;
private int delay = 500;

public String getIpAddress() {
return ipAddress;
Expand All @@ -43,7 +43,7 @@ public void setPort(Integer port) {
this.port = port;
}

public Integer getDelay() {
public int getDelay() {
return delay;
}

Expand Down
Loading

0 comments on commit 02452c7

Please sign in to comment.