I have tried both your suggestions Puck and I still have issues, and thanks by the way for leading me in the right direction as I didn't have any idea how to start
.
If nobody enters the area after the first initial motion detection, the macro runs great, but if someone sets the motion again once or several times the light will flick on and off. I have tried to revamped the design but now when motion is detected after the initial detection the light sometimes doesn't shut off, it doesn't flicker like it did, but now stays on SOMETIMES! Most times it works!
I also noticed in my log that the sensors are sending signals to the next unit (i.e. My motion sensor P5 sends P6 on/off) I know this is a feature of the sensor but is there a way to shut this off, I'm thinking there is too much happening at the one time as I have 3 of these macros operating 3 sensors and 3 lights. I noticed that even though we set flags the macros that are delayed still finish running. Is there a way to cancel or (break) the code if the flags are not set, thus eliminating the code from continuing?
Could it be possible that some steps are being ignored due to the amount of requests being sent?
OR Could it be possible that if motion is detected so many times and we are entering the subroutines so often and delaying them so often that the flags are getting cross switched. (Perhaps being set when they shouldn't)
Sorry for all the questions but I'm new to the macro scene and drawing straws here as this is really bugging me. I am a self taught programmer though and understand programming quite well. Would be so nice to be able to manually edit macros via C++ or something
Here is how I currently have revamped my macros.
(Module) | EE Motion Sensor | DUMMY APPLIANCE MODULE | WALL SWITCH (OLDER LAMP STYLE)
(Address) | P5 | D5 | A5
(Time Delay) | 4 Flashes / 8 Minutes | N/A | N/A
[MACRO #1]
(Name) Kitchen - Motion In Dark
(Trigger) P5(ON)
(Conditions) Flag Status Off (1) & It's Nighttime
(Action)
Set Selected Flags (1) // Let AH know we are running the macro, set (Flag1)
Set Module A5(ON) // Turn on the Kitchen light
Delay(00:00:30) // Wait 30 seconds
Module P5(OFF) // Send EE Motion Sensor Off command manually
[MACRO #2]
(Name) Kitchen - Motion In Light
(Trigger) P5(ON)
(Conditions) Flag Status On (1|2)
(Action)
Clear Selected Flags (2|3|4) // Clear sensor off Flag(2), dimmer Flag(3), & final shutdown Flag(4)
Set Module A5(Brighten 50%) // Brighten Kitchen light to full in case it was dimmed
Delay(00:00:30) // Wait 30 seconds
Module P5(OFF) // Send EE Motion Sensor Off command manually
[MACRO #3]
(Name) Kitchen - Sensor Off Cmd
(Trigger) P5(OFF)
(Conditions) Flag Status On (1) & Flag Status Off (2)
(Action)
Set Selected Flags (2|3) // Let program know we have received an off command Flag(2), and ready to dim lights Flag(3)
Delay(00:00:30) // Wait 30 seconds grace period in case motion detected
Module D5(ON) // Send Fake Module D5 On command to dim lights before final shutdown
[MACRO #4]
(Name) Kitchen - Dim Light
(Trigger) D5(ON)
(Conditions) Flag Status On (1|2|3)
(Action)
Clear Selected Flags (3) // Disable repeating the dimming process, clear dimmer Flag(3)
Set Selected Flags (4) // Prepare for final shutdown, set final shutdown Flag(4)
Set Module A5(Dim 50%) // Dim Kitchen light in preparation for shutdown
Delay(00:00:10) // Wait 10 seconds
Module D5(OFF) // Send Fake Module D5 Off to execute final shut down
[MACRO #5]
(Name) Kitchen - Final Off
(Trigger) D5(OFF)
(Conditions) Flag Status On (1|4)
(Action)
Set Module A5(OFF) // Turn off the Kitchen light
Clear Selected Flags (2|3|4) // Clear sensor off Flag(2), dimmer Flag(3), & final shutdown Flag(4)
Delay(00:00:05) // Wait 5 seconds to avoid sensor being triggered by off command
Clear Selected Flags (1) // Let AH know we are finish running the macro, clear (Flag1)
Any help on this topic about how to get this working or tips on things I'm doing wrong would be greatly appreciated for anyone!
P.S. I am using Active Home Pro, Smart Macros, and CM15A
Regards
Newfie