State estimation in power systems is classically based on the weighted least squares method. Recently, different extensions of Kalman filters have been proposed. Among them, the 'unscented' Kalman filter (UKF) improves the results of weighted least squares methods, when there are small changes in the system, as it considers the history of the state. The novel algorithm presented in this work combines the best of both approaches. To perform this task a new index is defined to allow the algorithm to choose in real time, and for each iteration, between a static or a dynamic estimator. This combination allows overcoming the anomalies observed when the UKF faces abrupt variations of the system state and also the lack of observability that weighted least squares could present. The proposed methodology was tested with three test cases outperforming the previously mentioned algorithms.