Recently, ScAlN alloys attracted attention for their giant piezoelectric moduli. In this study the piezoelectric response of the wurtzite group-III nitrides AlN, GaN, and InN mixed with 50 mol% of ScN or YN is investigated using ab initio calculations. We confirm that the energy flattening phenomenon gives rise to the simultaneous appearance of elastic softening and local structural instability, and explains the enhanced piezoelectricity of the alloys. Furthermore, we present a volume matching condition for an efficient search of new piezoelectric materials. It states that alloys in which the parent components show close volume matching exhibit a flatter potential-energy landscape and higher increase of piezoelectric moduli. We suggest YInN, beyond ScAlN, as a promising material for piezoelectric energy harvesting with its enhanced ≈400% piezoelectric moduli.