Skip to contents

Lightweight read-only companion to tb_setup_devices: when you only need a device's internal UUID (e.g. to call the telemetry-delete endpoint), this returns it directly without touching the access token or creating the device on the side. Returns NA_character_ when the device does not exist.

Usage

tb_get_device_id(
  device_name,
  api_key = Sys.getenv("TB_API_KEY"),
  host = Sys.getenv("TB_HOST", unset = "https://thingsboard.cloud")
)

Arguments

device_name

device name as shown in the ThingsBoard UI.

api_key

account-level API key. Defaults to env var TB_API_KEY.

host

base URL of the ThingsBoard instance. Defaults to env var TB_HOST if set, otherwise "https://thingsboard.cloud".

Value

device UUID (character) or NA_character_ if the lookup did not resolve.

Examples

if (FALSE) { # \dontrun{
tb_get_device_id("wasserportal-gw-6038")
} # }