Skip to main content Link Search Menu Expand Document (external link)


Things can be access using the things method and subsequent operations on that methods.

thingsReturn all things as a Ruby Set
[]Get a specific thing by name or ThingUID object
enumerable methodsAll methods here
things.each { |thing|"Thing: #{thing.uid}")}"Thing: #{things['astro:sun:home'].uid}")
homie_things = { |t| t.thing_type_uid == "mqtt:homie300" }
zwave_things = { |t| t.binding_id == "zwave" }
homeseer_dimmers = { |t| == "homeseer_hswd200_00_000" }
things['zwave:device:512:node90'].uid.bridge_ids => ["512"]
things['mqtt:topic:4'].uid.bridge_ids => []

Thing objects

The standard JRuby alternate names and bean convention applies, such that getUID becomes uid.

Actions are available via thing objects. For more details see Actions

Thing status is available through status method, which returns one of the values from ThingStatus. Boolean methods are available based on this.

channelsReturns an array of channels, but also supports indexing by channel name.
unitialized?Returns true if the status is UNINITIALIZED
initializing?Returns true if the status is INITIALIZING
unknown?Returns true if the status is UNKNOWN
online?Returns true if the status is ONLINE
offline?Returns true if the status is OFFLINE
removing?Returns true if the status is REMOVING
removed?Returns true if the status is REMOVED
thing = things['chromecast:audiogroup:dd9f8622-eee-4eaf-b33f-cdcdcdeee001121']"Audiogroup Status: #{thing&.status}")"Audiogroup Online? #{thing&.online?}")"Channel ids: #{}")"Items linked to volume channel: #{thing.channels['volume']&.items&.map(&:name)&.join(', ')}")"Item linked to volume channel: #{thing.channels['volume']&.item&.name}")