Ocelot CMax Car Monitor Logic Help Needed

BraveSirRobbin

Moderator
I also posted this on ADI's forums.

I would like to incorporate an Ocelot “Home/Away†variable based on my car’s status as indicated by my X-10 Car Monitor .

The basic details on how this car monitor works is as follows:

When the car is running, an X-10 “I-15 ON†signal is broadcast every three seconds.

When the car turns off the “I-15 ON†broadcast is stopped and an “I-15 OFF†signal is broadcast continually for 10 seconds. After those ten seconds no other signal is sent from the car. As soon as the car is started the I-15 ON signal is broadcast as described (even if it is started before the ten second I-15 OFF signal is completed).

I was thinking about incorporating logic in the Ocelot to properly set a variable to HOME or AWAY. I sometimes warm the car up for a few minutes in the morning (time period varys). Also, I sometimes have to start the car for short periods to move it into the garage for the evening, or move it out of the garage so I can do some work inside the garage.

Here is the C-Max logic (I just show Variable1’s values as “HOME†or “AWAY†instead of zero or one for ease of reading):

Code:
If I-15 = ON  (This signal is broadcast every three seconds while car is running)
Then Timer = 1  (Start timer)
If I-15 = OFF
Then Timer1 = 0 (Stop timer when car turns off)
Then Variable1 = HOME  (Declare HOME mode)
If Timer1 = 60 and I-15 = ON
Then Variable1 = AWAY (After the last I-15 ON signal is received, wait 60 seconds and if no other signal is received declare AWAY mode)
Then Timer1 = 0 (Reset timer)

So basically when the car is running, Timer1 is always being “started†every three seconds (car monitor broadcasts I-15 ON every three seconds). The car then has to be out of range (can’t receive the X-10 signal) for 60 seconds before Variable1 = AWAY mode and Timer1 resets.

If at any time during Timer1’s 60 second countdown an I-15 OFF signal is received (car turned off), then the timer will reset and Variable1 is set to HOME.

I tried running through all scenarios to see if this could give a false indication of HOME or AWAY and couldn’t find any (which scared me into asking for help!).

I would truly appreciate and value opinions with this logic from this forum’s members.
 
I'm not sure how to fix it, but I think your your code is faulty . . .

if you test for I-15=ON, the timer is going to get reset regardless of any 'new' ON, so on every pass the ocelot will restart the timer, not just when a 'new' I-15 ON is rec'd

I'm not sure what happens if you test for I-15 becomes ON if it was previously ON . . .

Pete C
 
The posted routine looks like pseudo-code, but it should work fine as long as the first command is actually: "IF X10 I-15 ON Command Pair", so that it looks for the actual signal and not just the status.
 
Yes pseudo code as stated above. Here is the correct (and tested) Ocelot code below (note car is a "Ramcharger"). Again, thanks for your help. :p

Note that this is the power of the timers that is a big advantage with using an Ocelot? Just for grins I wonder what the equivalent Elk M1 Gold would be (hey, I will have to figure this out later on for my friend). :D
 

Attachments

  • rammon.jpg
    rammon.jpg
    35.6 KB · Views: 117
I dont know anything about the M1 handling of X10 messages. Actually, if you are using a W800 it will be more about string comparisons than real X10. But anyway,I believe that the form of the pseudo-code for the M1 will be very similar. Regarding timers, you need these two major changes:

Line 373: Then Turn RamCharger Output ON for 60 seconds

Line 375: Then Turn RamCharger Output OFF

Line 377: If RamCharger Output becomes OFF

Test it with your friend and let us know. :D
 
not sure what your going to use this to trigger . . . but it seems that upon pulling into the driveway (into RF range) you have to actually turn the ignition off to get 'HOME' status . . . so no poping the gargage door or turning on driveway lights as you approach . . . but you add some code to trip on the I15-ON
 
The way I do this is by monitoring how long ago the last ON signal has been received. The Elk version of that ruleset is very similar as mentioned before, and you don't have to do any string comparison if you use regular X10-RF, the W800RF32 is just another X10 interface. You only do string comparisons when you want to use DS10A's.
 
pete said:
not sure what your going to use this to trigger . . . but it seems that upon pulling into the driveway (into RF range) you have to actually turn the ignition off to get 'HOME' status . . . so no poping the gargage door or turning on driveway lights as you approach . . . but you add some code to trip on the I15-ON
pete;

Good point. I could always do If I-15 ON and "AWAY" mode then...

I really don't like to have that type of stuff automated, but again, you bring up an excellent point and great idea! ;)

One other thing to mention is that I wanted this done entirely with the Ocelot. I do like the way the timer works as an occupancy sensor and this code could be used for a lot of other applications (motion detectors, etc...).

What is nice is being able to start and stop the timer on conditions with the Ocelot.

On GIANT problem that came up is that I didn't "retransmit" the I-15 signal back to the power line since it triggers so often (flood powerline) as I have the W800 unit on my HomeSeer computer (yea, there goes the "entirely with the Ocelot theory). This was the only way I "thought" I could get the I-15 signal into the Ocelot.

Well, I was thinking that I could turn off this I-15 "W800 retransmit to the powerline" (like I had it before), then do logic in HomeSeer that sets another variable in the Ocelot based on I-15's status (i.e. set variable to off if I-15 is off or on is I-15 is on). Since the Ocelot is connected to the HomeSeer computer via a serial port, I can skip the transmit through the powerline.

I'm sort of wishing that the Ocelot plugin updated the Ocelot's X-10 devices set by HomeSeer, but I can't figure out how to do that.

I am pretty sure (haven't played around with this in a while) that you CAN set an Ocelot variable via HomeSeer though. So all I would have to do with the CMax code is look at this variable instead of the I-15 X-10 signal.

This sort of brings up another point in the fact that I do not like a reoccuring signal (motion detectors, this car monitor, etc...) flooding the powerline. I know this doesn't seem to be a big deal to other people, but it just delays events and possibly causes another events trigger to be missed! (I'm referring to the "Elk W800 always transmitting any signal back into the powerline post"). Again, this is just my opinion but try it out for yourself. Set HomeSeer (or other HA system) up to toggle an X-10 signal through your powerline every two or three seconds, then perform some regular HA tasks.

Thanks again for all the input and I'll try to test some of the changes above tonight!!
 
BraveSirRobbin said:
Well, I was thinking that I could turn off this I-15 "W800 retransmit to the powerline" (like I had it before), then do logic in HomeSeer that sets another variable in the Ocelot based on I-15's status (i.e. set variable to off if I-15 is off or on is I-15 is on). Since the Ocelot is connected to the HomeSeer computer via a serial port, I can skip the transmit through the powerline.

I'm sort of wishing that the Ocelot plugin updated the Ocelot's X-10 devices set by HomeSeer, but I can't figure out how to do that.

I am pretty sure (haven't played around with this in a while) that you CAN set an Ocelot variable via HomeSeer though. So all I would have to do with the CMax code is look at this variable instead of the I-15 X-10 signal.
That is surely the way I would do it.
 
Back
Top