#Thread

1 messages · Page 1 of 1 (latest)

sand root
#

That doesn't seem to work

#

This is my flow:

#

This gives back these debug messages:

#

26/1/2023 20:59:36node: debug 2
msg.payload : string[170]
"SER=0009a7<br>↵TS=1674763149<br>↵TS_R=174168<br>↵PRES=0<br>↵HR=0<br>↵HR_DM=0<br>↵RR=0.0<br>↵RR_DM=0<br>↵ACT=0<br>↵ACT_DM=0<br>↵FW=t120 v2.2.1↵<br>↵END=1<br>↵"

somber hare
#

in the change node change the field type of Search for to regex

sand root
#

Then the Presence value seems to be gone

#

"SER=0009a7<br>↵TS=1674763612<br>↵TS_R=174631<br>↵0↵HR=0<br>↵HR_DM=0<br>↵RR=0.0<br>↵RR_DM=0<br>↵ACT=0<br>↵ACT_DM=0<br>↵FW=t120 v2.2.1↵<br>↵END=1<br>↵"

somber hare
sand root
#

I replaced it with your config but still full output

somber hare
#

try a fucntion node

#
const regex = /PRES=(\d+)<br>/;
const matches = msg.payload.match(regex);
msg.payload = Number(matches[1]);
return msg;
sand root
#

woootttt that works

#

26/1/2023 21:27:02node: debug 83
msg.payload : number
1

#

this is awesome ! Thank you !

sand root
#

works very nicely