Serial Device ASCII string

Hello,

I tried many things, researched the forum, but i just could not find the right configuration, but i feel like its right under my nose.

I have a serial LORA gateway that return ASCII strings.

Exampleo of strings coming into the serial port of HASSIO: (checked with putty on pc)

GW_ID:2818050,TYPE:CO2,ID:1200001041,STAT:00000011,CO2:888PPM,T:28.2▒▒,H:32.0%,ST:5M,V:3.38v,SN:6,RSSI:-40dBm,S:22.5769,E:113.9712,Time:2020-4-24 0:39:4,T_RSSI:-40dBm

How can i get the values: C02, Temp, Humidity out of this string?

Thank u!

Regards,

JJA Vogels

The example in the documentation is very close to what you need to do.

Devices returning multiple sensors as a text string

1 Like

You might also find the regex_findall_index() filter useful. E.g., depending on how consistent the output is, something like this can find the CO2 value:

|regex_findall_index('CO2:([^,]*)')

which results in all the characters following “CO2:” up to, but not including, the next comma.