See Durbin and Koopman (2001) for an exact initialization of the Kalman filter.
However........
a handy solution for the initialization:
(1): most of the problems occur on the initial value of state factors and theirs variances
(2): begin with zero initial values for the state factors and large variances to take the initial uncertainty into account
(3): try different initial values for the measurement equation parameters to see if likelihood value can be improved