From af79696624979d0a24963234cb1dd4c442bbc82f Mon Sep 17 00:00:00 2001 From: Florian Hess Date: Mon, 30 Sep 2024 21:27:43 +0200 Subject: [PATCH] Update Docs --- docs/de/guide/firmware/additions.md | 35 +++++++++++++++++++++++--- docs/de/reference/esphome-component.md | 4 +-- docs/en/guide/firmware/additions.md | 32 +++++++++++++++++++++-- docs/en/reference/esphome-component.md | 4 +-- 4 files changed, 66 insertions(+), 9 deletions(-) diff --git a/docs/de/guide/firmware/additions.md b/docs/de/guide/firmware/additions.md index bf010ca..0e6b8bb 100644 --- a/docs/de/guide/firmware/additions.md +++ b/docs/de/guide/firmware/additions.md @@ -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 + + +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 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] ``` ::: @@ -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: @@ -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: diff --git a/docs/de/reference/esphome-component.md b/docs/de/reference/esphome-component.md index a72e0bd..e0bf5bf 100644 --- a/docs/de/reference/esphome-component.md +++ b/docs/de/reference/esphome-component.md @@ -71,7 +71,7 @@ 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_...: @@ -79,7 +79,7 @@ on_...: command: 0x1A2B3C4D ``` -#### Example 2: Sending a Command with Type, Address, and Serial Number +#### Example 2: Sending a Command via Command Builder ```yaml on_...: diff --git a/docs/en/guide/firmware/additions.md b/docs/en/guide/firmware/additions.md index f4895c5..4e56d37 100644 --- a/docs/en/guide/firmware/additions.md +++ b/docs/en/guide/firmware/additions.md @@ -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 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 + + +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] ``` ::: @@ -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: @@ -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: diff --git a/docs/en/reference/esphome-component.md b/docs/en/reference/esphome-component.md index ccec8da..848fd2a 100644 --- a/docs/en/reference/esphome-component.md +++ b/docs/en/reference/esphome-component.md @@ -71,7 +71,7 @@ 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_...: @@ -79,7 +79,7 @@ on_...: command: 0x1A2B3C4D ``` -#### Example 2: Sending a Command with Type, Address, and Serial Number +#### Example 2: Sending a Command via Command Builder ```yaml on_...: