www.homeseer.com    
 

Go Back   HomeSeer Message Board > 3rd Party Plug-Ins/Scripts > Plug-ins by Author > Click Here for List of Author Forums > MCS Plug-Ins and Scripts > xAP > xAP Library

xAP Library Library area for plug-in nodes. Use the discussion area to discuss these - posting here is only allowed by the moderator.

Closed Thread
 
Thread Tools Display Modes
  #1  
Old March 23rd, 2006, 12:56 AM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,773
xapmcsRF - W800 / RFXCOM xAP Node

xapmcsW800 is a connector that bridges the W800 serial protocol or RFXCOM USB to xAP on an IP interface. The xAP schemas utilized are xap-x10 and Basic Status and Control 1.3. It is installed at any location on a PC and will use subfolders to retain configuration information, this document, and HTML formatting information. The W800 has been tested and the RFXCOM receiver supports the same protocol as the W800.

This xAP node allows xAP message reporting of RF X10 and Security received by the W800 or RFXCOM receiver. It also allows for scripting based upon content of received messages or received RF.

The node is modeled as a device for each X10 or Security RF received. It maintains the last X10 received state for local scriping and echos each received X10 as a xAP xap-x10 message or as a xapbsc message depending upon user configuration. It maintains the last received state of security devices and echos the reception as a xapbsc.event message. In cases where the external device reports the same status as a previous transmission then xapmcsW800 will use an xapbsc.info message to reflect the transmission of the same status. It also responds to xapbsc.query by providing the current status. BSC messages also contain the DisplayText as formatted HTML.

PR 1 1.1.0 Add RFXCom Temp/Humidity sensors
PR 2 1.1.0 Add Invert ON/OFF
PR 3 1.1.0 Add Retransmit
PR 4 1.1.0 Add OFF Timeout and related filtering
PR 5 1.2.0 Add X10 RF PC Remote
PR 6 1.3.0 Add Init string for 32 vs 48 bit mode
PR 7 1.3.0 Add logic for 44 bit Digimax
PR 8 1.3.0 Change name from xapmcsW800 to xapmcsRF
PR 9 1.3.3 Add Visonic X10 mode
PR10 1.3.4 Object variable not present errors
PR11 1.3.5 No Keyfob messages
PR12 1.3.14 Clear out receive buffer after 2 seconds without RF
PR13 1.3.14 Add "R" (Reject) checkbox to not show selected RF devices
PR14 1.3.14 Add checkbox to include/exclude Visonic sensors
PR15 1.3.15 Setup on 48 bit mode does not stick
PR16 1.4.0 Add Oregon Scientific 80 bit Temperature
PR17 1.4.1 Accept 80 bit sensor packets
PR18 1.4.2 Remove slave receiver bit from bit count in first received byte
PR19 1.4.3 Complete Oregon Scientific Sensor set decoding
PR20 1.4.3 Send debug output to text file in \Data folder
PR21 1.4.3 Include input data on decode procedure's error handler
PR22 1.4.4 Add Metric/Imperial conversion option
PR23 1.4.4 Exclude first byte in count for 48 bit mode
PR24 1.4.5 Additional debug info added
PR25 1.4.6 Decode of RFXCOM DS2438 multiplex
PR26 1.5.0 Add RFXCOM Power Meter
PR27 1.5.0 RFXCOM sensors fail parity test
PR28 1.5.1 Overflow error in ProcessCommData
PR29 1.5.2 Add checksum test to Oregon Scientific sensors
PR30 1.5.3 DisplayText key in xAP sensor messages
PR31 1.5.3 Debug enhanced to show outputs
PR32 1.5.3 Script Tag ignored for OS/RFX sensors
PR33 1.5.4 Intermittent Temperature readings
PR34 1.5.4 Add suffix label to DisplayText
PR35 1.5.4 Allow all devices to have unique icons in Display Text
PR36 1.5.4 Rounding of Barometer
PR37 1.5.5 Add checksum validation for OS Rain counter
PR38 1.5.7 Add DS10A as a 48 bit mode reception
PR39 1.5.8 Humidity shows 48 rather than 44
PR40 1.5.9 Reverse bit order for special X10 commands (Dim, Bright, All)
PR41 1.5.12 Add OS Sensor FA28 for channels 0..7
PR42 1.5.14 Incorrect scaling for RFXCOM Temp Sensor
PR43 1.5.13 Use full 16 bits for RFXCOM sensor addresses
PR44 1.5.15 Decode RFXCOM temp sensors using 2's complement
PR45 1.5.16 Oregon Scientific Rain Sensor update
PR46 1.5.17 Fix parity check for RFXCOM Power meter
PR47 1.5.17 Add scaling option for Sensor input
PR48 1.5.18 Reverse nibble order on Oregon Scientific Rain count
PR49 1.6.0 Add mode to disable new device discovery
PR50 1.6.1 Correct checksum in OS Rain Counter
PR51 1.6.2 Swap in/hr and in labels for rain and rain rate
PR52 1.6.2 Include trailing fractional zeros for OS Temp, Baro, Rain
PR53 1.6.3 Rain always an integer value
PR54 1.6.4 Reject Oregon Scientific reading where digit is not decimal
PR55 1.6.5 Add temperature compensation to humidity calculation for RFXCOM sensors
PR56 1.7.9 Added remainder of RFXCOM matrix of special X10 encoded devcies
PR57 1.7.10 Added Oregon Scientific Scale
PR58 1.7.10 Limited UID to 4 hex digit segment - affects Oregon Scientific UIDs
PR59 1.7.10 Provided more visibility why 41 bit security not accepted
PR60 1.7.11 Use same encoding for 32 and 48 bit modes of security sensors
PR61 1.7.12 Restore UID to full format for Oregon Scientific Sensors
PR62 1.7.12 Do not allow selection of X10 schema when device ID is not an X10 code
PR63 1.7.13 DS10 status does not change
PR64 1.7.13 Added Oregon Scientific UV138 sensor
PR65 1.7.14 Added debounce for RFXCOM Power
PR66 1.8.0 Added user-defined icon entry for DisplayText field display
PR67 1.8.0 Changed addressing of Visonic sensors to support xapbsc.query
PR68 1.8.2 Add Oregon Scientific THR328 Temp-Hydro
PR69 1.8.2 Add Oregon Scale GR101 (102 previously supported)
PR70 1.9.0 Implement mcsSprinklers HTTP server including authentication
PR71 1.10.1 Add Oregon Scientific RTGR328N Temp-Hygro
PR72 1.10.2 GR101 packet synchronization errors
PR73 1.10.3 GR101 weight decoding update
PR74 1.11.1 Add Chacon door lock
PR75 1.12.3 Add Oregon Scientific WGR800
PR76 1.12.5 Fix conversion from KPH to MPH for wind sensor



