Difference between revisions of "Device Object"

From Hubitat Documentation
Jump to: navigation, search
(Replaced content with " <big>'''We're moving!''' Please visit http://docs2.hubitat.com for the latest documentation.</big> <big> This document is available at: http://docs2.hubitat.com/en/devel...")
(Tag: Replaced)
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The Device object (Technically DeviceWrapper and ChildDeviceWrapper) is composed of methods that allow you to interact with the settings and values of a device.  This object is available to Apps that have been given access via a device selection input, as child devices of Apps and other devices and a driver also has access to this via the device. object.
 
  
==<code>eventsSince</code>==
+
<big>'''We're moving!''' Please visit http://docs2.hubitat.com for the latest documentation.</big>
  
Retrieve a list of events since a date/time.
+
<big>
 
+
This document is available at: http://docs2.hubitat.com/en/developer/device-object
'''Signature:'''
+
</big>
List<Event> eventsSince(Date startDate)
 
List<Event> eventsSince(Date startDate, Map options)
 
 
 
'''Parameters:'''
 
 
 
: startDate - The date/time to list events since.
 
: options - Map with optional settings for the return value, possible value is max which is the maximum number of rows to return, default value is 10.
 
 
 
'''Returns:'''
 
 
 
A list of Events
 
 
 
'''Examples:'''
 
 
 
// Get events since 8:00 am today
 
def events = eventsSince(timeToday("08:00"))
 
 
 
// Get a maximum of 5 events
 
def events = eventsSince(timeToday("08:00"), [max:5])
 
 
 
 
 
==<code>Additional to be documented</code>==
 
List<Event> eventsBetween(Date startDate, Date endDate)
 
List<Event> eventsBetween(Date startDate, Date endDate, Map options = null)
 
List<State> statesSince(String attributeName, Date startDate)
 
List<State> statesSince(String attributeName, Date startDate, Map options = null)
 
List<Event> events()
 
List<Event> events(Map options)
 
void sendEvent(Map properties)
 
void updateSetting(String name, Map options)
 
void updateSetting(String name, Long value)
 
void updateSetting(String name, Boolean value)
 
void updateSetting(String name, String value)
 
void updateSetting(String name, Double value)
 
void updateSetting(String name, Date value)
 
void updateSetting(String name, List value)
 
void removeSetting(String name)
 
void clearSetting(String name)
 
Long getIdAsLong()
 
String getId()
 
String getEndpointId()
 
String getZigbeeId()
 
Hub getHub()
 
Map getData()
 
void updateDataValue(String name, String value)
 
String getDataValue(String name)
 
String getDeviceDataByName(String name)
 
String getStatus()
 
String getName()
 
void setName(String name)
 
String getLabel()
 
void setLabel(String label)
 
String getDisplayName()
 
void setDisplayName(String displayName)
 
String getDeviceNetworkId()
 
void setDeviceNetworkId(String dni)
 
Object currentValue(String attributeName)
 
State currentState(String attributeName)
 
Object latestValue(String attributeName)
 
State latestState(String attributeName)
 
List<State> getCurrentStates()
 
List<Command> getSupportedCommands()
 
List<Attribute> getSupportedAttributes()
 
List<Capability> getCapabilities()
 
Boolean hasCommand(String command)
 
Boolean hasAttribute(String attribute)
 
Boolean hasCapability(String capability)
 
Date getLastActivity()
 
Long getParentDeviceId()
 
Long getParentAppId()
 
Boolean getIsComponent()
 
boolean isDisabled()
 

Latest revision as of 04:02, 25 September 2022

We're moving! Please visit http://docs2.hubitat.com for the latest documentation.

This document is available at: http://docs2.hubitat.com/en/developer/device-object