Create device using analysis

Hi.

Is it possible to create a device using TagoCore analysis? Even though I have @tago-io/sdk installed on TagoCore, I am unable to use its resources because I cannot generate an account token on TagoCore. How to overcome this problem? Any help is appreciated.

Best regards, Nemanja

Hi Nemanja,

The access system is different when using Tagocore.

Firstly, you’ll need to use the SDK for TagoCore: @tago-io/tcore-sdk instead @tago-io/sdk.

See @tago-io/tcore-sdk full documentation here.

You don’t need a token to access devices in the TagoCore, you need to give access to your plugin/application in the manifest file, see details here.

See a code example:

import { core } from "@tago-io/tcore-sdk";async function getDeviceInfo(device_id) {const deviceInfo = await core.getDeviceInfo(device_id);return deviceInfo;}

Hi Fabiano,

Thanks for the answer.

I managed to run an external script through the plugin, which, as in the example provided, retrieves information about a specific device.

However, I don’t see the connection between the plugin and the TagoCore analysis, if there is one?

Let’s say I have the following scenario: Upon receiving a certain value in one device’s bucket, an action should trigger an analysis that will create another device. Is it possible to implement the described process using the plugin, and if so, how? Is there another way to solve this problem?