Invalid conversion when making a function that passes parameters to digitalWrite

I have the MQTT server send a message of "relay1:HIGH" or whatever to the Arduino. My relay pins are called "relay1" and "HIGH" is the exact command.

But since they're still different types, my code is required to look like this?

void controlRelay(const char* relay, const char* state) {

  if(strcmp(relay, "relay1") == 0){
    if(strcmp(state, "LOW") == 0){
        digitalWrite(relay1, LOW);
    } else if (strcmp(state, "HIGH") == 0){
        digitalWrite(relay1, HIGH);
    }
  } else if(strcmp(relay, "relay2") == 0){
    if(strcmp(state, "LOW") == 0){
        digitalWrite(relay2, LOW);
    } else if (strcmp(state, "HIGH") == 0){
        digitalWrite(relay2, HIGH);
    }
  } else if(strcmp(relay, "relay3") == 0){
    if(strcmp(state, "LOW") == 0){
        digitalWrite(relay3, LOW);
    } else if (strcmp(state, "HIGH") == 0){
        digitalWrite(relay3, HIGH);
    }
  } else if(strcmp(relay, "relay4") == 0){
    if(strcmp(state, "LOW") == 0){
        digitalWrite(relay4, LOW);
    } else if (strcmp(state, "HIGH") == 0){
        digitalWrite(relay4, HIGH);
    }
  } else if(strcmp(relay, "relay5") == 0){
    if(strcmp(state, "LOW") == 0){
        digitalWrite(relay5, LOW);
    } else if (strcmp(state, "HIGH") == 0){
        digitalWrite(relay5, HIGH);
    }
  } else if(strcmp(relay, "relay6") == 0){
    if(strcmp(state, "LOW") == 0){
        digitalWrite(relay6, LOW);
    } else if (strcmp(state, "HIGH") == 0){
        digitalWrite(relay6, HIGH);
    }
  } else if(strcmp(relay, "relay7") == 0){
    if(strcmp(state, "LOW") == 0){
        digitalWrite(relay7, LOW);
    } else if (strcmp(state, "HIGH") == 0){
        digitalWrite(relay7, HIGH);
    }
  } else if(strcmp(relay, "relay8") == 0){
    if(strcmp(state, "LOW") == 0){
        digitalWrite(relay8, LOW);
    } else if (strcmp(state, "HIGH") == 0){
        digitalWrite(relay8, HIGH);
    }
  }
}

PS: HIGH and LOW being symbolic of the integers 1 and 0 are not stated in the docs: