Skip to content

Commit

Permalink
Update Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Sep 30, 2024
1 parent bee154e commit af79696
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 9 deletions.
35 changes: 32 additions & 3 deletions docs/de/guide/firmware/additions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@

::: details Einfachen TCS-Befehl-Binärsensor erstellen
Neben den bereits vordefinierten kannst du ganz leicht zusätzliche Binärsensoren für jeden TCS-Befehl hinzufügen.

Reiner 32 Bit Befehl:
```yaml
<!--@include: minimal.example.yaml-->

binary_sensor: // [!code ++] // [!code focus]
- platform: tc_bus // [!code ++] // [!code focus]
name: "Benutzerdefinierter Befehl" // [!code ++] // [!code focus]
command: 0x00001100 // [!code ++] // [!code focus]
```
Command Parser:
```yaml
<!--@include: minimal.example.yaml-->

binary_sensor: // [!code ++] // [!code focus]
- platform: tc_bus // [!code ++] // [!code focus]
name: "Benutzerdefinierter Befehl" // [!code ++] // [!code focus]
command: 0x3b8f9a00 // [!code ++] // [!code focus]
type: open_door // [!code ++] // [!code focus]
address: 0 // [!code ++] // [!code focus]
```
:::
Expand Down Expand Up @@ -57,11 +70,23 @@ i2c: // [!code ++] // [!code focus]

## Fortgeschrittene Beispiele
### Home Assistant
::: details Bus-Commands senden

::: details Sending Bus commands
Mit Home Assistant kannst du Aktionen nutzen, um Commands über den Bus zu senden.
Benutze entweder `command` für reine 32 Bit Befehle oder `type`, `address`, `payload` und `serial_number` um Befehle über den Command Builder zu senden.

> [!INFO]
> Denk daran, das führende `0x` beim Senden eines HEX-Kommandos einzufügen. Wenn du es weglässt, musst du den HEX-Befehl in eine Dezimalzahl umwandeln.
> Denk an das führende `0x` beim Senden eines Befehls mit der `command` Eigenschaft. Wenn du es weglässt, musst du den HEX-Befehl in eine Dezimalzahl umwandeln.

Command Builder:
```yaml
service: esphome.doorman_s3_send_tc_command
data:
type: open_door
address: 0
```

32-Bit Befehle via `command`:
```yaml
service: esphome.doorman_s3_send_tc_command
data:
Expand All @@ -78,6 +103,10 @@ event_type: esphome.doorman
data:
device_id: 373c62d6788cf81d322763235513310e
command: "00001100"
type: "open_door"
address: "0"
payload: "0"
serial_number: "0"
origin: LOCAL
time_fired: "2024-08-12T12:34:13.718317+00:00"
context:
Expand Down
4 changes: 2 additions & 2 deletions docs/de/reference/esphome-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ You can send commands on the bus using the `tc_bus.send` action.
You can either use the `command` field to send a specific command or use the `type`, `address`, `payload`, and `serial_number` fields to create a more complex message. **Both cannot be used at the same time**.
:::

#### Example 1: Sending a Direct Command
#### Example 1: Sending a raw Command

```yaml
on_...:
- tc_bus.send:
command: 0x1A2B3C4D
```

#### Example 2: Sending a Command with Type, Address, and Serial Number
#### Example 2: Sending a Command via Command Builder

```yaml
on_...:
Expand Down
32 changes: 30 additions & 2 deletions docs/en/guide/firmware/additions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@

::: details Create a simple TCS Command Binary Sensor
You can easily add additional binary sensors for any TCS Command, alongside the preconfigured ones.

Command Builder:
```yaml
<!--@include: minimal.example.yaml-->

binary_sensor: // [!code ++] // [!code focus]
- platform: tc_bus // [!code ++] // [!code focus]
name: "Custom Command" // [!code ++] // [!code focus]
command: 0x3b8f9a00 // [!code ++] // [!code focus]
command: 0x00001100 // [!code ++] // [!code focus]
```
Raw Commands:
```yaml
<!--@include: minimal.example.yaml-->

binary_sensor: // [!code ++] // [!code focus]
- platform: tc_bus // [!code ++] // [!code focus]
name: "Custom Command" // [!code ++] // [!code focus]
type: open_door // [!code ++] // [!code focus]
address: 0 // [!code ++] // [!code focus]
```
:::
Expand Down Expand Up @@ -59,9 +72,20 @@ i2c: // [!code ++] // [!code focus]
### Home Assistant
::: details Sending Bus commands
You can use Home Assistant actions (formerly known as services) to send commands on the bus.
Either use the `command` to send raw commands or `type`, `address`, `payload` and `serial_number` to send commands via the command builder.

> [!INFO]
> Remember to include the leading `0x` when sending a HEX command. If you omit it, you'll need to convert the HEX command to a decimal number.
> Remember to include the leading `0x` when calling the action with the `command` property. If you omit it, you'll need to convert the HEX command to a decimal number first.

Command Builder:
```yaml
service: esphome.doorman_s3_send_tc_command
data:
type: open_door
address: 0
```

Raw Commands via `command`:
```yaml
service: esphome.doorman_s3_send_tc_command
data:
Expand All @@ -78,6 +102,10 @@ event_type: esphome.doorman
data:
device_id: 373c62d6788cf81d322763235513310e
command: "00001100"
type: "open_door"
address: "0"
payload: "0"
serial_number: "0"
origin: LOCAL
time_fired: "2024-08-12T12:34:13.718317+00:00"
context:
Expand Down
4 changes: 2 additions & 2 deletions docs/en/reference/esphome-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ You can send commands on the bus using the `tc_bus.send` action.
You can either use the `command` field to send a specific command or use the `type`, `address`, `payload`, and `serial_number` fields to create a more complex message. **Both cannot be used at the same time**.
:::

#### Example 1: Sending a Direct Command
#### Example 1: Sending a raw Command

```yaml
on_...:
- tc_bus.send:
command: 0x1A2B3C4D
```

#### Example 2: Sending a Command with Type, Address, and Serial Number
#### Example 2: Sending a Command via Command Builder

```yaml
on_...:
Expand Down

0 comments on commit af79696

Please sign in to comment.