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
  #101  
Old February 28th, 2006, 05:47 PM
fdemange
Guest
 
Posts: n/a
Thank's for the update, we are on the good way.
Now, it's possible to launch the windows-based setup.

When i click on the "poll for adapters" button, the interface does not detect my DS9490 (it is well detect by the "default 1-wire Net" software from Maxim)==> the xap viewer return this text :
xap-header
{
v=12
hop=1
uid=FF000500
class=Homeseer.Config
source=mcs.OneWire.BTW44310
}
Config.Notification
{
Index=0
File=mcsXap1Wire.ini
Section=OneWire
Key=DSPort
Value=
}


This error is visible in the Xap Viewer:
xap-header
{
v=12
hop=1
uid=FF000500
class=Homeseer.Event
source=mcs.OneWire.BTW44310
}
Event.Log
{
Time=28/02/2006 22:57:56
Type=xapmcs1Wire
Data=SetIniValue Line 460 ActiveX component can't create object
}
  #102  
Old February 28th, 2006, 11:57 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is online now
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,525
In mcsTemperature I download drivers if they are not installed. I thought I had done this with xapmcs1wire as well, but I had not. I added this to the V1.10.4 posting. Note also that if you are running XP that you will likely also need to download the Microsoft Java VM. There have been some recent posts in this or a related forum on getting it.
  #103  
Old March 1st, 2006, 11:40 AM
fdemange
Guest
 
Posts: n/a
I'm using the 5.00.3810 java version of Microsoft.

A new error :

xap-header
{
v=12
hop=1
uid=FF000500
class=Homeseer.Event
source=mcs.OneWire.BTW44310
}
Event.Log
{
Time=01/03/2006 16:54:34
Type=xapmcs1Wire
Data=SetIniValue Line 780 Object variable or With block variable not set
}
this error appear just after the click on the message about "1-wire drivers ....interface"



"Poll for adapters" is always empty.
  #104  
Old March 1st, 2006, 01:10 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is online now
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,525
The location that I'm using for the download is
ftp://ftp.dalsemi.com/pub/auto_id/li...ers_v400b4.msi
It will take a few minutes and then a Windows installer started which requires some interaction from you. If you are not getting the drivers autodownload and installed, then just do it manually to install the drivers. Part of the process is to identify the type of interface (DS9490) and its USB port.
  #105  
Old March 1st, 2006, 01:22 PM
fdemange
Guest
 
Posts: n/a
Yes !!!!
my driver version was ftp://ftp.dalsemi.com/pub/auto_id/li...ivers_v400.msi
and not ftp://ftp.dalsemi.com/pub/auto_id/li...ers_v400b4.msi

I'd uninstalled the first one to put the beta version, my adapter is well detected.


Thank's for your work !
Fabrice
  #106  
Old March 2nd, 2006, 05:02 PM
fdemange
Guest
 
Posts: n/a
DS2406 and alarm mode

I need few explanations about "Some switches w/o alarm" and "All switches with alarm ".
I have 9 DS2406 on my onewire network.
the fisrt one is configured as a relay, and it work fine with homeseer, my light can be swith on and off without problem.
the others are configured as switches, if i choose "Some switches w/o alarm" or All switches with alarm ", the result is the same, the push button which activate the DS2406 needs to be down during the periodique scan to be detect. a simple push/release on the button is not detected.


how can i do to use my switches in a quick alarm mode ?

Fabrice
  #107  
Old March 2nd, 2006, 07:05 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is online now
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,525
I have only DS2405 switches/relays so this is something that I have not testing myself, but during development time with mcsTemperature there were others that helped with the testing.

The alarming switches come into play when the switch polling interval is specified. This is typically a faster rate than the normal cycle. When the switch polling cycle starts then the polling filter is set to either only alarming switches or individually to each family for 01, 05, 12, and 29 for the various swith types supported. If no switches are alarming then the poll will be very quick, thus enabling a potentially faster switch polling interval.

Since you only have DS2406 then you should be able to enable the alarming mode and reduce utlization of the 1-wire and CPU or increase the switch polling cycle.
  #108  
Old March 3rd, 2006, 05:30 AM
fdemange
Guest
 
Posts: n/a
Hello,
I believe that the Dallas switches have 2 alarms modes :

1 - an alarm is detected only if you are in a poll cycle and only if you are pushing the switch button ==> you are using this mode during your "sample interval" but not during your "switch interval"

