String and char help needed

My first post here so right up front, I'll state that I have read the stickies. In fact, I read them a couple of weeks ago, followed a bunch of info in them which was awesome then came back today and read them again.

I'm not a dev but I get many of the concepts. I mostly do 'my thing' in YAML under ESPHome but lately I've got into using Arduino IDE and then VS Code with Platformio. Most of the time, I pull code from other public projects and then try and 'glue' it all together into something that works, researching why the code was written they way it was along the way so that I can learn. I'm a 'see one, do one, teach one' kind of guy.

Current project is an ESP8266 with a DS18B20 sensor which monitors freezer temp and sends a Pushover alert if it rises above -20*C. I have a couple of these in use but with hard-coded Pushbullet keys and Unit IDs. With this project, I wanted to push my boundaries a bit and use a self-generating AP on power-up with a captive portal for entry of SSID, password, Pushover user keys and Unit ID. That part works just fine.

The problem I'm struggling with is using those details in construction of the Pushover message. I did manage to get the code to compile in Arduino IDE but the pushParameters content was simply '1' rather than token, keys, message etc. VS Code has other ideas though.

  // Assign Dynamic Variables
  char pushoverApiKey[31];
  char pushoverUsrKey[31];
  char UnitID[31];

  // Add Dynamic Variables Activation
  ESPAsync_WMParameter custom_pushoverApiKey("api", "Pushover API Key", pushoverApiKey, 31);
  ESPAsync_WMParameter custom_pushoverUsrKey("usr", "Pushover User Key", pushoverUsrKey, 31);
  ESPAsync_WMParameter custom_UnitID("unitid", "Unit ID", UnitID, 31);

  // Code section for Push notifications to Pushover service
  int TempValue = sensors.getTempCByIndex(0);
  String msgcontent = UnitID && " temp is " && TempValue && "°C";
  String pushParameters = ("token=" && pushoverApiKey && "&user=" && pushoverUsrKey && "&message=" && msgcontent);

The errors that are coming from VS Code are:
no suitable constructor exists to convert from "bool" to "String"

on the last two lines. The 'squiggle' is at the first character after the the =.
Yes, I know that I have one line in () and the other without. I've tried parentheses, & instead of && and also + for connecting but I don't feel that is the cause here. This seems to be something related to using a char value (let's say UnitID is entered in the portal as "Walk-In Freezer") in the string. What I want to get to with the message content is "Walk-In Freezer temp is -18*C" for example.
Any and all help is appreciated. Please assume that I have zero knowledge. :wink: Full file is attached.
I've researched the error and while I can usually figure out what I need to do to adapt an answer to my needs, the stuff I'm reading I can't relate to in my situation because I don't already have the foundation knowledge to understand the answer in the first place.

esp8266_WiFi_Captive_Portal_FREEZERS_Working_Copy_vs.cpp (20.3 KB)

Please post your full sketch and the full error message

I tried. There is a 9000 character limit on the forum so I posted the snippet and attached the whole file. The code is 662 lines so way beyond that limit.

Is there a better way to approach the problem?

Sorry but I mistook the file for a library rather than a sketch due to its extension but I assume that it came from PlatformIO rather than the Arduino IDE

What is the full error message ?

TripitakaBC:
I tried. There is a 9000 character limit on the forum so I posted the snippet and attached the whole file. The code is 662 lines so way beyond that limit.

Is there a better way to approach the problem?

The standard way is to add a file as an attachment.

@op
The error is obvious:
You try to affect a Boolean type variable to a character type one and the compiler will refuse that.
You need to look at your whole sketch to determine why your logic is doing such thing.

abdelhmimas:
@op
The error is obvious:
You try to affect a Boolean type variable to a character type one and the compiler will refuse that.
You need to look at your whole sketch to determine why your logic is doing such thing.

I'm humbled that the error is obvious TO YOU.
For me, I can recognise that the compiler has an issue with UnitID being defined as a char but it isn't obvious to me why, when trying to build a string, I can't (or do not know how to) use the char 'UnitID' as a part of a string.
I've been over and over the code and, as I stated in the original post, even spent a couple of weeks reading the material in the links in the stickies. I've read about char and strings but nowhere has I read anything that states "You can't use a char or it's stored value in a string". Equally, I haven't read anything I understood that stated "Here is how you use a char or it's stored value in a string".
I came here as something of a last resort because I figured someone that was an experienced dev would see the post and respond along the lines of "Yeah, I see the issue. I see what you are trying to do. This is why it isn't working the way you think it should. Here are some articles that deal with this issue or this is how you fix it."
I'd rather learn why it isn't working but it needs to be explained in a way I can understand. I see you trying to help with your second line in the response but it doesn't make sense to me. If you were trying to achieve the same thing, what would you do?

On a quick look, you seem to be using the Boolean ‘and’ operator ‘&&’ where you actually want the String concatenation operator ‘+’.