Actionable Trait (actn)

Experimental trait for things that trigger actions, such as rules and timers.

AttributeValue
Idtag:google.com,2018:m2m:traits:actionable:v1:v0#r0
Short-Idactn
Has-Childrenno

State Properties

NameKeyRWReqDescription
Counts/actn/cXThe number of times this thing has "fired".
Lasts/actn/lastXThe number of seconds ago that this thing last fired.

s/actn/c : Count

The number of times this thing has "fired".

AttributeValue
Value Typeinteger
FlagsGET, RESET, OBS, VOLATILE

This count may be reset by setting it to zero. The count is not preserved across power cycles.

s/actn/last : Last

The number of seconds ago that this thing last fired.

AttributeValue
Value Typeinteger
FlagsGET, NO_SET, OBS, VOLATILE

This value is not cacheable. Observing it will only indicate when the value is reset to zero.

Config Properties

NameKeyRWReqDescription
Actionsc/actn/actiXXXActions to perform when this automation fires.

c/actn/acti : Actions

Actions to perform when this automation fires.

AttributeValue
Value Typearray containing maps of nullable splot values
FlagsREQ, GET, SET

Each criteria is defined as a map keyed by strings. The string keys are the following:

  • [PARAM_ACTION_PATH]: URL or absolute path to perform an action on
  • [PARAM_ACTION_SKIP]: True if this action should be skipped.
  • [PARAM_ACTION_DESC]: Human-readable description of the action
  • [PARAM_ACTION_METHOD]: The REST method to perform on the path
  • [PARAM_ACTION_BODY]: The body of the action
  • [PARAM_ACTION_SYNC]: If this action should complete before the next action

Metadata Properties

NameKeyRWReqDescription
TraitURIm/actn/turiXXThe URI that uniquely identifies the specification used to implement this trait.

m/actn/turi : TraitURI

The URI that uniquely identifies the specification used to implement this trait.

AttributeValue
Value TypeURI-reference
FlagsCONST, REQ

Associated Constants

NameValueDescription
PARAM_ACTION_PATH"p"Path for action.
PARAM_ACTION_METHOD"m"The REST method to use for the action.
PARAM_ACTION_BODY"b"The body to use for the action.
PARAM_ACTION_CONTENT_FORMAT"ct"The CoAP content-format to use for rendering the body when performing the action.
PARAM_ACTION_SKIP"s"Flag indicating if this action should be skipped. If absent, it is assumed to be false.
PARAM_ACTION_DESC"desc"Human readable description of the action
PARAM_ACTION_SYNC"b"Determines if this action should block execution or not.
SYNC_DO_NOT_WAIT0Value for [PARAM_ACTION_SYNC]: Trigger this action asynchronously.
SYNC_WAIT_TO_FINISH1Value for [PARAM_ACTION_SYNC]: Trigger this action synchronously.
SYNC_STOP_ON_ERROR2Value for [PARAM_ACTION_SYNC]: Trigger this action synchronously, stopping on error.