reachthingsDocs
EN
Dashboard
ObjectsDevice
API reference · Objects

Objects

The three shapes every agent deals with: a Device (what can be done), a Command (what is happening) and its Verification (how sure we are).

On this page

Device

Returned by get_device; list_devices returns the first four fields only.

FieldTypeMeaning
device_idstringOpaque, stable id
aliasstring | nullUser-chosen name
kindstringair_conditioner, smart_plug, light, lock, vehicle, dishwasher, oven, speaker, climate_sensor, …
connection_statusenumonline · offline · unknown
modelstring | nullManufacturer model name when known, e.g. Tapo P115
control_pathenummanufacturer_cloud · plug_cloud · local_helper
capabilities[]Capability[]id, version, kind (read · set · execute · event), input_schema, output_schema, approval, idempotent, preconditions, completion_rule, verification, last_execution, last_verified_at
device_id
Typestring
MeaningOpaque, stable id
alias
Typestring | null
MeaningUser-chosen name
kind
Typestring
Meaningair_conditioner, smart_plug, light, lock, vehicle, dishwasher, oven, speaker, climate_sensor, …
connection_status
Typeenum
Meaningonline · offline · unknown
model
Typestring | null
MeaningManufacturer model name when known, e.g. Tapo P115
control_path
Typeenum
Meaningmanufacturer_cloud · plug_cloud · local_helper
capabilities[]
TypeCapability[]
Meaningid, version, kind (read · set · execute · event), input_schema, output_schema, approval, idempotent, preconditions, completion_rule, verification, last_execution, last_verified_at

Command

Returned by execute_device_action, get_command_status and cancel_command, and embedded in schedule runs.

FieldTypeMeaning
command_idstring | nullnull only on tool errors
statusenumwaiting_approval queued dispatching provider_accepted verifying succeeded rejected failed cancelled expired outcome_unknown
reason_codeenum | nullSet on rejected, failed, cancelled, expired, outcome_unknown. See reason codes
device_id · action · parametersExactly what was stored; the approval page shows these same values
verificationVerificationBelow
approvalobject | nullapproval_id, url, expires_at while waiting
next_actionobjecttype (poll_command_status · open_approval_url · show_result · show_unknown) and a user-safe message
next_poll_after_msinteger | nullSuggested wait before polling
expires_atstringAfter this the command cannot be sent any more
approval_channel · approval_channel_reasonenum · stringHow approval was (or will be) handled
command_id
Typestring | null
Meaningnull only on tool errors
status
Typeenum
Meaningwaiting_approval queued dispatching provider_accepted verifying succeeded rejected failed cancelled expired outcome_unknown
reason_code
Typeenum | null
MeaningSet on rejected, failed, cancelled, expired, outcome_unknown. See reason codes
device_id · action · parameters
Type
MeaningExactly what was stored; the approval page shows these same values
verification
TypeVerification
MeaningBelow
approval
Typeobject | null
Meaningapproval_id, url, expires_at while waiting
next_action
Typeobject
Meaningtype (poll_command_status · open_approval_url · show_result · show_unknown) and a user-safe message
next_poll_after_ms
Typeinteger | null
MeaningSuggested wait before polling
expires_at
Typestring
MeaningAfter this the command cannot be sent any more
approval_channel · approval_channel_reason
Typeenum · string
MeaningHow approval was (or will be) handled

Verification

The evidence behind a status. succeeded is only set when level satisfies required_level; levels are never compared numerically, only by rule.

FieldValuesMeaning
levelnone · provider_ack · provider_completed · state_observedWhat has been confirmed so far
required_levelprovider_completed · state_observedWhat this action needs to count as done
provider_statusunknown · accepted · completed · failedWhat the manufacturer said about the request
target_matchnot_checked · matched · not_matchedWhether the observed attribute equals the requested value
sourcemanufacturer_command · device_state · manufacturer_state · plug_state · nullWhere the evidence came from
observed_at · deadline_atISO time | nullWhen the evidence was observed, and until when the worker keeps checking before outcome_unknown
level
Valuesnone · provider_ack · provider_completed · state_observed
MeaningWhat has been confirmed so far
required_level
Valuesprovider_completed · state_observed
MeaningWhat this action needs to count as done
provider_status
Valuesunknown · accepted · completed · failed
MeaningWhat the manufacturer said about the request
target_match
Valuesnot_checked · matched · not_matched
MeaningWhether the observed attribute equals the requested value
source
Valuesmanufacturer_command · device_state · manufacturer_state · plug_state · null
MeaningWhere the evidence came from
observed_at · deadline_at
ValuesISO time | null
MeaningWhen the evidence was observed, and until when the worker keeps checking before outcome_unknown

Details and examples: Verification levels.