Onsite earthquake early warning (EEW) systems exploit predictive models relating features extracted over the P‐wave window to S‐wave ground‐motion parameters. These models are usually calibrated considering recordings from multiple stations and combining datasets from different regions under the ergodic assumption. Here, we show that the local‐site conditions can play a significant role in determining the performance of onsite EEW predictive models in terms of rates of false or missed alerts. Interestingly, if partially nonergodic models are implemented, as done in probabilistic seismic hazard analysis, the negative impact of local‐site amplifications can be mitigated. We explore the influence of site effects for onsite EEW predictive models calibrated between the peak displacement () and integral squared velocity () measured over a 3 s P‐wave window, and the acceleration response spectra (RSA) at nine different periods (, 0.15, 0.2, 0.3, 0.5, 0.75, 1.0, 1.5, and 2.0 s). We consider 58 earthquakes with magnitudes between 3.7 and 6.5, belonging to the 2016–2017 central Italy seismic sequence that have been recorded by 100 accelerometer stations at hypocentral distances lesser than 150 km. We implement a mixed‐effects regression analysis to explore the variability of the ground motion in terms of RSA predicted at different sites by considering two different group levels: in the first, each station is considered separately; in the second, we consider the Eurocode 8 (EC8, 2004) soil classification. Considering a probabilistic alert decision module applied to data from two selected stations, we show that the predictive models including site effects provide more reliable alerts, reducing the false alarms from 2.6% to 0.53% and the missed alarms from 10.1% to 4.8%. The residuals analysis shows that including a site‐specific random effect in the predictive model contributes to reducing the apparent aleatory variability, whereas grouping data by EC8 classification does not provide significant benefit for EEW purposes.