Publishing char data to a function, normally you do this if it's a static definition:
"homeassistant/sensor/blah" is a char*
So, if I wanted to use dynamic values on this, if it were a string you'd do:
mqtt_client.publish("homeassistant/sensor/blah" + String(myval), "parameter_value");
As it's a char you'd ideally need to use strcpy to create the char array prior to using it, like this:
char* publish_start = "homeassistant/sensor/blah";
However this seems really excessive and wasteful as for example if I was to publish 10 then I'd need 20 char values defined, stcpy each one then publish them. Is that right or am I missing something here too?