# Active and Cleared time alarm is the same

**URL:** <https://forum.inductiveautomation.com/t/active-and-cleared-time-alarm-is-the-same/86365>\
**Category:** Ignition\
**Created:** [February 26, 2024, 3:43pm UTC](https://forum.inductiveautomation.com/t/active-and-cleared-time-alarm-is-the-same/86365 "2024-02-26T15:43:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Lopez](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@David\_Lopez](https://forum.inductiveautomation.com/u/David_Lopez)\
**Post date:** [February 26, 2024, 3:43pm UTC](https://forum.inductiveautomation.com/t/active-and-cleared-time-alarm-is-the-same/86365/1 "2024-02-26T15:43:24Z")

</div>

Continuing the discussion from [Alarm Cleared at the same time it is set active](https://forum.inductiveautomation.com/t/alarm-cleared-at-the-same-time-it-is-set-active/42849):

Im working on Ignition 8.1.35. I have a tag configured on 'On Condition' Mode and I have the same problem, this is the configuration

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/f/1f9f01fd1c3562dfa16b10b93b4bc4aa05bc3193.png)

The script (just in case):

```auto
if({[.]maintenance}=false && {[.]manualOff} = false,
if({numPhases}=1,0,1)&&
if({numPhases}=2,(({[.]L1} < 80 && {[.]L2} >= 80) || 
                  ({[.]L2} < 80 && {[.]L1} >= 80)), 1)&& 
if({numPhases}=3,((({[.]L1} < 80) && ({[.]L2} >= 80 || {[.]L3} >= 80))||
                  (({[.]L2} < 80) && ({[.]L1} >= 80 || {[.]L3} >= 80))||
                  (({[.]L3} < 80) && ({[.]L1} >= 80 || {[.]L2} >= 80))), 1),false)

```

The DB:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/d/3dcbeb7a5a2eef525664c57eb1a5ee1ef590c696.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 26, 2024, 4:29pm UTC](https://forum.inductiveautomation.com/t/active-and-cleared-time-alarm-is-the-same/86365/2 "2024-02-26T16:29:59Z")

</div>

That's a rather complex expression. Are you sure it's actually evaluating the way you want, across all branches?

I'd strongly recommend refactoring some of the 'intermediate' checks out into dedicated expression tags, to simplify the logic inside the expression itself.
