Hi @danempiric I highly recommend reviewing this article to learn about the different types of NCD sensor messages in Node-RED and become familiar with them.
In the switch node, you will need to filter only ‘sensor_data’ messages, as shown in the following image:
To do this, you can delete the ‘
addr’ and ‘
battery_percent’ rules by clicking the delete button (x) located on the right side.
Afterward, you will need to import the following flow into your workspace:
[{"id":"1c66d34f4837ccb0","type":"exec","z":"adcae456bdd7867d","command":" ","addpay":"payload","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"exec","x":630,"y":800,"wires":[["dbe362702c2b7126"],["dbe362702c2b7126"],["dbe362702c2b7126"]]},{"id":"65d4cd7400b6789b","type":"inject","z":"adcae456bdd7867d","name":"delete backlog file","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":290,"y":800,"wires":[["fb05069e5ec17bde"]]},{"id":"dbe362702c2b7126","type":"debug","z":"adcae456bdd7867d","name":"debug 146","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":800,"wires":[]},{"id":"fb05069e5ec17bde","type":"function","z":"adcae456bdd7867d","name":"build command","func":"let filename = flow.get(\"log\");\nmsg.payload = \"rm \" + filename;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":480,"y":800,"wires":[["1c66d34f4837ccb0"]]}]
Then, click ‘Deploy,’ enable the ‘Delete Backlog File’ node, and proceed to delete the backlog file. Finally, you can run the test again.
Please give this a try and let us know the outcome.
Thank you,
Eduardo M.