The latest version of xAPmcsRF can be downloaded at http://mcssprinklers.com/xapmcsRF.zip

Last edited by Michael McSharry; May 6th, 2010 at 07:20 PM.
  #2  
Old March 23rd, 2006, 12:57 AM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,773
Node status screenshot
Attached Images
 

Last edited by Michael McSharry; April 2nd, 2006 at 02:18 AM.
  #3  
Old April 2nd, 2006, 02:36 AM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,773
Updates made to provide setup options that provide the following features:
1. Allow signal inversion so that something like a dusk sensor can be treated as a dawn sensor
2. Allow xapBSC and/or xap-x10 for any message reporting
3. Allow xap-x10.request to be delivered similar to retransmit to any X10 address
4. Allow software to generate the OFF timing in lieu of the hardware OFF sent by device. This allows automatic debouncing
  #4  
Old April 2nd, 2006, 01:20 PM
jasv's Avatar
jasv jasv is offline
Super Seer
 
Join Date: Feb 2001
Location: Southern Cal, USA
Posts: 2,310
Very cool

I am not ready to use this but I will be in a couple of weeks. Thanks for this addition to xap.
__________________
James

Running HS 3 on Win10 .
  #5  
Old April 2nd, 2006, 02:06 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,773
I just noticed that the PC Remote protocol was published in another thread today. Looks pretty easy so I'll add it. I had done the temp/humidity sensors already, but only coded per spec since I do not have any of these with which to test.
  #6  
Old April 2nd, 2006, 04:31 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,773
I reposted with the X10 PC Remote recognition added. I did notice that the same RF code is used for "PC" and "4". I selected to interpret it as "4" . I also made the debounce interval for the PC Remote 50% of the other sensors to enhance the Vol+ and other similiar continuous buttons.
  #7  
Old August 31st, 2006, 02:24 PM
martynw
Guest
 
Posts: n/a
xapmcsRF with visonic receiver

Hello,

I've just installed a visonic powermax alarm system with pirs, contacts, smoke detectors, etc and have setup an RFXCOM Visonic interface (868 mhz version).

I'm attempting to get it playing nicely together with xapmcsRF but don't seem to be getting anywhere!

