Serial monitor command input with code

Hello guys, I found the solution. After @UKHeliBob mentioned I needed to send the command directly from the pi. I tried to just do that and send a string with the full command including \n at the end of it and it triggered calibration mode.

So basically I send this from my pi

sensors.write(b"enterph\n")

And then I read a string from my arduino like this,

r = Serial.readString();

That triggered calibration mode as if an user did the input in the serial monitor.

Thanks again for your help.

Francisco