Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Some notes about the DeviceManager

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

    Default Some notes about the DeviceManager

    The DeviceManager is one of the core new features of G5. It provides a common schema to represent devices and their controls. The goal is too simplify working with devices in Girder.

    Features/Notes... (in no particular order)

    1. A hardware or software plugin/component interfaces to the DeviceManager via its Provider. Ie. The Insteon plugin uses a provider to add/remove and update devices in the DM.


    2. Each device MUST have a unique PATH. The path is created by a plugins provider. Typically, a path will identify the machine the device originates from ,the plugin and then an ID. Eg, for X10, we would have a path of MyPC\X10\A1 or for Insteon MyPC\Insteon\XX.XX.XX. The path is critical as make scripts and actions immune to changes in device naming

    3. Device Loc/Name. Each device is given a location and name (user controlled). The location and name are stored in the Local Device Manager. Therefore, we have a centralized place to manager devices. As well, this means many plugin will no longer have to provider their own DUI pages for managing device naming. As well, devices are giving a Display Name that is users of the Device Manager get when building an interface of devices.

    4. Each device can 1 or more controls. Controls follow a predefined schema that makes it easy for NetRemote or the G5 Webserver to build pages. It also makes it easy to script actions. For instance, regardless of the underlying hardware or protocols, you can always turn a light device off using the same lua code.



    There is much more, so fire away with quesitons.

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

    Default

    Will the DM track when a device changes state and will that information be able to be extracted?

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

    Default

    DM tracks when devices are changed and the events are published. That is how NR and the WebServer stay up to date.

  4. #4
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    2,140

    Default

    (maybe this needs to go into the NR forum :-) )

    I want to see the current state of an X10 motion detector in Netremote

    in NRD 'netremote variables', I see a bunch of DM stuff

    like

    SERVER\X10\A9\Condition Ready

    but If I do :

    NetRemote.GetVariable("SERVER\X10\A9\Condition")

    then I get an empty string ?

    what am I doing wrong ?

    Marcel

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

    Default

    You're going to kick yourself!

    Double up the backslashes or use [[ ]] to enclose the string.
    --Rob

  6. #6
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    2,140

    Default

    ooops (back to reading the lua manual again)....

    (quick reply by the way, 2 minutes)

    Marcel
    Last edited by mhwlng; December 30th, 2006 at 02:55 PM.

  7. #7
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    2,140

    Default

    works ok now,

    see (resized) picture :

    * it's a fully interactive svg file (shown in a web browser) ,
    this means :
    it's a vector drawing, so will resize to fit any resolution ccf file !
    the colour scheme/line thickness etc. can be adjusted easily

    it uses the same techniques as discussed here (svgsample2) :

    http://www.promixis.com/forums/showthread.php?t=9550

    the lights/motion detectors/radiators/heater, now light up correctly in response to DM data (updated every 500 ms)...

    example javascript :
    Code:
     
    var svgElement = svgDoc.getElementById("id12");
    if (ax.GetVariable("SERVER\\X10\\A12\\Condition")=="Not Ready") 
      svgElement.setAttribute("style","fill:red;");
    else
      svgElement.setAttribute("style","fill:lightgreen;");
    and the room background changes, if girder thinks there is somebody in the room. (the motion detectors can't be used for this directly, because if you sit in the sofa watching tv, they don't detect motion ) I'm still tinkering with this (the goal is to automatically switch off the lights if the room isn't occupied)...

    I could still add dim level display (for example as a tooltip), room temperature etc. and the ability to click on a light to switch it on/off or even animation for the light/motion detector symbols



    Marcel
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	house (Medium).jpg 
Views:	129 
Size:	97.4 KB 
ID:	3220  
    Last edited by mhwlng; January 1st, 2007 at 05:36 AM.

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

    Default

    Very nice!
    --Rob

  9. #9
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    2,140

    Default

    I'm trying to change the lights from the svg file (by clicking on the lightbulb)

    I do this by calling :

    DM.SetValue("SERVER\\X10\\A7", "Switch", "Off")

    but that doesn't work :-)

    do I have the wrong function or syntax ?
    (I do see DM SetValue in the girder log)

    (note that I don't have require 'DMSupport' in my lua file !!)


    Marcel

  10. #10
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    2,140

    Default

    never mind...

    I confused an NR function with a girder function

    this works ok :

    Code:
     
    ax.GenerateAction(-1,0,1,'SERVER\\X10\\A7\\Switch(Off)');

Posting Permissions

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