The rfxcom unit is installed and working, if I fire up the "visonic receiver" application from their software cd I get data flowing in the viewer such as:

Code:
 
31/08/2006 19:21:07= 24107D661C60			 PowerCode Addr:107D66 No Tamper,Close,Battery-OK ,Alive,Restore reported	,Primary contact 
31/08/2006 19:22:13= 242C7D661C90			 PowerCode Addr:2C7D66 No Tamper,Close,Battery-OK ,Alive,Restore reported	,Primary contact 
31/08/2006 19:22:13= 242C7D661C90			 PowerCode Addr:2C7D66 No Tamper,Close,Battery-OK ,Alive,Restore reported	,Primary contact 
31/08/2006 19:22:13= 242C7D661C90			 PowerCode Addr:2C7D66 No Tamper,Close,Battery-OK ,Alive,Restore reported	,Primary contact 
31/08/2006 19:22:14= 242C7D661C90			 PowerCode Addr:2C7D66 No Tamper,Close,Battery-OK ,Alive,Restore reported	,Primary contact 
31/08/2006 19:22:14= 242C7D661C90			 PowerCode Addr:2C7D66 No Tamper,Close,Battery-OK ,Alive,Restore reported	,Primary contact 
31/08/2006 19:22:14= 242C7D661C90			 PowerCode Addr:2C7D66 No Tamper,Close,Battery-OK ,Alive,Restore reported	,Primary contact 
31/08/2006 19:22:25= 24F5ABC61440			 PowerCode Addr:F5ABC6 No Tamper,Close,Battery-OK ,Alive,Restore not reported,Primary contact 
31/08/2006 19:22:25= 24F5ABC61440			 PowerCode Addr:F5ABC6 No Tamper,Close,Battery-OK ,Alive,Restore not reported,Primary contact 
31/08/2006 19:22:26= 24F5ABC61440			 PowerCode Addr:F5ABC6 No Tamper,Close,Battery-OK ,Alive,Restore not reported,Primary contact 
31/08/2006 19:22:26= 24F5ABC61440			 PowerCode Addr:F5ABC6 No Tamper,Close,Battery-OK ,Alive,Restore not reported,Primary contact 
31/08/2006 19:22:26= 24F5ABC61440			 PowerCode Addr:F5ABC6 No Tamper,Close,Battery-OK ,Alive,Restore not reported,Primary contact 
31/08/2006 19:22:26= 24F5ABC61440			 PowerCode Addr:F5ABC6 No Tamper,Close,Battery-OK ,Alive,Restore not reported,Primary contact 
31/08/2006 19:22:46= 24C627C61400			 PowerCode Addr:C627C6 No Tamper,Close,Battery-OK ,Alive,Restore not reported,Primary contact 
31/08/2006 19:22:46= 24C627C61400			 PowerCode Addr:C627C6 No Tamper,Close,Battery-OK ,Alive,Restore not reported,Primary contact 
31/08/2006 19:22:46= 24C627C61400			 PowerCode Addr:C627C6 No Tamper,Close,Battery-OK ,Alive,Restore not reported,Primary contact 
31/08/2006 19:22:46= 24C627C61400			 PowerCode Addr:C627C6 No Tamper,Close,Battery-OK ,Alive,Restore not reported,Primary contact 
31/08/2006 19:22:46= 24C627C61400			 PowerCode Addr:C627C6 No Tamper,Close,Battery-OK ,Alive,Restore not reported,Primary contact
If I fire up xapmcsrf then I don't seem to get much at all. I get a few event.log xap messages (pertinent bits below):

Code:
 xap-header 
 
{
 
v=12
 
hop=1
 
uid=FF005200
 
class=Homeseer.Event
 
source=mcs.W800.AHSHA
 
}
 
Event.Log
 
{
 
time=31/08/2006 19:24:34
 
type=xapmcsW800
 
data=W800 Comm Port 7 Opened
 
}
 
xap-header
{
 
v=12
 
hop=1
 
uid=FF005200
 
class=Homeseer.Event
 
source=mcs.W800.AHSHA
 
}
 
Event.Log
 
{
 
time=31/08/2006 19:24:35
 
type=xapmcsW800
 
data=Receiver confirmed 32 bit mode configuration
 
}
If I open the "IO window" then I don't seem to get much going on at all (compared to the visonic viewer):


Code:
19:25:50 | 4C, BD, 8C
19:25:50 | 73
19:26:09 | 3D | Discarding 4C
19:26:09 | 19, 8C, 73
Firing up a web browser and viewing the status page doesn't seem to show anything either.

