if statement with strcmp and param issues

The attached code is comprised of little bits I have gathered from the web and to be honest I don’t understand 100% of it. I am quite pleased that it works flawlessly for my home automation, however I would like to make the security of it more user friendly. currently once setup you can go to its web address followed by ?0,1 to turn on digital pin 0 or ?5,0 to turn off digital pin 5

The code that is activly running within my house is more complex due to the text string being matched ?123,mcu8266,d0,1 or ?123,mcu8266,d5,0 with the additional characters it can be open to the world and still remain secure.

What I need help with is getting a string or char to be part of the if statement so the more secure commands can be customized quickly .

String secret = “test”; or String secret = “123,mcu8266,”;
and have the if statement more like
if (strcmp (param, secret+“0,0”) == 0){digitalWrite(D0,0);}

I welcome any feed back on the rest of the code that might make it faster or take less memory, but the 2 MCU8266 boards I have this running on have been flawlessly commanded by ifttt and my google home device for over the last year.

HOME_AUTOMATION.ino (3.85 KB)

What I need help with is getting a string or char to be part of the if statement so the more secure commands can be customized quickly .

But, your code snippet uses Strings. They are NOT the same thing. The sooner you get over that, the sooner you'll be able to write a decent program description (or even write the code).

Since all of your param values appear to be exactly 3 characters long, and since the middle one appears to always be a comma, and never used, strcmp() is not the appropriate function to be using.

If the pin numbers were in an array, the code would be trivial.

byte pinIndex = param[0] - '0';
byte pinState = param[2] - '0';
digitalWrite(pinNumbers[pinIndex], pinState);

netmazter:
String secret = "test"; or String secret = "123,mcu8266,";
and have the if statement more like
if (strcmp (param, secret+"0,0") == 0){digitalWrite(D0,0);}

Here you're mixing up String and string, big time. Two totally different things.

strcmp() compares two char arrays (C strings).
You can add (concatenate) two char arrays using the strcat() function, not by a + operator as you can indeed do with Strings.

Indeed best go with C strings all around.