truetruetruetruefalse{PollingInterval}{Expires}{Expires}PT1SF.Value.NameF.Value is Waher.Things.SensorData.QuantityField ? F.Value.PersistableQuantity : F.Value.Valuefalsetrueex.MessagePollPolls the sensor.A request has been made to poll the sensor.
]]>
Reconfigure...Reconfigure digital sensor twin.The digital sensor twin has been successfully reconfigured.Polling Interval
]]>
PausePauses sensor-data readout.
]]>
ResumeResumes sensor-data readout.
]]>
Terminate Digital Twin...Terminates digital sensor twin.Are you sure you want to terminate the digital sensor twin? This action cannot be undone.A request has been made to terminate the digital sensor twin.
]]>
";
if !empty(Row) then s+="`"+Row+"`"
);
s
))` |
[[
)}}
Configuration
----------------
The following sensor configuration has been used to access the sensor data:
| Parameter | Value |
|:-------------|:------------------|
| Node ID | `{{NodeID}}` |
| Source ID | `{{SourceID}}` |
| Partition ID | `{{PartitionID}}` |
| JID | `{{JID}}` |
The following types of sensor data are read:
| Type | Included |
|:-----------------|:---------------:|
| Momentary Values | `{{Momentary}}` |
| Identity Values | `{{Identity}}` |
| Status Values | `{{Status}}` |
| Computed Values | `{{Computed}}` |
| Peak Values | `{{Peak}}` |
The sensor data is polled at least every {{
Append(s,s2):=empty(s)?s2:s+", "+s2;
Append(s,N,UnitSing,UnitPlur):=N=0?s:N=1?Append(s,Str(N)+" "+UnitSing):Append(s,Str(N)+" "+UnitPlur);
DurationToStr(D):=
(
s:="";
s:=Append(s,Years(D),"year","years");
s:=Append(s,Months(D),"month","months");
s:=Append(s,Days(D),"day","days");
s:=Append(s,Hours(D),"hour","hours");
s:=Append(s,Minutes(D),"minute","minutes");
s:=Append(s,Seconds(D),"second","seconds");
s
);
DurationToStr(PollingInterval)
}}, until it is manually terminated, or until {{Years(Expires)}}-{{Months(Expires)}}-{{Days(Expires)}},
whichever comes first.
{{if Error then ]]
Error
--------
There's currently an error reported when trying to read the sensor. The following error has been reported:
((ErrorMessage))
[[ else ]]
OK
----
There's currently no error reported.
[[}}
{{Attachments:=LoadAttachments([
"text/markdown",
"text/plain",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"image/*"]);
if count(Attachments)>0 then
(
]]Attached Information
----------------------------
[[;
foreach Attachment in Attachments do
(
if Attachment is Waher.Content.Markdown.MarkdownDocument then
(
]]
((Attachment.GenerateMarkdown() ))
[[
)
else if Attachment is System.String then
(
]]
((MarkdownEncode(Attachment) ))
[[
)
else if exists(DocumentFormat.OpenXml.Packaging.WordprocessingDocument) and Attachment is DocumentFormat.OpenXml.Packaging.WordprocessingDocument then
(
]]
((WordToMarkdown(Attachment) ))
[[
)
else if exists(DocumentFormat.OpenXml.Packaging.SpreadsheetDocument) and Attachment is DocumentFormat.OpenXml.Packaging.SpreadsheetDocument then
(
Sheets:=eval(ExcelToScript(Attachment));
foreach Page in Sheets.Keys do
(
Sheet:=Sheets[Page];
]]
### ((MarkdownEncode(Sheet.Name) ))
((Sheet.Data))
[[
)
)
else
(
]]
((Attachment))
[[
)
)
)
}}
]]>
ByCat.MaxCount then ByCat.MaxCount:=c;
)
)
)
);
Colors:=["Green","Blue","Red","Yellow","Cyan","Magenta"];
NrColors:=count(Colors);
foreach Category in ByCategory.Keys do
(
CatRec:=ByCategory[Category];
if CatRec.MaxCount>=2 then
(
]]### ((Category))
[[;
try
(
G:=null;
NameByIndex:={};
foreach Name in CatRec.ByName.Keys do
(
NameRec:=CatRec.ByName[Name];
Color:=Alpha(Colors[NameRec.Index MOD NrColors],255-32*Floor(NameRec.Index / NrColors));
NameByIndex[Str(NameRec.Index)]:={"Name":Name,"Index":NameRec.Index,"Color":Color};
G2:=plot2dline(NameRec.Timestamps,NameRec.Samples,Color);
if exists(G) then G+=G2 else G:=G2;
);
G.Title:=Category;
]]```graph
((G.ToXml() ))
[[;
]]```
[[;
if count(CatRec.ByName)>1 then
(
]]```layout
[[;
foreach Index in NameByIndex.Keys do
(
Info:=NameByIndex[Index];
]]
[[
);
]]
[[;
foreach Index in NameByIndex.Keys do
(
Info:=NameByIndex[Index];
]]
[[
);
]]
[[;
]]```
[[
)
)
catch
(
]]((Exception.Message))
[[
)
)
)
}}
]]>
Digital Sensor TwinExampleToken representing a digital twin of a sensor. The sensor is polled using a regular interval. The twin also
subscribes to momentary values of the sensor, if possible and supported, to receive real-time events when sensor data
changes. Latest sensor data is presented in the present report. Historical sensor-data is available in the history
report.iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAABFFJREFUeJztWU1IMlsYfrqTFmgLIb5yEURlLQo3YVZUCi1qFUFQUKt2QURWm7IgIkhqJ9IP1EIIWkWuIugPLIh0GVFUBC5SocCkEM2/uYvv3oPDNNM43Thwv3lgYM77d57zeI7nzEwBy7Is/mD8RZsAbSgC0CZAG4oAtAnQhiIAbQK0oQhAmwBtKALQJkAbigC0CdCGIgBtArShCECbAG0oAtAmQBuKALQJ0EahkCMYDGJpaQklJSV5F43H4+jr60NHRwfPNz8/j3g8jmw2i5qaGoyMjORdHwBSqRScTicODg5wfX2N19dXqNVqVFRUoLGxET09Pejv7/+6ECsAn8/HApB9LS4u8mo+PT3x4vJFJpNh29vbJfPY2dkRrSe4BL77uSCTyfBs4+PjPNvCwoLkmqenp2AYBufn55JzHh8fRf0FQh9G3t7ecHx8jOLiYo69tLQUZrOZtLe3t/Hr1y+k02liSyaTMBqNqKqq4nZWUAAA0Gg0iMVixC5FbK/XC6vVyrE1Nzdjbm4O3d3dYBiG2O/v77G7u4vZ2VlMT0/D4XAIF857Dv5mS65oNCopx+FwkBy73c5arVbS3t/fz6tPAOzt7a2kfgOBgHhdSVVEyITD4bxzYrEYe3R0RNoGg0E0d2BggJOfTCbl0P6cl6ykPAXIHWx1dfWndV5eXiT153K55FAWri0rKU8BGhoaSLzH4yF2u91O7ENDQ5/mer3eb+0aX+HHBYhGo6ID+GpwKysrxF9fXy+Hrih+/CRos9nI/dTUFM+fe1hyOp08fygUIvcGg0Fyv3V1dWhtbYXJZBIPlKMa8pgBubHpdJrn9/v9xM8wDM9vs9mIv7e3VxZHMfzoDFhdXSX3FouFs1f/C5PJBI1GA+D34eni4oLjLysrI/eBQOA/5yh4EBJN+udAAwDhcBjl5eWfxhUVFSGZTAIAlpeX0dbWhkQiwYnRarXY2trC5uYmAKCpqQk+n4/4Dw8P0dXVRdpS6eZyFM2RPKcEppfQEri8vJT9HPHx8SHY397eXt4cReOkDVm4uJAALS0tsgUYHR3l1LJYLHlvhVLjf2QJpNNpqFQq0na73UilUoJTkWEYPD8/Y2ZmhthyY6PRKHQ6HWmr1WrEYjEUFgo+zdNdAmNjY8RvNpsl19VqtSTP7XZzfGtra7yZMjg4yPr9fl4dj8dDdwnk+s/OziTXXV9fJ3k6nY7ndzqdspaU6Fgks8tNyikeDAY5PpfL9a2ja27uZ79uKBRia2trJQ++srJStD/hRSSCiYkJqFQqvL+/816ZJRIJTE5OIpvNcrYvqXC73bi6ukI2m8XDwwPvJKfX63F3d4dIJIKNjQ2cnJzg5uYGkUgEDMNAr9fDaDSis7MTw8PD5IwhBFl/gv8n/PFvhRUBaBOgDUUA2gRoQxGANgHaUASgTYA2FAFoE6ANRQDaBGhDEYA2AdpQBKBNgDYUAWgToA1FANoEaONve9o8PVvYS2AAAAAASUVORK5CYII=The part that creates the Digital Sensor Twin token and the corresponding state-machine that protects the sensor data.The owner of the token, and person that can view the data collected by the Digital Sensor Twin.The part that acts as a host of the token and approves its creation.The ID of the node, that implements the live connection with the underlying sensor.Optional ID of source hosting the node that implements the live connection with the underlying sensor.Optional ID of the partition of the source hosting the node that implements the live connection with the underlying sensor.Optional JID of remote entity that hosts the node that implements the live connection with the underlying sensor.If momentary values are to be read.If identity values are to be read.If status values are to be read.If computed values are to be read.If peak values are to be read.Interval with which to poll the sensor for data.The initial value of the token.The currency of the token.The commission the Trust Provider gets for creating the token and managing the calculator.When token expires.Digital Sensor TwinThis contract creates a token representing a digital sensor twin of a live sensor.SensorThe digital twin relies on data from a live sensor, integrated to the Neuron® itself, or available via a remote host (a concentrator). A sensor is addressed using up to four (4) parameters: A Node ID, a Source ID, a Partition ID and a JID. The only parameter that is required, is the Node ID. If a sensor is hosted by a remote entity, a JID (Jabber ID, or XMPP address) of the host must be provided. If the JID parameter is empty, the sensor integration has to be made on the Neuron® itself. If the node is available via a specific source, a Source ID has to be provided. A host can host nodes in multiple sources. Some hosts may host some sources that are huge, and therefore partitioned into multiple partitions. If this is the case, a Partition ID must also be provided.Connection parametersFor the current node, the following live connection parameters are available:Node ID: Source ID: Partition ID: JID: ConnectivityIf connectivity to the live sensor is lost, or integration removed, access to live sensor data will also be affected. The digital twin token can only log sensor data as long as the connectivity to the device is maintained.ProvisioningSome devices are provisioned, and only provide sensor-data to authorized individuals. In such cases, the Owner of the token must be authorized read-access to the sensor data the digital twin wants to access. If the owner of the digital twin token is not authorized access, the digital twin token will not be able to log sensor data accordingly.OperationThe operation of the token is divided into three categories: Implicit, Notes and Lifecycle, each described in the following subsections.Implicit operationOnce the state machine belonging to the token is in an Active state, it starts to poll the sensor regularly, using the defined interval (). This polling is suspended if the state machine goes into the Puased state, but is resumed again, if set into the Active state again. This repreated polling continues until the token expires (), or the token is manually terminated or destroyed.Operation via NotesThe owner can add XML notes to the token, and thus control its operation. The following notes can be added (all empty XML elements with the indicated local name using the namespace https://lab.tagroot.io/Downloads/DigitalSensorTwin.xsd).The Owner of the token can temporarily pause the operation by adding a Pause XML note on the token.Resuming operation is done by adding a Resume XML note on the token.The Owner can also terminate the operation by adding a Terminate XML note on the token.The token refularly polls the sensor using the predefined interval (). The owner can request an extra-ordinarly polling of the sensor by adding a Poll XML Note.All notes logged on the token are kept in the ledger and viewed in the token event log.Lifecycle of tokenThe token expires at , or if the owner adds a Terminate XML note on the token. Both the Owner as well as the Creator are also authorized to destroy the token explicitly.ValueThe initial value of the digital sensor twin token is set to , and is defined by the Creator in conjunction with the Owner. From this value, a commission is paid to the Trust Provider of %.