Am I doing something wrong (or stupid )? Or is xapmcsrf not compatible with the visonic receiver?

Thanks for any pointers that you can give!

Martyn
  #8  
Old August 31st, 2006, 04:19 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,773
I'm not familiar with what Bert did different for the Visonic interface. Just now I saw the protocol docs on his web site. When I look at the X10-equivalent command set and protocol in section 8 of his document I do not see a correlation with the 48 bit data stream in your visonic receiver. As an example...

24 10 7D 66 1C 60

Where I expect the 3rd & 4th bytes to be complements of each other.

I also see that xapmcsRF is configured for 32 bit operation. Independent of that, however, is that the IO window shows the raw data stream from the RFCOM receiver is not seeing much. I would expect the equivalent activity level between the two receivers.

If Bert could chime in a identify the nature of the Visonic interface or make any other observations then we will make progress much faster.

Last edited by Michael McSharry; August 31st, 2006 at 04:30 PM.
  #9  
Old August 31st, 2006, 06:00 PM
b_weijenberg b_weijenberg is offline
OverSeer
 
Join Date: Oct 2003
Location: Netherlands
Posts: 2,920
Martyn,

In the screen dump the receiver is operating in Visonic mode and the received data is the real untranslated RF data.

Using the "visonic receiver" program, init the receiver in 32 bit mode (NOT 32 bit X10 mode).

BTW: At the download page of www.rfxcom.com there is a new version of the RFreceiver program that works now with all type of receivers, also the visonic.


Michael,
the RFXCOM receiver is set into 32 bit mode (W800 compatible) by sending 2 characters hex F0 - hex 29. The receiver responds then with hex 29. If your program can start with sending the hex F029 and waits for the response hex 29 the program can detect that the receiver is connected and operational. The same is true for a W800.

Bert
  #10  
Old August 31st, 2006, 06:16 PM
martynw
Guest
 
Posts: n/a
Hello Michael, Bert

Thanks for the quick responses!

With the new RF receiver software init to "32 bit mode" I get:

Code:
 
Init cmd to receiver => F029
29 ACK 
32E90CF3 Visonic motion sensor Alert 
107D847B Visonic door sensor	Normal
With xapmcsrf I get:

Code:
23:18:14 | F5, AB, 0C, F3
23:18:31 | EC, B9, 0C, F3 | Discarding F5
23:18:36 | FE, DD, 0C, F3 | Discarding 00 | Discarding 00 | Discarding 00
Hope this helps!

Martyn
  #11  
Old August 31st, 2006, 06:18 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,773
The setup of the 32 bit mode was done and did show in the xAP message posted. What I do not understand is why very little data was received by the RFXCOM. The visonics protocol document describes some X10 compatibility translations. If this is being used in non-X10 mode then how should the data be interpreted?
  #12  
Old September 1st, 2006, 05:28 AM
b_weijenberg b_weijenberg is offline
OverSeer
 
Join Date: Oct 2003
Location: Netherlands
Posts: 2,920
In 32 bit mode the received data has the same format as the X10 security.
However:
1- All duplicate RF messages (~20 in Visonic RF) are suppressed and only one packet is send to the RS232 port to lower the load of the PC. The Visonic packets are checked in the receiver on validity using the parity control bits and only valid RF packets are translated to X10 format and 1 packet is send to the RS232 port.
2- In the X10 definition the 2nd byte is a half complement of the 1st byte. But the RFXCOM Visonic receiver transmits in the first 2 bytes a real 16 bits address. This is to eliminate the possibility to have duplicate sensor addresses. If only 8 bits of the Visonic sensor address where used then there is a big chance to get duplicated addresses. The sensor address is fixed and can't be changed in the sensor (even after a battery change stays the address the same).

I guess the 3 messages are valid packets from 3 different sensors giving an Alert signal:
23:18:14 | F5, AB, 0C, F3 sensor addr F5AB Alert 0C
23:18:31 | EC, B9, 0C, F3 sensor addr ECB9 Alert 0C
23:18:36 | FE, DD, 0C, F3 sensor addr FEDD Alert 0C

Bert
  #13  
Old September 1st, 2006, 03:33 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,773
I added the X10 mode of the Visonic to V1.3.3.

Each Device will show up as three entities with the device codes of
xxxxS0,xxxxS1, and xxxxKF that correspond to the sensor bit 7 off,on and the keyfob.

The sensor Alert/Normal will be ON/OFF state respectively and may be event or info depending upon the prior state. The BatteryLow and Tamper will always be an event. All keyfob actions will be events.

Some sample messages...

