Communication - SerialProxy¶
.
Plugin details¶
Type: Communication
Port Type: Serial
Name: SerialProxy
Status: COLLECTION C
GitHub: P087_SerialProxy.ino
Maintainer: TD-er
Used libraries: ESPEasySerial
Configuration¶
Name A unique name should be entered here.
Enabled The device can be disabled or enabled. When not enabled the device should not use any resources.
Sensor¶
Filtering¶
This section only shows settings when the plugin is configured and enabled.
RegEx: Specify a regular expression to apply to the received data before it is accepted as acceptable data. This regular expression is based on the Lua script language, and is documented here: http://www.lua.org/manual/5.2/manual.html#6.4.1
Nr Chars use in RegEx: Limit the length of the data to be checked using the RegEx regular expression filter. When set to 0 all data is checked.
Filter Off Window after send: The time in milliseconds to turn off filtering after receiving data that is accepted by the filter. Setting this to 0 will not turn off the filter after sending to the connected device.
Match Type: Select the type of matching that is to be applied:
Regular Match: Use the Regular Expression matching, configured above.
Regular Match inverted: Use the Regular Expression matching but with inverting the result, as configured above.
Global Match: Use the group values defined the Regular Expression above, to compare to the Capture Filter 1..10 definitions explained below.
Global Match inverted: Like Global Match, inverting the outcome.
Filter Disabled: No filtering is applied.
Capture Filter 1..10¶
Each Capture Filter has 3 fields:
Group: Refer to the group index as returned from the Regular Expression, range 1..32.
Comparison: The comparison can be Equals or Not Equals:
Compared value: The literal value that should match the value from the RegEx Group chosen, and compared using the Comparison.
Statistics¶
Statistic data is only visible if the plugin is configured and enabled.
This shows the latest data received and some statistics.
Data Acquisition¶
This group of settings, Single event with all values and Send to Controller settings are standard available configuration items. Send to Controller is only visible when one or more Controllers are configured.
Interval By default, Interval will be set to 60 sec.
Values¶
The Values are not changed during processing, and can be ignored.
Commands available¶
Command |
Extra information |
---|---|
|
Send out data via the configured serial port. |
|
This command requires quotes to be used if spaces or commas are part of the content. Any data can be sent, even if it can not be typed in a text content, by specifying that as a separate argument:
|
|
This command is intended for testing the regular expression and filtering. The sentence provided with this command is handed over for processing as if it was received via the serial port, so it will be processed and filtered, and an event will be generated if it’s matched. |
Get Config Values¶
Get Config Values retrieves values or settings from the sensor or plugin, and can be used in Rules, Display plugins, Formula’s etc. The square brackets are part of the variable. Replace <taskname>
by the Name of the task.
Config value |
Information |
|||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Get the contents from groupnr after processing received data. NB: The regular expression parsen uses 0-based group numbers (where most other regex parsers use 1-based group numbers!) |
|||||||||||||||||||||||||||||||||||||||
|
Get the value of the next group that holds Example: Regular expression: Received data: This will result in these groups:
Requesting |
Change log¶
Changed in version 2.0: …
added 2024-02-25 Add support for serialproxy_test
command and retrieving the separate groups from parsed regex.
added 2023-03-22 Add support for writing any binary data out via the serial port.
added 2020-02-22