on System#Boot do taskvalueset,6,1,0 taskvalueset,6,2,0 NeoPixel,1,0,0,0 event,checkmotion endon on MQTT#Connected do event,checkmotion endon on pir#Switch do event,checkmotion endon on radar#Switch do event,checkmotion endon on checkmotion do if [pir#Switch]>0 and [radar#Switch]>0 and [motion#State]<1 taskvalueset,6,1,1 Publish domoticz/in,{"idx":55,"nvalue":1.00,"svalue":"On", "RSSI": [RSSI#RSSI]} endif if [pir#Switch]<1 and [radar#Switch]<1 and [motion#State]>0 taskvalueset,6,1,0 Publish domoticz/in,{"idx":55,"nvalue":0.00,"svalue":"Off", "RSSI": [RSSI#RSSI]} endif endon on playalert do TaskValueSet,6,3,%eventvalue% TaskValueSet,6,4,1 timerSet 2,1 endon on playsound do TaskValueSet,6,3,0 TaskValueSet,6,4,%eventvalue% timerSet 2,1 endon On Rules#Timer=2 do if [motion#BSND]=1.00 rtttl,15:d=4,o=6,b=140,8e,8c,8e,8c,8e,8c endif if [motion#BSND]=2.00 rtttl,15:d=4,o=5,b=100,32p,d,8c,32p,c endif if [motion#BSND]=3.00 rtttl,15:d=8,o=5,b=160,f#,f#,f#,d endif if [motion#BREP]>0 TaskValueSet,6,3,( [motion#BREP]-1) timerSet 2,15 else TaskValueSet,6,4,0 endif EndOn