Hi @GuidoL
You can use the Azure IoT Central for creating a DTDL model of the Rfid Kiosk device and then export it.
Thanks
Roman
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
i'm not sure if i'm following a corret strategy to implement an actutator for my project: this is not very clear in Microsoft documentation:
i defined the following model to command a device (starting from library rfid ontology i defined..)
[
{
"@id": "dtmi:digitaltwins:org:archive:download:rfidsmartlibrary:RfidSmartLibraryowl:RfidTagAlarmCodeOnOffKioskActuator;1",
"@type": "Command",
"contents": [
{
"request": {
"@type": "CommandPayload",
"name": "RequestParam",
"displayName": {
"en": "RequestParam"
},
"schema": {
"@type": "Object",
"fields": [
{
"displayName": {
"en": "CommandAutoReadWriteData"
},
"name": "CommandAutoReadWriteData",
"dtmi:dtdl:property:schema;2": {
"@type": "Enum",
"enumValues": [
{
"enumValue": "AUTO_READ_DATA",
"name": "AUTO_READ_DATA"
},
{
"enumValue": "AUTO_WRITE_DATA",
"name": "AUTO_WRITE_DATA"
}
],
"valueSchema": "string"
}
},
{
"displayName": {
"en": "CmdDeactivateAntenna"
},
"name": "CmdDeactivateAntenna",
"dtmi:dtdl:property:schema;2": {
"@type": "Enum",
"enumValues": [
{
"enumValue": "OFF",
"name": "OFF"
},
{
"enumValue": "On",
"name": "On"
}
],
"valueSchema": "string"
}
},
{
"displayName": {
"en": "CmdStart"
},
"name": "CmdStart",
"dtmi:dtdl:property:schema;2": {
"@type": "Enum",
"enumValues": [
{
"enumValue": "OFF",
"name": "OFF"
},
{
"enumValue": "On",
"name": "On"
}
],
"valueSchema": "string"
}
},
{
"displayName": {
"en": "TagAFICheckActivated"
},
"name": "TagAFICheckActivated",
"dtmi:dtdl:property:schema;2": {
"@type": "Enum",
"enumValues": [
{
"enumValue": "OFF",
"name": "OFF"
},
{
"enumValue": "On",
"name": "On"
}
],
"valueSchema": "string"
}
}
]
}
},
"response": {
"@type": "CommandPayload",
"name": "ResponseParam",
"displayName": {
"en": "ResponseParam"
},
"schema": {
"@type": "Object",
"fields": [
{
"displayName": {
"en": "CommandAutoReadWriteData"
},
"name": "CommandAutoReadWriteData",
"dtmi:dtdl:property:schema;2": {
"@type": "Enum",
"enumValues": [
{
"enumValue": "AUTO_READ_DATA",
"name": "AUTO_READ_DATA"
},
{
"enumValue": "AUTO_WRITE_DATA",
"name": "AUTO_WRITE_DATA"
}
],
"valueSchema": "string"
}
},
{
"displayName": {
"en": "CmdDeactivateAntenna"
},
"name": "CmdDeactivateAntenna",
"dtmi:dtdl:property:schema;2": {
"@type": "Enum",
"enumValues": [
{
"enumValue": "OFF",
"name": "OFF"
},
{
"enumValue": "On",
"name": "On"
}
],
"valueSchema": "string"
}
},
{
"displayName": {
"en": "CmdStart"
},
"name": "CmdStart",
"dtmi:dtdl:property:schema;2": {
"@type": "Enum",
"enumValues": [
{
"enumValue": "OFF",
"name": "OFF"
},
{
"enumValue": "On",
"name": "On"
}
],
"valueSchema": "string"
}
},
{
"displayName": {
"en": "TagAFICheckActivated"
},
"name": "TagAFICheckActivated",
"dtmi:dtdl:property:schema;2": {
"@type": "Enum",
"enumValues": [
{
"enumValue": "OFF",
"name": "OFF"
},
{
"enumValue": "On",
"name": "On"
}
],
"valueSchema": "string"
}
}
]
}
}
}
],
"@context": [
"dtmi:iotcentral:context;2",
"dtmi:dtdl:context;2"
],
"description": {
"en": "Rfid Tag Alarm Code On/Off Kiosk Actuator"
},
"displayName": {
"en": "Rfid Tag Alarm Code On/Off Kiosk Actuator"
},
"extends": "dtmi:digitaltwins:org:w3id:rec:core:OnOffActuator;1"
}
]
so if i try to import it in ADT Model i receive the following output:
*** Uploading selected models
- working on RfidTagAlarmCodeOnOffKioskActuator.json
but i can't find the model after import also there aren't no errors; i don't know if it's correct define an actuator in this way to command my library Rfid Kiosk device.
In case i'm wrong can you suggest a correct way to simulate command to my twins of library rfid device (in this case i need to command a self server kiosk that disables/enbles rfid alarm code if library item have correct borrow/return procedure)? An example of using actuator with Azure Iot Central for my goal is welcome.
Thanks in advance.
Guido
Hi @GuidoL
You can use the Azure IoT Central for creating a DTDL model of the Rfid Kiosk device and then export it.
Thanks
Roman
Hi @GuidoL Greetings! Thank you for posting the question here. To be able to better assist you with the designing the model template, could you please share more details on the functioning of your actuator, different properties/telemetry data it may transmit. Apologies if those does not apply to the actuator model you are trying to implement. My knowledge on the device is limited.
Inspecting the model, you have shared, it implies that the model has a request command which takes in a schema of type object as payload and a response command. The model does not have any telemetry or properties. Does this seem accurate to what you are trying to accomplish?
Looking at the model templates provided in the samples of the GitHub, I would say the template type should be interface
and the "type@" : "Command"
should be embedded within the contents
section of the interface. Kindly refer to the template of TemperatureController-2.json as the sample provides an example of Command
with a CommandPayload
.
Let us know if the above information is helpful and please reach out with further questions in the comments below.