Please login or register.

Login with username, password and session length

Author Topic: Flags not setting - Solved  (Read 4091 times)

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Flags not setting - Solved
« on: February 16, 2011, 09:32:45 AM »

This is a weird one. I have these macros for my remote chime that (1) will only let the chime sound once a minute or (2) keep the chime off while the front door is open. It all worked just fine until a few days ago. I know the usually thing to check first is what changed? Well, nothing changed, really, nothing. I didn't make any new macros or change any settings in AHP since it was working. No updates to AHP or windows for that matter. No new modules or anything. It's as simple as it worked, so I stopped, didn't touch anything and a few days later it stopped working.

The chime macro looks to see if flag 2 is clear, if it is then the macro sets flag 2, sounds the chime, waits one minute and clears flag 2. This keeps the chime from sounding with every move of the person on the porch. Works fine and still does. The problem was the flag for when the front door was opened was not being set. I have another macro for the front door to turn a phantom module on when the door is opened and off when closed. I use that to trigger a macro that simply sets flag 2 when on and wait a minute and clear flag 2 when closed. So when the door is opened, flag 2 is set and the chime macro will not run.

So here is the funny part. If I run the "Door Open No Chime" macro manually from AHP, the flag gets set. But if I open the door, the macro runs but the flag does not get set. I know AHP/CM15a is seeing the door open. I see it in the log and my living room light turns on. I have another chained macro that turns the light on if it's nighttime when the front door is opened. I can also see the macro run by watching it in AHP when I open the door.

I was at a total loss and ready to post here asking what on earth did I miss. So here is the kicker of the solution I found, but still don't believe. I moved AHP and the CM15a to another computer and now it works again. I knew the computer I was using is old and not very reliable, but really. Could the computer really have been my problem? The IT part of me says no. I defragged the hard drive. Cleared all temp files. Ran all updates. I even created a new ahx file and recreated the macros. Still no flag being set.

Only thing I can figure is a bad spot on the hard drive. Maybe this weekend I will run some diagnostics on the drive and ram. Something was wrong if a new computer with the same versions of OS and AHP works.

Just thought I would throw this experience out there.
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Flags not setting - Solved
« Reply #1 on: February 16, 2011, 09:50:12 AM »

Out of curiosity, did you try changing which flag you were using?
Was the CM15A connected to the PC the whole time?
Logged

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: Flags not setting - Solved
« Reply #2 on: February 16, 2011, 11:41:35 AM »

Out of curiosity, did you try changing which flag you were using?
Was the CM15A connected to the PC the whole time?

Yes and yes. I tried all the flags and the cm15a was always connected since it needs to be for the ds10a on the front door. I even tried a different usb port on the pc. It's just really absurd.

I don't mind the new computer. I was going to switch to it later anyway. The one I was using was really just a quick setup to move the cm15a to a central location in the house. It was an all-in-one that is like 10 years old. It has really seen better days. But it was great for testing since it had a monitor builtin. All I needed was a keyboard and mouse.

The new computer is a bit faster with lots more ram. I plan on using pc companion one day so the more horse power will be better. Plus I can just hide the tower behind some furniture and use vnc to connect.
Logged

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: Flags not setting - Solved
« Reply #3 on: February 18, 2011, 03:57:14 PM »

Well, I thought this was solved with a new PC. I was wrong. Last night my daughter left and when the front door was opened I heard the ds7000 ding-dong and the living room light turned on as it should. Then she stepped on the porch and there go the stupid chimes. Really pissed me off. Just that morning when I left for work, opened the front door, stepped on the porch, no chime. Thought it was working.

So I did a little test. I changed the clock to AM instead of PM. Tested and the flag was set and no chime. HUH? Changed the time back and tested again. The chime sounds and no flag set. DOUBLE HUH?

So, here is the setup.
DS10A Open trigger turns P1 On
P1 On triggers living room light on if it's nighttime
Chained P1 macro sets flag 2 (no conditions)
DS10A Closed turns off P1 which turns off the light and clears flag 2

Eagle Eye set to A1
A1 triggers remote chime if flag 2 is clear
then waits 1 minute and clears flag 2

So I got to thinking. Even though the chained P1 On macro is not using any conditions, I wondered if the nighttime condition was messing with it. BTW, I don't use any other flags in any other macros. So I made another macro for the DS10A Open to trigger P2. Then changed the chained P1 to be triggered by P2 instead.

Worked last night. Will see if it works tonight without changing the computer time. This morning when I left I didn't have any chime. So I'm hopeful.
Logged

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: Flags not setting - Solved
« Reply #4 on: February 18, 2011, 11:56:42 PM »

Well, still no luck using a second phantom module. This time my light failed to come on also.

So new macros
Still triggering P1 with the ds10a - Open turn P1 on, Closed off

P1 On and it's Nighttime
Set flag 3 and
Turn light on
else
P1 On and it's Daytime
Set flag 3

P1 Off and it's Nighttime
turn light off and
clear flag 3
else
P1 Off and it's Daytime
Clear flag 3

Front Porch Chime Macro
If flags 2,3 are clear
Set flag 2
Sound Chime
wait 1 min
Clear flag 2

Hope this one works. After writing it, it now sounds more logical. Fingers crossed.
Logged

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: Flags not setting - Solved
« Reply #5 on: February 20, 2011, 11:29:42 AM »

All is finally working. Actually working correctly since I now understand that a chained macro is the same as using ELSE in a macro. I learned something.

Using my example above I'm saying:
If it's nighttime and the front door is opened, turn on the light and set flag 3
ELSE
Set flag 3

In my original macros I was saying:
If it's nighttime and the front door is opened, turn on the light
ELSE
Set flag 3

That is why my flag was not setting at night.

So now that I understand that a chained macro is actually using ELSE, I removed the daytime condition as it wasn't needed and changed the P1 off to simply turn off the light and clear flag 3 reguardless of conditions. However, while typing this I realized this would send the commands to turn off the light even if the light is off and every hour when the ds10a checks in. Probably not a big deal but why clutter the power lines with unnecessary PLC codes. So I might add a condition to check for the light being on else it can just clear flag 3.

Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Flags not setting - Solved
« Reply #6 on: February 20, 2011, 11:47:23 AM »

You got it!
I am using a series of 6 or so chained macros (in an If-Then-Else-Else-Else... configuration), to restore the right lights in the event of a power outage, based on time of day and day of the week.
It isn't perfect, but it is much closer than not having it at all.
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.