Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Security Device Types

  1. #1
    Join Date
    May 2004
    Location
    Dallas, TX
    Posts
    1,125

    Default Security Device Types

    With the Elk there is the ability to turn an output on, on for a specified amount of time, off or toggle it. What device type would be recommeded or does a new type need to be created?

  2. #2
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    I think a new device type is suited for this... the HAI offers this but I did not export that functionality to the DM -> prefering to control timing within G4.

    So, I would inherit from the switch device and add an option to set time as a user input.

    BTW, how is the Elk plugin working?

    Great too see you digging into the DM. Post away with any questions.

  3. #3
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    On second thought, for now, just use a switch device. We should work this out internally I think. Also, want to see what Rob thinks.

  4. #4
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    Sounds like a new device type to me. Nice thing is that the provider can either handle the timing internally or hand it over to the real hardware if it offers that functionality.
    --Rob

  5. #5
    Join Date
    May 2004
    Location
    Dallas, TX
    Posts
    1,125

    Default

    Ok, got bored at work today and threw together a new device to handle outputs. Hope I am not getting to far ahead of the game here. Here is what I added to the security.lua file.

    Code:
    --[[
    
    SEcurity Output Device Class
    
    --]]
    
    
    local SecurityOutput = Sensor:New ( {
    
        Type = 'Security\\Output',
    
        AddControls = function (self)
            
            Sensor.AddControls (self)
        
            local StateControl = DeviceManager.Controls.Classes.RadioButtons:New ( {ID = 'State',Name = 'Output State',Device = self,Values = self.StateValues or {'On','Off'}, Command = self.StateCommand})
            self:AddControl(StateControl)
    
        end,
    
    
    } )
    I also created a DUI Action for the device and have that working, it reacts to device state changes and provides information to the provider when the action is initiated. I would like to notify the provider about the hours/minutes/seconds to leave the output on, how do I provide that info to the provider? I have looked at the action code for the lighting action and see how this can be handled internally by G5, but would also like the option of being able to have the Elk handle timing as well.

    Rick

  6. #6
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    Rick, I would use the standard switch device from the Lighting.lua file.

    As for time, I am not sure what is best. ie. the time is really controlled via the external device. You can set up a device to SET that time but I think it should only track that time if the Elk constantly reports the time. Does it?

    Rob and I have been discussing on how to have a Time control for entering a time. We need to plough through a few different scenarios first. Its not that its not doable... its just doing it right the first time. Sometimes that happens

  7. #7
    Join Date
    May 2004
    Location
    Dallas, TX
    Posts
    1,125

    Default

    Will use the switch device for now. I am going to install G5 on my main server this weekend and do some more testing with my Elk script. If all goes well will leave it there for more time. If I have troubles is there any problems with having G4 & G5 on the same machine?

    As far as the time issue, with the Elk I can send a command to the unit to instruct it to turn an output on for 0 - 65535 seconds, 0 being on indefinitly. The Elk will then handle turning the output off at the appointed interval.

    From what I have seen so far the DM is really impressive.

  8. #8
    Join Date
    May 2004
    Location
    Dallas, TX
    Posts
    1,125

    Default

    Well tonight I was thinking about some of the things that I will need to change in order to move my Elk script to G5 and use the DM. I only want to create devices that are actually being used, ie areas and zones. To do this I need to poll the Elk for the information. Previously I would issue the needed commands and let it go. This process could take several minutes to complete.

    I assume now that I will need a more controlled process for getting the data collected and once collected then start the DM. Does this sound right?

    Rick

  9. #9
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    Hi,

    Here is what the HAI plugin does....

    1. it queries the controller and gets a list of all devices ie zones, units, hvac etc.
    2. it then starts the provider
    3. provirder requests all of the above
    4. provider only exports devices that have real names (ie not default) to the DM

    i would add a publisher to the Elk plugin if one isn't there. this concept is key to everything in G5 publisher/subscriber

  10. #10
    Join Date
    May 2004
    Location
    Dallas, TX
    Posts
    1,125

    Default

    In its current state my plugin uses hard coded tables with area and zone data that is loaded in the Initialize() routine. Also in the Initialize() routine I am starting up the Elk provider which reads the area and zone tables and loads them into the DM. This appears to work fine.

    However to get the same data from the Elk I will have to send 8 areaname commands and 208 zonename commands and wait for them to all be processed before starting the DM. This process can take a minute or more to complete. I need a method for knowing when the process is complete.

    Or could I start the provider during the Initialize() routine, but not load the devices. Then as the devices are discovered add them to the DM similar to the way the W800 adds new devices???

    Rick

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •