Read Z-Wave log in automation

Hi,

In my old HA system I used to read the Z-Wave log when my keypad was triggered. Open Z-Wave doesn’t allow for the user code to be exposed… but its in the log… so I used to read the tail and check what code was used. Any way to do this from Node Red (or failing that just anyway in HA full stop)?

Best,

Dan

Also interested in this

If node-red can access your log you could use the exec node and use tail command to read log and process the data.

I cracked it. I used an exec node with the command 'tail -n100 /config/OZW_Log.txt ’ . This returns the last 100 lines of the log in the msg.payload. I then have a function node that looks for the codes (you will need to look in the log and find your own.). I’m setting this to a flow variable to use elsewhere for now.

Drop me a message if you need any further help.

Function Node:

if(msg.payload.includes(“0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0”)){
flow.set(“Person”,“Person One Name”)
}
if(msg.payload.includes(“0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0”)){
flow.set(“Person”,“Person Two Name”)
}

return msg;