@andreas. Thanks for your interest and support. I have previously checked out “Tools - Advanced” It shows the template that is used after I have nominated the Openhab MQTT protocol. In my case I get as attached.
So that suggests a topic looking like /DeviceESP12E/Room1/Temperature
just as suggested by @sihui earlier.
This is the correspoding code in ESPEasy.ino on the ESP:
strcpy_P(Settings.MQTTpublish, PSTR("/%sysname%/%tskname%/%valname%"));
I am going to check out other sections of this code to see if I can send the contents of this to the serial monitor:
String pubname = Settings.MQTTpublish;
pubname.replace("%sysname%", Settings.Name);
pubname.replace("%tskname%", ExtraTaskSettings.TaskDeviceName);
pubname.replace("%id%", String(event->idx));
I am hoping Serial.println(pubname) inserted in the right place will show me what the code is sending to the broker.
Other than that I might have to try some other code on the ESP. ESPEasy just seemed to be a very concise, well-structured code to use and build on with other devices as things developed on my system.
Perhaps I should head over to the ESPEasy forum with this problem.