Announcement

Collapse
No announcement yet.

xapmcs1Wire - 1 Wire (DS9097U / DS9490D) xAP Node

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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

    Comment


      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.

      Comment


        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 ?

        Comment


          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.

          Comment


            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 ; March 3, 2006, 04:25 PM.

            Comment


              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.

              Comment


                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

                Comment


                  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.

                  Comment


                    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.

                    Comment


                      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.

                      Comment


                        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

                        Comment


                          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=<table><td><img alt='Other' src='/images/sensors/blank3.gif' height='16' width='16'><img alt=' ' src='/images/sensors/blank3.gif'></td><td valign='middle' align='left'>1</td></table>
                          }
                          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
                          }

                          Comment


                            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

                            Comment


                              Comment


                                Let us give it a try again. I had not started the switch polling timer. V1.10.9

                                Comment

                                Working...
                                X