Spook also provides helpers. The helpers allows you to perform calculations or modifications on existing entities and return the result of that as a new entity.
Calibration
A temperature sensor that reads a degree too high? Correct it with an offset, or a factor, and get a sensor that is right.
Inverse
Inverts the behavior of a switch or binary sensor entities. On becomes off, and off becomes on. The world is upside down!
Time in state
Since when has the door been closed? When did motion last go on? A moment that survives a restart, and a hiccup.