[dsmr] Add internal 'telegram' text_sensor to support bridging (#3890)

Co-authored-by: H. Árkosi Róbert <robreg@zsurob.hu>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
marcovaneck 2024-09-10 10:23:02 +02:00 committed by GitHub
parent bdd3e0cf59
commit 9800b81513
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -256,6 +256,11 @@ Configuration variables:
- All options from :ref:`Text Sensor <config-text_sensor>`.
- **telegram** (*Optional*): The (decrypted) unparsed telegram, marked as internal sensor.
Can also be used to trigger an action based on the last values.
- All other options from :ref:`Text Sensor <config-text_sensor>`.
Belgium
- **p1_version_be** (*Optional*): DSMR Version Belgium
@ -384,6 +389,42 @@ actually make it work, serial logging must be disabled to keep the hardware UART
pin: GPIO13
baud_rate: 115200
Bridging support / raw telegram logging
---------------------------------------
You can use another uart to supply another P1 receiver with the same telegram. See configuration sample as used for bridging.
.. code-block:: yaml
# define multiple uart's
uart:
- id: p1_uart
rx_pin:
number: 4
inverted: true
baud_rate: 115200
rx_buffer_size: 1700
- id: p1_bridge_uart
tx_pin:
number: 10
baud_rate: 115200
# link input uart to dsmr
dsmr:
uart_id: p1_uart
max_telegram_length: 1700
# log the telegram and pass telegram to p1_bridge_uart
text_sensor:
- platform: dsmr
telegram:
name: "telegram"
on_value:
then:
- lambda: |-
ESP_LOGV("dsrm", "telegram: %s", x.c_str());
p1_bridge_uart->write_str(x.c_str());
See Also
--------