For some reason I can not figure this one out...
I would like to have a Virtual Device that stores a DateTime value. Call it AutoOff.
I would then like to compare that Virtual Device with current time (now()).
If current time is larger than the stored DateTime value in the Virtual Device then I need to do some stuff...
Yes I could use a bunch of timers for this - however I am looking for a bit of a more elegant solution, with different timer auto off values (like 2 minutes in the night, 20 minutes in the morning and 5 in between - yes I have a VD which tracks Night/Morning and so on, and on top of this, if device is turned on manually (it is normally motion triggered) then it needs a full hour before doing some stuff...
However, when I stored now()+2 minutes into a Virtual Device I got a very large negative number (int32?), however that I can not seem to use to compare with a later now().
I am tiered, I admit that, however if someone can point me in a direction I would be happy :-)
I would like to have a Virtual Device that stores a DateTime value. Call it AutoOff.
I would then like to compare that Virtual Device with current time (now()).
If current time is larger than the stored DateTime value in the Virtual Device then I need to do some stuff...
Yes I could use a bunch of timers for this - however I am looking for a bit of a more elegant solution, with different timer auto off values (like 2 minutes in the night, 20 minutes in the morning and 5 in between - yes I have a VD which tracks Night/Morning and so on, and on top of this, if device is turned on manually (it is normally motion triggered) then it needs a full hour before doing some stuff...
However, when I stored now()+2 minutes into a Virtual Device I got a very large negative number (int32?), however that I can not seem to use to compare with a later now().
I am tiered, I admit that, however if someone can point me in a direction I would be happy :-)
Comment