I am approaching 1380 near the 1500 line maximum for Dlr PC Access programing.
Anyone got ideas on what you would do when you want more space?
I am about to add 8 cameras the last of my automation dreams.
Do have sections that use the same triggers to perform multiple actions separately?
Do you have the same actions performed by multiple triggers that you can consolidate?
Even partial nesting helps
If you have many of the same actions performed by multiple triggers you can sometimes nest the like actions with the corresponding triggers and break out the individual actions with their own triggers.
If you have time based parameters use the timeclocks.
If you have multiple actions as conditionals, have those actions set a flag and then just use a single line to check the status of the flag.
Do you have a lot of OR blocks with only a single conditional different in each section?
What automation lines are you using with cameras?
What other functions are you performing?
Here is a quickie OR block which I just threw in the middle of a couple of lines. (nonsensical). Looked over my stuff and I do not have a lot of OR statements.
Code:
1. // ========================
// DOORBELL
// ========================
2. WHEN Doorbell NOT READY
AND IF Chime Flag OFF
OR
AND IF DARK
THEN Chime Flag ON FOR 1 MINUTE
THEN Door Chime TOGGLE
The worst OR blocks have multiple conditionals with just a single conditional that is different between the blocks.
A flag usually works better in that case.
Use the conditionals to change the status of the flag in a separate block and check the condition of the flag in the trigger block.
You can also cascade actions if the blocks are placed in the correct order since the code executes in a ladder fashion.
For instance my porch lights come on at dusk at 70% and shut off at midnight, but if there is motion they come on 100% at any time when it's dark.
After the motion ceases I want them to return to the correct state.
So I have the blocks execute in a ladders fashion
WHEN Motion Ceases
AND IF Dark
THEN Porch Lights on 70%
WHEN Motion Ceases
AND IF Dark
AND IF Time Clock 1 is On (midnight to Dawn)
THEN Porch Lights Off
So the first block always executes, but if it's after midnight the second block executes right on its heels and puts the lights in the proper state.
So there's no need to check if the time is before midnight in the first block.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.