LinuxMCE Forums
May 24, 2013, 05:39:48 pm GMT-1 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com
 
   Home   Help Search Chat Login Register  
Pages: [1]
  Print  
Author Topic: Device state information  (Read 685 times)
derailed
Newbie
*
Posts: 10


View Profile
« on: February 27, 2009, 07:44:13 am »

Hi,

    Can anyone post some information on how to get a device current state. Somehow the state is persisted in the db for lights only but does not appear to be consistent across other devices.

    So can someone enlighten me on how to ask a device for it's current state ie can I use MessageSend to get this type of information somehow - ie a light is on/off/dimed. an IP cam is active or not - a motion sensor is active, etc...


Thanks !!
Logged
tschak909
LinuxMCE God
****
Posts: 5101

DOES work for LinuxMCE.


View Profile
« Reply #1 on: February 27, 2009, 09:26:15 am »

Devices have device data, and this is often used to persist device information that needs to remain consistent across reloads.

You can explicitly set a particular devicedata as "Set By Device" so that it can not be edited by a user.

Accessing this device-data depends on:

* Whether you are accessing your own device data (accessors are provided for this), or Whether you are accessing someone else's device data (The General Info Plugin is used for this.)
* Whether you are doing this from a C++ device (using the accessors defined in Gen_Devices for your device), or from a Ruby/GSD device (using the DevData_[xxx] accessors (where xxx is the particular ID of device data you're trying to access.)

-Thom
Logged
derailed
Newbie
*
Posts: 10


View Profile
« Reply #2 on: February 27, 2009, 08:25:37 pm »

Thanks for the info Thom !

So are you saying there is actually no way to talk to the device directly and ask it for its current state/status ?

It would seem that I should be able to perform a MessageSend to that device somehow and ask it which state is it currently in ?


Thanks !!
Logged
tschak909
LinuxMCE God
****
Posts: 5101

DOES work for LinuxMCE.


View Profile
« Reply #3 on: February 27, 2009, 08:55:26 pm »

The device should alter its device data when state changes, it should also emit events.

-Thom
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!