Timer with motipnsensor


#1

1) Give a description of the problem
I want to create a piston that turn my lamp on when the motion sensor detect some movements. And after 10 minutes turn the lamp off. But only if the lamp was turned on by the motion sensor. If the lamp is turned on in any other way, for example Google mini, it should be on until i turn it off, even if the motion sensor see a motion.

**5) logg.
2019-12-21 08:12:09 +728ms
+0ms ╔Starting piston… (v0.3.110.20191009)
+221ms ║╔Subscribing to devices…
+253ms ║║Subscribing to IKEA TRÅDFRI Motion Sensor.motion…
+302ms ║║Subscribing to taklampan 2…
+303ms ║║Subscribing to taklampan 3…
+304ms ║║Subscribing to taklampan1…
+305ms ║╚Finished subscribing (92ms)
+399ms ║Comparison (enum) off is (string) off = true (2ms)
+402ms ║Comparison (enum) off is (string) off = true (1ms)
+414ms ║Comparison (time) 29530132 is_between (time) 25200000 … (time) 75600000 = true (8ms)
+416ms ║Time restriction check passed
+430ms ╚Piston successfully started (430ms)


#2

No need to recreate the wheel…

@bangali already has a great thread for this exact purpose.

  • The first piston there works with dumb switch & smart bulb combo…
  • The second piston there works with smart switch & dumb bulb combo…

#3

thanks, i´ve tried his piston now but its the same as mine, the lamp turnes on by the motionsensor but doesn´t turns off after 10 minutes


#4

now it works, thanx for the help