How to fetch Profile gid from hook_civicrm_post included in a Contribution Page?
You can use profiles directly to create an Household. When you add a field to a profile you have first select the entity, which could be contact, Individual, subtype of Individual, Household, Organization and others.

So there is no need to program this.