Converting fixed txt + integer value to char

Full code here: TasmotaClientBlinkSendCommand/TasmotaClientBlinkSendCommand.ino at master · fluppie/TasmotaClientBlinkSendCommand · GitHub
Original example/library: https://github.com/andrethomas/TasmotaSlave

The RPM counter (hall sensor) returns an integer with the current RPM

void user_FUNC_EVERY_SECOND(void)
{
  rpm = getRPM();
  if (ledstate) {
    ledstate = false;
    digitalWrite(LED_BUILTIN, LOW);
  } else {
    ledstate = true;
    digitalWrite(LED_BUILTIN, HIGH);
  }

//String rpmstr=String(rpm);
//String sendstr = "publish tele/ventilatie/rpm " + rpmstr;
//
//char* cstr = new char[sendstr.length() + 1];
//strcpy(cstr, sendstr.c_str());
//// do stuff
//delete [] cstr;
//slave.ExecuteCommand(cstr);

  slave.ExecuteCommand((char*)"publish tele/ventilatie/rpm 100");
}

The commented code doesn't work. Probably because I'm using the wrong operations/functions to get the char the ExecuteCommand function needs.
This code is working:

slave.ExecuteCommand((char*)"publish tele/ventilatie/rpm 100");

But ofcourse I don't want my Arduinoreporting 100 RPM :-). It should combine the text/string "publish tele/ventilatie/rpm " with the integer rpm. To get the final message.

Anyone who can help converting this text line and integer to a char?

You have an integer and a constant string (NOT a String) that you need to concatenate together. Stop monkeying around with Strings and just convert the int to a string and concatenate it with the constant string

void setup()
{
  Serial.begin(115200);
  while (!Serial);
  char buffer[40]; //allow space for the string, int and terminating '/0'p  int rpm = 123;
  int rpm = 123;
  char rpmChar[8];
  strcpy (buffer, "publish tele/ventilatie/rpm ");
  itoa(rpm, rpmChar, 10);
  strcat(buffer, rpmChar);
  Serial.println(buffer);
}

void loop()
{
}

Woo nice, it's working now :-). Thanks!
I've looked up those functions and it kind of makes sense now.
Only thing I don't get is this: and terminating '/0'p

In C, an array of characters that is to be treated as a string (note lowercase 's'), must be terminated with the null characters, (actually, '\0'). The null character serves as a sentinel to mark the end of the string. Code like this:

   char msg[] = "This is a test";
   int index;

   index = 0;
   while (msg[index]) {
      Serial.print(msg[index++]);
   }

can be used to spin through the array and pint the character as long as msg[index] doesn't equal null. When the null character is read, the while loop ends because the null equates to binary zero which changes the while expression to logic false. If you leave the null termination character off, the while loop will spin past the end of the msg[] array and try to print whatever it finds at the following memory location(s). The loop will continue to spin through the while loop until a binary zero is read somewhere in memory.

Or, if you’re not charging by the LOC

  char msg[] = "This is a test";
  
   for (int index = 0; msg[index]; index++) {
      Serial.print(msg[index]);
   }

fluppie:
Only thing I don't get is this: and terminating '/0'p

The p looks like a typo, as well as the duplicate of the subsequent line of code that follows it in the comment.
Shouldn't it be '\0' instead of '/0' ?

Well spotted

Sorry about the typos