Results 1 to 10 of 19

Thread: DeviceManager and Lua

Hybrid View

  1. #1
    Join Date
    Mar 2005
    Posts
    724

    Default DeviceManager and Lua

    ok in G6 how can you control Device Manager devices in Lua? and is there a way to read the devices in Lua to get a list I know in G5 there was a DeviceManager Table.

    Also is there a way to access Girder6 via TCP such as a remote Lua console or something along those lines I am trying something with the Pi version of Girder6 and need remote access to test and configure it.

    Thanks,
    Yonu

  2. #2
    Join Date
    Mar 2005
    Posts
    724

    Default

    ok I figured out how to read the devices to Lua then went to look in the manual to see if something else was there and found what I just figured out

    Gonna be one of those days,
    Yonu
    Last edited by yonu; March 21st, 2014 at 04:35 PM.

  3. #3
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,553

    Default

    The manual is also your friend...
    Ron
    No support through PM

  4. #4
    Join Date
    Mar 2005
    Posts
    724

    Default

    ok here is an odd one for you I am using basic handler and binary switch for reference while I code is there a way to get any more details in the DM table for the controls such as the min and max values on the basic handler unless I am missing something.
    I need a way to get the min and max values and I don't unfourtently have a dimmer and thermostat on hand to try with.
    also how do you rename the devices I assume it is possible

    for example here is the 2 tables and print I am using
    Code:
    devices = deviceManager.devices()
    table.print(devices)
    
    controls = deviceManager.controls()
    print('controls') --reference for skimming the output
    table.print(controls)
    Here is the output I receive back
    Code:
    Fri Mar 21 18:44:19 2014	{ -- #0
    Fri Mar 21 18:44:19 2014	   [4] = { -- #1
    Fri Mar 21 18:44:19 2014	      ["enabled"] = 1,
    Fri Mar 21 18:44:19 2014	      ["config"] = "",
    Fri Mar 21 18:44:19 2014	      ["name"] = "Basic Handler",
    Fri Mar 21 18:44:19 2014	      ["id"] = 4,
    Fri Mar 21 18:44:19 2014	      ["locationId"] = 1,
    Fri Mar 21 18:44:19 2014	      ["componentId"] = 3,
    Fri Mar 21 18:44:19 2014	   } -- #1,
    Fri Mar 21 18:44:19 2014	   [2] = { -- #2
    Fri Mar 21 18:44:19 2014	      ["enabled"] = 1,
    Fri Mar 21 18:44:19 2014	      ["config"] = "",
    Fri Mar 21 18:44:19 2014	      ["name"] = "Binary Switch",
    Fri Mar 21 18:44:19 2014	      ["id"] = 2,
    Fri Mar 21 18:44:19 2014	      ["locationId"] = 1,
    Fri Mar 21 18:44:19 2014	      ["componentId"] = 3,
    Fri Mar 21 18:44:19 2014	   } -- #2,
    Fri Mar 21 18:44:19 2014	} -- #0
    Fri Mar 21 18:44:19 2014	controls
    Fri Mar 21 18:44:19 2014	{ -- #0
    Fri Mar 21 18:44:19 2014	   [4] = { -- #1
    Fri Mar 21 18:44:19 2014	      ["valueType"] = 4,
    Fri Mar 21 18:44:19 2014	      ["internalId"] = "2-0-32",
    Fri Mar 21 18:44:19 2014	      ["name"] = "Basic value",
    Fri Mar 21 18:44:19 2014	      ["id"] = 4,
    Fri Mar 21 18:44:19 2014	      ["value"] = "0",
    Fri Mar 21 18:44:19 2014	      ["config"] = "",
    Fri Mar 21 18:44:19 2014	      ["deviceId"] = 4,
    Fri Mar 21 18:44:19 2014	   } -- #1,
    Fri Mar 21 18:44:19 2014	} -- #0

    Thanks,
    Yonu

  5. #5
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,553

    Default

    looks like dconfig and dtype are missing. Included in 6.0.0.53
    Ron
    No support through PM

  6. #6
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,553

    Default

    Use the device manager UI to do your renaming ( F2 )
    Ron
    No support through PM

  7. #7
    Join Date
    Mar 2005
    Posts
    724

    Default

    and I will work around the 2 fields until the next release

    thanks I didn't even think to try f2. on a side note I notice in the device path the location name is home is this a fixed constant or changable not a big issue atm just curious.



    Thanks,
    yonu

Posting Permissions

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