Hello,
I have a question related to REGEX usage for serial binding.
I receive on same serial port different packets containing different values from different sensors.
Packet type can be identified by the second and third char from the beginning of the packet:
temperature: <28Sensor_id,data etc…>
pressure: <11Sensor_id,data etc…>
humidity: <12*Sensor_id,data etc…>
I created three items as follows:
String tempExt "Temperatura exterioara" (Senzori) { serial="/dev/ttyUSB0@9600,REGEX(<28\\*\\d{1}\\*\\d{3}\\*\\w{16}\\*(.{6}).*)" }
String presExt "Presiune exterioara" (Senzori) { serial="/dev/ttyUSB0@9600,REGEX(<11\\*\\d{1}\\*\\d{3}\\*\\w{16}\\*(.{5}).*)" }
String umid "Umiditate" (Senzori) { serial="/dev/ttyUSB0@9600,REGEX(<12\\*\\d{1}\\*\\d{3}\\*\\w{16}\\*(.{4}).*)" }
The MATCHING works for one sensor but all the other are updated with the whole string!!!
presExt state updated to 753.8
tempExt state updated to <11003230000003EBD18228753.8 **************>
umid state updated to <11003230000003EBD18228753.8 **************>
Is it not possible to update a string item ONLY if the REGEX matches?