mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-09 18:36:51 +00:00
Minimize configuration sample, add missing description, and example
This commit is contained in:
parent
6e087007fa
commit
3bb17aa23f
@ -14,51 +14,77 @@ ha_iot_class: "Local Polling"
|
||||
---
|
||||
|
||||
|
||||
A switch platform that issues 433 MHz commands using [pilight](https://www.pilight.org/) to turn a 433 MHz device on or off. The pilight HA hub has to be set up.
|
||||
The `pilight` switch platform is issuing 433 MHz commands using [pilight](https://www.pilight.org/) to turn a 433 MHz device on or off. The Pilight Home Assistant hub has to be set up.
|
||||
|
||||
Additionally RF commands can be defined that trigger this switch to turn on and off. This allows you to also use the remote shipped with your 433 MHz switch without mixing up the HA states. You can even define several on/off commands, thus several RF remotes to toggle this switch.
|
||||
Additionally RF commands can be defined that trigger this switch to turn on and off. This allows you to also use the remote shipped with your 433 MHz switch without mixing up the Home Assistant states. You can even define several on/off commands, thus several RF remotes to toggle this switch.
|
||||
|
||||
To be really sure that HA knows the actual state of your device it is recommended to use the RF remote with codes unknown to any of your 433 MHz devices. Thus you use the remote to trigger this switch to send the correct RF code to the device.
|
||||
To be really sure that Home Assistant knows the actual state of your device it is recommended to use the RF remote with codes unknown to any of your 433 MHz devices. Thus you use the remote to trigger this switch to send the correct RF code to the device.
|
||||
|
||||
To define a pilight switch, add the following lines to your `configuration.yaml`:
|
||||
To define a Pilight switch, add the following lines to your `configuration.yaml`:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
switch:
|
||||
platform: pilight
|
||||
switches:
|
||||
Bed light:
|
||||
on_code:
|
||||
protocol: intertechno_old # protocol has to be defined
|
||||
unit: 3 # these entries are protocol specific and can differ
|
||||
id: 4 # these entries are protocol specific and can differ
|
||||
'on': 1 # on has to be in apostrophes to be parsed correctly
|
||||
off_code:
|
||||
protocol: intertechno_old # protocol has to be defined
|
||||
unit: 3 # these entries are protocol specific and can differ
|
||||
id: 4 # these entries are protocol specific and can differ
|
||||
'off': 1 # off has to be in apostrophes to be parsed correctly
|
||||
on_code_receive: # optional
|
||||
protocol: daycom # protocol has to be defined
|
||||
systemcode: 14462 # these entries are protocol specific and can differ
|
||||
unit: 6 # these entries are protocol specific and can differ
|
||||
id: 34 # these entries are protocol specific and can differ
|
||||
state: 'on' # off has to be in apostrophes to be parsed correctly
|
||||
off_code_receive: # optional
|
||||
protocol: daycom # protocol has to be defined
|
||||
systemcode: 14462 # these entries are protocol specific and can differ
|
||||
unit: 6 # these entries are protocol specific and can differ
|
||||
id: 34 # these entries are protocol specific and can differ
|
||||
state: 'off' # on has to be in apostrophes to be parsed correctly
|
||||
- platform: pilight
|
||||
switches:
|
||||
Bed light:
|
||||
on_code:
|
||||
protocol: intertechno_old
|
||||
'on': 1
|
||||
off_code:
|
||||
protocol: intertechno_old
|
||||
'off': 1
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **switches** (*Required*): The array that contains all command switches.
|
||||
- **entry** (*Required*): Name of the command switch. Multiple entries are possible.
|
||||
- **switches** array (*Required*): The list that contains all command switches.
|
||||
- **[entry]** (*Required*): Name of the command switch. Multiple entries are possible.
|
||||
- **on_code** (*Required*): The code to turn the device on.
|
||||
- **off_code** (*Required*): The code to turn the device off.
|
||||
- **on_code_receive** (*Optional*): If given, this command will turn the switch on if it is received by pilight.
|
||||
- **off_code_receive** (*Optional*): If given, this command will turn the switch off if it is received by pilight.
|
||||
- **on_code_receive** (*Optional*): If given, this command will turn the switch on if it is received by Pilight.
|
||||
- **off_code_receive** (*Optional*): If given, this command will turn the switch off if it is received by Pilight.
|
||||
|
||||
Variables for the different codes:
|
||||
|
||||
- **protocol** (*Optional*): Protocol to use, eg. `intertechno_old` or `daycom`.
|
||||
- **systemcode** (*Optional*): The systemcode of the device.
|
||||
- **unit** (*Optional*): The unit to use.
|
||||
- **id** (*Optional*): ID of the device
|
||||
- **state** (*Optional*): `'on'` or `'off'` has to be in apostrophes to be parsed correctly.
|
||||
- **'off'** (*Optional*): `1` or `0`
|
||||
- **'on'** (*Optional*): `1` or `0`
|
||||
|
||||
For possible code entries look at the [pilight API](https://www.pilight.org/development/api/). All commands allowed by [pilight-send](https://wiki.pilight.org/doku.php/psend) can be used.
|
||||
|
||||
|
||||
## {% linkable_title Examples %}
|
||||
|
||||
```yaml
|
||||
switch:
|
||||
- platform: pilight
|
||||
switches:
|
||||
Bed light:
|
||||
on_code:
|
||||
protocol: intertechno_old
|
||||
unit: 3
|
||||
id: 4
|
||||
'on': 1
|
||||
off_code:
|
||||
protocol: intertechno_old
|
||||
unit: 3
|
||||
id: 4
|
||||
'off': 1
|
||||
on_code_receive:
|
||||
protocol: daycom
|
||||
systemcode: 14462
|
||||
unit: 6
|
||||
id: 34
|
||||
state: 'on'
|
||||
off_code_receive:
|
||||
protocol: daycom
|
||||
systemcode: 14462
|
||||
unit: 6
|
||||
id: 34
|
||||
state: 'off'
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user