Interested in counting number of threshold crossings
See if this meets your specs:

SELECT SUM(turned_on), SUM(turned_off)
    FROM (
        SELECT
                ( @prev &lt;=  5 AND EngineOil_P &gt;  5 ) turned_on,
                ( @prev &gt;= 15 AND EngineOil_P &lt; 15 ) turned_off,
                @prev := EngineOil_P
            FROM ( SELECT @prev := 0 ) init
            JOIN tbl
            ORDER BY timestamp
         ) x;


Note that boolean expressions evaluate to 0 (false) or 1 (true).  Hence the SUM() gets what you want.

There could be a problem with the initial state -- if the first row has > 15, it will be treated as a 'turn on'.