2 - the switch are abled to keep an alarm, and you can collecte and reset it when you want on a scheduled poll cycle. (i think that "sample interval" or "switch interval" doen't use this mode)

Is it correct ?
  #109  
Old March 3rd, 2006, 02:50 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is online now
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,525
My understanding of the way it is working is that when a switch becomes activated it sets its alarm register. The alarm register can be read if the device is polled and the the device will respond to a find devices query based upon a filter for "alarming devices". In my case I filter for alarming devices in the switch poll cycle and then clear the alarm as I read the current state of the device.
  #110  
Old March 3rd, 2006, 05:08 PM
fdemange
Guest
 
Posts: n/a
My understanding is the same as you, but the alarms of the switches on my network are only detected at each poll cycle at the "sample interval" and only if i push a button (connected on a switch) during the cycle.

Is there a debug mode which be able to write all the 1-wire transactions sent on the network?

Last edited by fdemange; March 3rd, 2006 at 05:25 PM.
  #111  
Old March 3rd, 2006, 11:26 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is online now
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,525
I'm not aware of any debug capability at the bit level. I use the COM interface provided by OWAPI. The DS2406 is described by Container12 at http://www.cs.usm.maine.edu/class/co...eWireAPI/docs/

I use the readDevice, getLevel, and clearActivity methods for the actual reading and preparing the DS2405. There are other methods related to polling to identify the devices of interest.
  #112  
Old March 4th, 2006, 03:47 AM
fdemange
Guest
 
Posts: n/a
OK, our problem come from the the difference between the methods getlevel and getSensedActivity.
the state of the device is store in its memory and delivered when you invoke the getSensedActivity method. this state is erased by the clearactivity method. If the switch has an activity (and not level !) between 2 polls cycles ("switch interval"), the information of its past activity will be always available.

in a small developpment, i used this method to detect the alarm state of dallas switch, the differrence is very important.
Is it possible to use this method for the alarm check ?

thanks

Fabrice
  #113  
Old March 4th, 2006, 12:39 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is online now
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,525
It seems to me I would need to send a pair of messages when the sensed activity is active and the level has not changed. The first will be to indicate that a level change occurrred and the second to restore back to the current level.

It makes sense now how to handle momentary switches. I added it and posted as V1.10.5. Please give it a try to verify I did it correctly.
  #114  
Old March 4th, 2006, 04:10 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is online now
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,525
DS1923 Operations

I obtained a sample of the DS1923 and was able to recognize and read the temperature and humidity, but the values did not change so there is likely some configuration setup that is needed. The literature I found described only how it operates in a mission data collection mode, but nothing about using it as a basic sensor. If one know a little more about this device then some pointers would be appreciated. V1.10.6 contains the updates to support it to the point I now have it. It could be that my device does not work, but more likely something needs to be done with its configuration. I had consistent readings of 77 Temp and 33 Humidity. The temp is too high and the 33 is too low. It is more likely these were factory readings that have been latched.

Note that driver version beta 4 is needed to work with the DS1923. An ftp link to it is posted a few messages up in this subforum.
  #115  
Old March 6th, 2006, 09:34 AM
fdemange
Guest
 
Posts: n/a
Ds2406

Hello,
the v1.10.5 (in fact v1.10.6) does not solve my problem.
- No detection of the state of switches during the "switch interval", but only during the "sample interval" and the state detected is the level state and not the activity

my small soft was something like that (in VB), this code was included in a thread which poll the switches on every 400ms, i'm not a very good developper, it's why i preferre your code, but this one is very simple :
temp(0)=1f
temp(1)=05
temp(2)=12 'the 2406 family
temp(3)=29
For i = 0 To 3 " one cycle per family 1f, 05, 12, 29
adapter.targetAllFamilies() 'reset of the last filter
adapter.targetFamily("&H" & temp(i))
owd_enum = adapter.getAllDeviceContainers
While owd_enum.hasMoreElements
owd = owd_enum.nextElement
OneWireAddress = owd.getAddressAsString
state = owd.readDevice
activity = owd.getsensedactivity(0, state) 'get the activity since the last clearactivity cycle
If activity = True Then
owd.clearactivity()
state = owd.readDevice 'reset the activity
'put here your standard code (XAP ....)
End If
End While
Next i


you can use the hasActivitySensing() method to verify if this switch support activity sensing.
the 01 family does not support the activity sensing.
  #116  
Old March 6th, 2006, 11:46 AM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is online now
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,525
The DS2406-specific processing I have is
Code:
        Set owc = adapter.getDeviceContainer(address)
        Set owc = owc.getMostSpecificComponent
        Set state = owc.readDevice
        bActivity = owc.getSensedActivity(iChannel, state)
        If .FunctionType(iChannel) = jRelay Then
            latch = owc.getLatchState(iChannel, state)
        Else
            latch = owc.getLevel(iChannel, state)
        End If
        'after 2nd channel is processed then clear the activity latches
        If iChannel = 1 Then
            owc.clearActivity
            owc.readDevice
        End If
        If DebugLog Then
            hsWritelog PLUGIN_DEBUG, "DS2406 " & cstr(address) & "(" & CStr(iChannel) & ") Activity=" & CStr(bActivity) & ",Latch=" & CStr(latch) & ",PriorState=" & CStr(.IsOn(iChannel))
        End If
I just added the debug at the bottom in V1.10.7 and it can be activated by adding the following to \Config\xapmcs1write.ini in the area where the other general settings are defined. Start xapmcs1wire after adding this

DebugLog=True
  #117  
Old March 6th, 2006, 04:33 PM
fdemange
Guest
 
Posts: n/a
Ds2406

Thank's for the debug mode.

the activity of DS2406 is well checked, but always on the "sample interval" and not on the "switch interval", we are obliged to wait the end of the "sample interval" to obtain the activity information.

xap-header
{
v=12
hop=1
uid=FF000500
class=Homeseer.Event
source=mcs.OneWire.PROVISOIRE
}
Event.Log
{
time=06/03/2006 20:35:10
type=xapmcs1WireDebug
data=DS2406 E400000002A99E12(0) Activity=True,Latch=False,PriorState=False
}
but the xap message used by HS is :
xap-header
{
v=12
hop=1
uid=FF000550
class=xAPBSC.event
source=mcs.OneWire.PROVISOIRE:xapmcs1Wire_S_penderie_Blanc.E 400000002A99E12.Switch.0
}
input.state.1
{
state=OFF
displaytext=
Other 1

}
The state is OFF instead ON. I know, the ON information is very momentary, but it's not a very big problem, i can managed the state OFF.

My real problem is the unreal time of the switch alarm information:
is it possible for you to check and XAP in a BSC message each device activity which is "True" at each "switch interval" ?

I'm sorry, I give to you a lot of work!
Fabrice



an other small error, not very important ?
{
time=06/03/2006 20:13:45
type=xapmcs1Wire
data= ScrollEchoWindows: Line 80 A form can't be moved or sized while minimized or maximized
}
  #118  
Old March 6th, 2006, 07:07 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is online now
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,525
I see where my status reporting was not correct for the alarming, but it should be reporting on the switch interval and the poll interval. I added a little debug in the switch polling loop. From this we can see if the swithc polling and alarming switch search filter is doing what is expected. V1.10.8 has both corrections. I know about the IO window message when the window is minimized rather than closed. I elected to not deal with the window state before scrolling since this is only a debug feature.

Code:
                        adapter.Reset
                        If AlarmingSwitches Then
                            adapter.setSearchOnlyAlarmingDevices
                        Else
                            adapter.setSearchAllDevices
                        End If
                        bFirst = adapter.findFirstDevice
                        If DebugLog Then
                            hsWritelog PLUGIN_DEBUG, "PollDS9097Switches All Alarming=" & CStr(AlarmingSwitches) & ",Search Found Device=" & CStr(bFirst)
                        End If
  #119  
Old March 7th, 2006, 11:19 AM
fdemange
Guest
 
Posts: n/a
Ds2406

Hello,
The ON state is correct, when there is an activity on a switch i can see theses 2 XAP messages.

The activity is detected on sample interval, i have never seen the debug message "PollDS9097Switches All Alarming…. " during this time ( 60 seconds).My switch interval is 500ms and i 'd used my switch more than one time betwenn two polls cycles.

The switch polling and alarming switch skeep this line !!! why ? perhaps an error code which stop the cycle before the execution of this line, or something like that.

xap-header
{
v=12
hop=1
uid=FF000500
class=Homeseer.Event
source=mcs.OneWire.PROVISOIRE
}
Event.Log
{
time=07/03/2006 07:15:00
type=xapmcs1WireDebug
data=DS2406 D300000002A99F12(0) Activity=True,Latch=False,PriorState=False
}



xap-header
{
v=12
hop=1
uid=FF000578
class=xAPBSC.event
source=mcs.OneWire.PROVISOIRE:xapmcs1Wire_s15.D300000002A99F 12.Switch.0
}
input.state.1
{
state=ON
displaytext=
Other 1

}
  #120  
Old March 9th, 2006, 04:42 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is online now
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,525
Let us give it a try again. I had not started the switch polling timer. V1.10.9
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 10:04 PM.


Copyright HomeSeer Technologies, LLC