Code:
xap-header
{
    v=12
    hop=1
    uid=FF005202
    class=xapbsc.info
    source=mcs.W800.MCS5:S1.W800________F5ABS1.S1.State
}
input.state.1
{
    state=Off
}
Code:
xap-header
{
    v=12
    hop=1
    uid=FF005202
    class=xapbsc.event
    source=mcs.W800.MCS5:S1.W800________F5ABS1.S1.BatteryLow
}
input.state.1
{
    state=ON
}
  #14  
Old September 1st, 2006, 03:46 PM
martynw
Guest
 
Posts: n/a
That's fantastic Michael, thanks very much!

I'll have a play over the weekend and report back.

Martyn
  #15  
Old September 1st, 2006, 05:40 PM
martynw
Guest
 
Posts: n/a
Quote:
Originally Posted by Michael McSharry
Each Device will show up as three entities with the device codes of
xxxxS0,xxxxS1, and xxxxKF that correspond to the sensor bit 7 off,on and the keyfob.
Hi Michael,

I'm a little confused at the above, can you expand please?

I'm looking at a PIR device that gives the following device codes:

FEDDKF
FEDDS0
FEDDS1

What do they represent?

Thanks,

Martyn
  #16  
Old September 1st, 2006, 06:40 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,773
The table attached is from Bert's X10-mode for the Visonic devices in 32 bit mode. An xAP message where the code is FEDDKF will be a reception of an RF signal from the keyfob column. These will be 02,, 82, 42, 26, and 0E. The FEDDS0 will be fromt he Sensors Bit7-Off column. The FEDDS1 will be from the Sensors Bit7-On column.

This was my guess as how the Visonic system is setup. If I'm wrong then suggest a more useful organization based upon the what is available in the table

Code:
Sensor (xxxxS0 or xxxxS1)
   State (on/off)
   BatteryLow (on)
   Tamper (on)
Keyfob (xxxxKF)
   ArmAway (on)
   Disarm (on)
   LightsOn (on)
   Panic (on)
   ArmHome (on)
Attached Images
 
  #17  
Old September 2nd, 2006, 05:37 AM
martynw
Guest
 
Posts: n/a
Hello Michael,

Thanks for the explanation, it's a lot clearer now.

Here are some notes from my testing, they may be useful for other users:

On initial setup each sensor will have 3 device codes in the browser no matter what sensor type it is, so for example a PIR will have:

32E9KF
32E9S0
32E9S1

For future sensor status / activity, only one device code will "contain" the status message. The device code will depend on the sensor type:

....KF = for keyfobs
....S0 = for sensors that don't report "restore"
....S1 = for sensors that report "restore"

Sensors that report "restore" are those such as magnetic contacts where they will send an "alert" when opened and a "normal" when closed.

Sensors that don't report "restore" are those that only send an "alert" - from my testing so far these are PIRs.

So for the above PIR code of 32E9, future status / activity will be on the 32E9S0 and 32E9S1 & 32E9KF can be ignored.


Hope this helps!

Martyn
  #18  
Old September 2nd, 2006, 06:24 AM
martynw
Guest
 
Posts: n/a
KeyFobs

KeyFob events appear ok in the browser but generate the following xap messages:


Code:
 xap-header 
 
{
 
v=12
 
hop=1
 
uid=FF005200
 
class=Homeseer.Event
 
source=mcs.W800.AHSHA
 
}
 
Event.Log
 
{
time=02/09/2006 11:24:01
 
type=xapmcsW800
 
data=xapName Line 20 Object variable or With block variable not set
 
}
Code:
 xap-header 
 
{
 
v=12
 
hop=1
 
uid=FF005200
 
class=Homeseer.Event
 
source=mcs.W800.AHSHA
 
}
 
Event.Log
 
{
 
time=02/09/2006 11:24:01
 
type=xapmcsW800
 
data=ProcessCommData Line 2150 Object variable or With block variable not set
 
}
  #19  
Old September 2nd, 2006, 12:49 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,773
Give the new posting at the top of this thread a try to eliminate the error messages and get event data sent
  #20  
Old September 2nd, 2006, 01:30 PM
martynw
Guest
 
Posts: n/a
Quote:
Originally Posted by Michael McSharry
Give the new posting at the top of this thread a try to eliminate the error messages and get event data sent
Thanks Michael, no error messages now, but no xAP messages either! Other sensors are ok, it's just the keyfobs.

The IO window and browser are both updating fine though.

Martyn
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 07:24 AM.


Copyright HomeSeer Technologies, LLC