Probability that a device turns off in n seconds At zero time a device is on, and can be turned on or off at any time.  Let $p_1, p_2, \dots$ the probabilities that the device is off at times $1, 2, \dots$.
What is the probability that the device will be turned off for the first time at time $n$?
EDIT:
I think that it can be solved just by:
$$(1-p_1)\times(1-p_2)\times \dots \times p_n$$
But I am not sure how to arrive this conclusion, as it seems to be backed on independent events, but I cannot be sure about the independence here.

To answer this question and confirm the answer that is proposed in the OP, I would first propose to slightly rephrase it as :

"A device is initially on and experiences a sequence of events $1, 2, \ldots$ which can turn it off. Each binary trigger event occurs with an independent probability given by a Bernouilli trial parameterized by respectively $p_1, p_2, \ldots$. What is the probability that the device is turned off for the first time at the $n^\text{th}$ event?"

First, if $n=1$, the answer is simply $p_1$, that's easy and that special case can be put to side.
For $n>1$, the final answer follows by stating that this happens at event $n$ if and only if (1) the switch was not triggered off at events $1, 2, \ldots, n-1$ and (2) that the switch is triggered off at event $n$.
For the first part, note that in general at a given event $k<n$, given that the switch is still on, the probability that the switch is not triggered off at this event $k$ is equal to $1-p_k$. In particular, the probability that the switch was not triggered off at event $1$ is $1-p_1$. Given that the switch was not triggered off at event $1$, the probability that it is not triggered at event $2$ is $1-p_2$, and so on.
For the second part, the probability that the switch is triggered off at event $n$ is simply $p_n$.
Since all draws are independent, probabilities are multiplied and the probability that the switch is triggered off for the first time at event $n$ is equal to:
$$
(1 - p_1) \times (1 - p_2) \times \ldots \times (1 - p_{n-1}) \times p_n 
$$
which confirms the intuition in the OP.
What may be confusing at first in the OP is the fact that the problem is set up as a temporal sequence and that we may need to consider the probability space of all "trajectories" of trigger events. Yet the problem is simpler as one asks in the OP the probability that event $n$ is triggered for the first time, and thus that all previous events are not triggered, and thus irrespective of a sequence (as would be explored in other answers).
