diff --git a/src/content/docs/components/remote_receiver.mdx b/src/content/docs/components/remote_receiver.mdx index b20d859bb7..983acfd1c1 100644 --- a/src/content/docs/components/remote_receiver.mdx +++ b/src/content/docs/components/remote_receiver.mdx @@ -38,6 +38,7 @@ Multiple remote receivers can be configured as a list of dict definitions within - **aeha**: Decode and dump AEHA infrared codes. - **beo4**: Decode and dump B&O Beo4 infrared codes. + - **brennenstuhl**: Decode and dump brennenstuhl RF codes. - **byronsx**: Decode and dump Byron SX doorbell RF codes. - **canalsat**: Decode and dump CanalSat infrared codes. - **canalsatld**: Decode and dump CanalSatLD infrared codes. @@ -164,6 +165,10 @@ To enable signal demodulation, configure the signal carrier frequency and duty c B&O Beo4 infrared remote code has been decoded. A variable `x` of type is passed to the automation for use in lambdas. +- **on_brennenstuhl** (*Optional*, [Automation](/automations)): An automation to perform when a + brennenstuhl RF code has been decoded. A variable `x` of type + is passed to the automation for use in lambdas. + - **on_byronsx** (*Optional*, [Automation](/automations)): An automation to perform when a Byron SX doorbell RF code has been decoded. A variable `x` of type is passed to the automation for use in lambdas. @@ -390,6 +395,10 @@ Remote code selection (exactly one of these has to be included): - **source** (**Required**, int): The 8-bit source to trigger on, e.g. 0x00=video, 0x01=audio,..., see dumper output for more info. - **command** (**Required**, int): The 8-bit command to listen for, e.g. 0x00=number0, 0x0C=standby,..., see dumper output for more info. +- **brennenstuhl**: Trigger on a decoded brennenstuhl RF code with the given data. + + - **code** (**Required**, int): The 24-bit code to trigger on, see dumper output for more info. + - **byronsx**: Trigger on a decoded Byron SX Doorbell RF remote code with the given data. - **address** (**Required**, int): The 8-bit ID code to trigger on, see dumper output for more info. diff --git a/src/content/docs/components/remote_transmitter.mdx b/src/content/docs/components/remote_transmitter.mdx index 45e088d73b..8b074a7a5e 100644 --- a/src/content/docs/components/remote_transmitter.mdx +++ b/src/content/docs/components/remote_transmitter.mdx @@ -217,6 +217,34 @@ on_...: - **command** (**Required**, int, [templatable](/automations/templates)): The command to send, e.g. 0x01=num1, 0x0d=mute,..., see dumper output for more info. - All other options from [Remote Transmitter Actions](#remote_transmitter-transmit_action). + + +### `remote_transmitter.transmit_brennenstuhl` Action + +This [action](/automations/actions#all-actions) sends a brennenstuhl protocol code to a remote transmitter. + +```yaml +on_...: + - remote_transmitter.transmit_brennenstuhl: + code: !lambda |- + code=id(a_on)[id(idx)]; + id(idx) = (id(idx) + 1) & 3; + +``` + +#### Configuration variables + +- **code** (**Required**, int, [templatable](/automations/templates)): The 24-bit rolling code from a vector. +- All other options from [Remote Transmitter Actions](#remote_transmitter-transmit_action). + +> [!NOTE] +> The brennenstuhl devices use rolling codes, i.e. each button of the remote generates 4 different codes in +> a pseudo random manner. The yaml snippet from above handles the codes of the button **A-ON** that are stored +> in the vector `id(a_on)[]`. The vector is looped with `id(idx)` to provide the transmit function with codes +> that differ from the previous ones. See [Setting up RF Devices](/guides/setting_up_rmt_devices#remote-setting-up-rf) +> and [Setting up RF Devices](/guides/setting_up_rmt_devices#remote-setting-up-rf) for details and a complete +> YAML example + ### `remote_transmitter.transmit_byronsx` Action diff --git a/src/content/docs/guides/setting_up_rmt_devices.mdx b/src/content/docs/guides/setting_up_rmt_devices.mdx index 5b6b9262e2..b0be616623 100644 --- a/src/content/docs/guides/setting_up_rmt_devices.mdx +++ b/src/content/docs/guides/setting_up_rmt_devices.mdx @@ -181,6 +181,81 @@ in the frontend. Click on it and you should see the remote signal being transmit > repetition logs are consistent between the remote controller and the transmitter node. > You can adjust the `repeat:` settings accordingly. +## Rolling Codes + + + +Some devices are using rolling codes, i.e. instead of **one unique** code, the buttons +generate **n different** codes in a random manner. Good-natured receivers have a simple +logic: the current code must differ from the previous one. In such a case, the n codes +can be recorded by pressing each button several times and stored in a vector. The +brennenstuhl remote for example uses four rolling codes for each button.The YAML below +shows the transmitter for the three buttons **A_ON**, **A_OFF** and **B_ON**. Additional +buttons are simply added in the same way : + +```yaml + +globals: + # the code vectors of three buttons A_ON, A_OFF and B_ON +- id: a_on + type: std::vector + initial_value: '{ 0xbfcf6c, 0xbe821c, 0xb1d75c, 0xb593ac }' +- id: a_off + type: std::vector + initial_value: '{ 0xbd2e2c, 0xb4ed8c, 0xb2b6bc, 0xb3017c }' +- id: b_on + type: std::vector + initial_value: '{ 0xbb3535, 0xb87af5, 0xbca0e5, 0xba5c05 }' + +script: + # - select vector with bs_button + # - lookup code from vector with idx + # - call remote_transmitter + # - update idx + - id: bs_transmitter + mode: single + parameters: + bs_button: int + then: + - remote_transmitter.transmit_brennenstuhl: + code: !lambda |- + uint32_t code = 0; + static int32_t idx = 0; // rolling index + switch(bs_button) { + case 10: { // A_ON + code=id(a_on)[idx]; + break; + } + case 11: { // A_OFF + code=id(a_off)[idx]; + break; + } + case 20: { // B_ON + code=id(b_on)[idx]; + break; + } + } + idx = (idx + 1) & 3; + return code; + +# buttons for the GUI +button: +- platform: template + name: "A ON" + on_press: + - lambda: id(bs_transmitter)->execute(10); +- platform: template + name: "A OFF" + on_press: + - lambda: id(bs_transmitter)->execute(11); +- platform: template + name: "B ON" + on_press: + - lambda: id(bs_transmitter)->execute(20); + +``` + + ## See Also - [Remote Receiver](/components/remote_receiver/)