mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Examples for LCN service calls in yaml (#9672)
* YAML examples for LCN service calls * Add LCN key states
This commit is contained in:
parent
91b74d3631
commit
1defd6c2d0
@ -397,8 +397,9 @@ The [MOTOR_PORT](#ports) values specify which hardware relay configuration will
|
|||||||
|
|
||||||
| Constant | Values |
|
| Constant | Values |
|
||||||
| -------- | ------ |
|
| -------- | ------ |
|
||||||
| LED_STATE | `on`. `off`, `blink`, `flicker` |
|
| LED_STATE | `on`, `off`, `blink`, `flicker` |
|
||||||
| LOGICOP_STATE | `not`. `or`, `and` |
|
| LOGICOP_STATE | `not`, `or`, `and` |
|
||||||
|
| KEY_STATE | `hit`, `make`, `break`, `dontsend` |
|
||||||
|
|
||||||
### {% linkable_title Keys %}:
|
### {% linkable_title Keys %}:
|
||||||
|
|
||||||
@ -486,8 +487,13 @@ Set absolute brightness of output port in percent.
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
{"address": "myhome.0.7", "output": "output1", "brightness": 100, "transition": 0}
|
service: output_abs
|
||||||
|
data:
|
||||||
|
addres: myhome.0.7
|
||||||
|
output: output1
|
||||||
|
brightness: 100
|
||||||
|
transition: 0
|
||||||
```
|
```
|
||||||
|
|
||||||
### {% linkable_title Service `output_rel` %}
|
### {% linkable_title Service `output_rel` %}
|
||||||
@ -503,8 +509,12 @@ Set relative brightness of output port in percent.
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
{"address": "myhome.0.7", "output": "output1", "brightness": 30}
|
service: output_rel
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
output: output1
|
||||||
|
brightness: 30
|
||||||
```
|
```
|
||||||
|
|
||||||
### {% linkable_title Service `output_toggle` %}
|
### {% linkable_title Service `output_toggle` %}
|
||||||
@ -519,8 +529,12 @@ Toggle output port.
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
{"address": "myhome.0.7", "output": "output1", "transition": 0}
|
service: output_toggle
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
output: output1
|
||||||
|
transition: 0
|
||||||
```
|
```
|
||||||
|
|
||||||
### {% linkable_title Service `relays` %}
|
### {% linkable_title Service `relays` %}
|
||||||
@ -537,8 +551,11 @@ Example states: `t---001-`
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
{"address": "myhome.0.7", "state": "t---001-"}
|
service: relays
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
state: t---001-
|
||||||
```
|
```
|
||||||
|
|
||||||
### {% linkable_title Service `led` %}
|
### {% linkable_title Service `led` %}
|
||||||
@ -552,8 +569,12 @@ Set the led status.
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
{"address": "myhome.0.7", "led": "led6", "state": "blink"}
|
service: led
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
led: led6
|
||||||
|
state: blink
|
||||||
```
|
```
|
||||||
|
|
||||||
### {% linkable_title Service `var_abs` %}
|
### {% linkable_title Service `var_abs` %}
|
||||||
@ -571,8 +592,13 @@ If `unit_of_measurement` is not defined, it is assumed to be `native`.
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
{"address": "myhome.0.7", "variable": "var1", "value": 75, "unit_of_measurement": "%"}
|
service: var_abs
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
variable: var1
|
||||||
|
value: 75
|
||||||
|
unit_of_measurement: %
|
||||||
```
|
```
|
||||||
|
|
||||||
<p class='note'>
|
<p class='note'>
|
||||||
@ -595,8 +621,13 @@ If `unit_of_measurement` is not defined, it is assumed to be `native`.
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
{"address": "myhome.0.7", "variable": "var1", "value": 10, "unit_of_measurement": "%"}
|
service: var_rel
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
variable: var1
|
||||||
|
value: 10
|
||||||
|
unit_of_measurement: %
|
||||||
```
|
```
|
||||||
|
|
||||||
<p class='note'>
|
<p class='note'>
|
||||||
@ -615,8 +646,11 @@ Reset value of variable or setpoint.
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
{"address": "myhome.0.7", "variable": "var1"}
|
service: var_reset:
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
variable: var1
|
||||||
```
|
```
|
||||||
|
|
||||||
<p class='note'>
|
<p class='note'>
|
||||||
@ -637,8 +671,12 @@ If `state` is not defined, it is assumed to be `False`.
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
{"address": "myhome.0.7", "setpoint": "r1varsetpoint", "state": true}
|
service: lock_regulator
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
setpoint: r1varsetpoint
|
||||||
|
state: true
|
||||||
```
|
```
|
||||||
|
|
||||||
### {% linkable_title Service `send_keys` %}
|
### {% linkable_title Service `send_keys` %}
|
||||||
@ -653,15 +691,29 @@ If `time_unit` is not defined, it is assumed to be `seconds`.
|
|||||||
| ---------------------- | -------- | ----------- | ------ |
|
| ---------------------- | -------- | ----------- | ------ |
|
||||||
| `address` | No | [LCN address](#lcn-addresses) |
|
| `address` | No | [LCN address](#lcn-addresses) |
|
||||||
| `keys` | No | Keys string |
|
| `keys` | No | Keys string |
|
||||||
| `state` | Yes | Keys state | [SENDKEYCOMMANDS](#states) |
|
| `state` | Yes | Keys state | [KEY_STATE](#states) |
|
||||||
| `time` | Yes | Deferred time | 0.. |
|
| `time` | Yes | Deferred time | 0.. |
|
||||||
| `time_unit` | Yes | Time unit | [TIME_UNIT](#variables-and-units)
|
| `time_unit` | Yes | Time unit | [TIME_UNIT](#variables-and-units)
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
|
Send keys immediately:
|
||||||
|
```yaml
|
||||||
|
service: send_keys
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
keys: a1a5d8
|
||||||
|
state: hit
|
||||||
```
|
```
|
||||||
{"address": "myhome.0.7", "keys": "a1a5d8", "state": "hit"}
|
|
||||||
{"address": "myhome.0.7", "keys": "a1a5d8", "time": 5, "time_unit": "s"}
|
Send keys deferred:
|
||||||
|
```yaml
|
||||||
|
service: send_keys
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
keys: a1a5d8
|
||||||
|
time: 5
|
||||||
|
time_unit: s
|
||||||
```
|
```
|
||||||
|
|
||||||
### {% linkable_title Service `lock_keys` %}
|
### {% linkable_title Service `lock_keys` %}
|
||||||
@ -669,22 +721,36 @@ Examples:
|
|||||||
Locks keys.
|
Locks keys.
|
||||||
If table is not defined, it is assumend to be table `a`.
|
If table is not defined, it is assumend to be table `a`.
|
||||||
The key lock states are defined as a string with eight characters. Each character represents the state change of a key lock (1=on, 0=off, t=toggle, -=nochange).
|
The key lock states are defined as a string with eight characters. Each character represents the state change of a key lock (1=on, 0=off, t=toggle, -=nochange).
|
||||||
The command allows the locking of keys for a specified time period. For a time period the attributes `time` and `time_unit` have to be specified. For a time period only tabley `a` is allowed.
|
The command allows the locking of keys for a specified time period. For a time period the attributes `time` and `time_unit` have to be specified. For a time period only table `a` is allowed.
|
||||||
If `time_unit` is not defined, it is assumed to be `seconds`.
|
If `time_unit` is not defined, it is assumed to be `seconds`.
|
||||||
|
|
||||||
| Service data attribute | Optional | Description | Values |
|
| Service data attribute | Optional | Description | Values |
|
||||||
| ---------------------- | -------- | ----------- | ------ |
|
| ---------------------- | -------- | ----------- | ------ |
|
||||||
| `address` | No | [LCN address](#lcn-addresses) |
|
| `address` | No | [LCN address](#lcn-addresses) |
|
||||||
| `table` | Yes | Table with keys to lock |
|
| `table` | Yes | Table with keys to lock |
|
||||||
| `state` | No | Key lock states as string | [SENDKEYCOMMANDS](#states) |
|
| `state` | No | Key lock states as string | [KEY_STATE](#states) |
|
||||||
| `time` | Yes | Time period to lock | 0.. |
|
| `time` | Yes | Time period to lock | 0.. |
|
||||||
| `time_unit` | Yes | Time unit | [TIME_UNIT](#variables-and-units)
|
| `time_unit` | Yes | Time unit | [TIME_UNIT](#variables-and-units)
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
|
Lock keys forever:
|
||||||
|
```yaml
|
||||||
|
service: lock_keys
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
table: a
|
||||||
|
state: 1---t0--
|
||||||
```
|
```
|
||||||
{"address": "myhome.0.7", "table": "a", "state": "1---t0--"}
|
|
||||||
{"address": "myhome.0.7", "state": "1---t0--", "time": 10, "time_unit": "s"}
|
Lock keys for a specified time period:
|
||||||
|
```yaml
|
||||||
|
service: lock_keys
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
state: 1---t0--
|
||||||
|
time: 10
|
||||||
|
time_unit: s
|
||||||
```
|
```
|
||||||
|
|
||||||
### {% linkable_title Service `dyn_text` %}
|
### {% linkable_title Service `dyn_text` %}
|
||||||
@ -702,8 +768,12 @@ Each row can be set independently and can store up to 60 characters (encoded in
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
{"address": "myhome.0.7", "row": 1, "text": "text in row 1"}
|
service: dyn_text
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
row: 1
|
||||||
|
text: "text in row 1"
|
||||||
```
|
```
|
||||||
|
|
||||||
### {% linkable_title Service `pck` %}
|
### {% linkable_title Service `pck` %}
|
||||||
@ -717,6 +787,9 @@ Send arbitrary PCK command. Only the command part of the PCK command has to be s
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
{"address": "myhome.0.7", "pck": "PIN4"}
|
service: pck
|
||||||
|
data:
|
||||||
|
address: myhome.0.7
|
||||||
|
pck: PIN4
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user