List for Device variables/status

Where can I find list of device variables to use in WeCore or Rules Machine? %Var%. Example code from open was %What%. Or Name of person associated with %whatCodesName%?

Tony Mast

Long story short...those aren't available readily, but you can make them. There's a few global variables available to RM like %device%, %value%, %text%, %time%, and %date%. Anything else would need to be set to a local variable that could then be elsewhere in the rule or a hub variable to be used in other rules.

1 Like

Rule Machine will show the list if you set up a Send Notification action (which is where you would ordinarily use them).

Use %device% to include event device name, %value% to include event value, %text% to include event description text, %time% to include event time, %date% to include event date, %now% for current time. To include a variable value use %variable-name%.

1 Like

1 Like

Rule Machine also has a few "built-in" variables local to each rule that refer to the last device event, usually the most recent trigger event (except as below, or if the trigger was not a device — a schedule, a hub/location event, manually running rule actions or running from another rule, etc., in which case these variables are not guaranteed to have a speciifc value). These can be referred to in string inputs using:

  • %device%: name of the device that generated the event (or "timeout" after a "Wait..." action if a timeout is specified on a wait and the next action is reached because the timeout expires)
  • %value%: the value of the event (e.g., could be "off" for a switch)
  • %text%: the descriptionText property for the event (as provided by the driver, often in a format resembling "Living Room switch is off")
  • %date%: the date the event was generated
  • %time%: the time the event was generated
  • %now%: the current time (this value is always available and not related to any specific trigger or event)
1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.