Simple Summary: In natural conditions, before the onset of farrowing, sows build a nest mainly to protect piglets from adverse weather conditions and predators. In modern commercial farms nest-building behaviour is limited, because, during the period of nest building, sows are confined in a farrowing crate. This has a negative effect on sow welfare. Recently, the concept of temporary crating has been introduced to achieve a compromise between the needs of the sow and her piglets. According to this concept, sows could be kept out of the crate at the time of prenatal nest-building behaviour and after the critical period of piglets' life. In this study, we developed a method to monitor sows' behaviour on the basis of accelerometer data. The developed monitoring method provides the following two types of alarms: A "first-stage" alarm that indicates the beginning of nest-building behaviour, with a median of 8 h 51 min before the onset of farrowing and a "second-stage" alarm that indicates the end of nest-building behaviour with a median of 2 h 3 min before the onset of farrowing. On the basis of these two types of alarms a farmer can make a decision when to provide adequate nest-building material and when to confine a sow in a crate for protection of the piglets' welfare. Abstract: One way to reduce the negative impact of farrowing crates on sow welfare is to limit confinement of sows from the onset of farrowing until the end of the critical period of piglets' life a few days after farrowing. In order to provide an indication of the time when sows should be confined in crates, ear tag-based acceleration data was modeled to provide the following two types of alarms: A "first-stage" alarm that indicates the beginning of nest-building behaviour, and a "second-stage" alarm that indicates the ending of the nest-building behaviour. In total, 53 sows were included in the experiment. Each sow had an ear tag with an accelerometer sensor mounted on the ear. Acceleration data were modeled with the Kalman filtering and fixed interval smoothing (KALMSMO) algorithm. It was possible to predict farrowing on the basis of increased activity in the validation dataset with a median of 8 h 51 min before the onset of farrowing. Alarms that indicated the need for confinement of the sow in a crate were generated with a median of 2 h 3 min before the onset of farrowing. These results suggest that the developed model should be sufficient to provide early warning of approaching farrowing and secondary alarm indicating the need to confine a sow in a crate.