AWS IoT TwinMaker Tutorial | Digital Twins Introduction & Demo

Architecture Bytes
8 Oct 202324:36

Summary

TLDRThis tutorial demonstrates setting up AWS IoT Twin Maker for visualizing motor data in a factory. It guides through creating a motor model in SiteWise, generating and sending data with a Python script, and visualizing it in Twin Maker and Grafana. The process includes defining attributes, creating assets, setting up workspaces, and configuring data sources, culminating in a real-time 3D visual representation of motor status with color-coded speed indicators.

Takeaways

  • 🏭 The tutorial is focused on creating a visual representation of motor data in a factory setting using AWS IoT Twin Maker.
  • πŸ“ˆ The primary data of interest for the motors is their speed, which is measured in RPM (Revolutions Per Minute).
  • πŸ“ AWS IoT SiteWise is used to receive and manage the motor data, with a digital twin created in Twin Maker for visualization.
  • πŸ”§ The process begins by creating a 'Motor Model' in SiteWise, defining attributes such as serial number and measurements like speed.
  • πŸ“ An 'Asset' is then created in SiteWise using the defined 'Motor Model', with properties like asset name and measurement aliases.
  • πŸ”„ Data is sent to the asset using a Python script, simulating motor data transmission in a real-world scenario.
  • πŸ› οΈ Twin Maker requires the setup of a workspace, including an S3 bucket for storage, roles, and policies for proper access and execution.
  • 🌐 The Twin Maker workspace integrates with AWS IoT SiteWise to fetch and visualize the motor's data.
  • πŸ“Š Grafana is used for dashboard management, allowing for real-time monitoring and historical data visualization.
  • 🎨 A 3D model of the motor is added to Twin Maker to create a visual scene, with annotations and shaders to represent data.
  • πŸ“ Rules are created in Twin Maker to change the visual representation (e.g., color) of the motor based on its operational parameters, such as speed thresholds.

Q & A

  • What is the main purpose of the AWS IoT Twin Maker tutorial?

    -The main purpose of the AWS IoT Twin Maker tutorial is to demonstrate how to create a visual representation of current and historical status of motors in a factory, specifically focusing on their speed, using AWS IoT Twin Maker and Grafana for visualization.

  • What does the production supervisor want to achieve with AWS IoT Twin Maker?

    -The production supervisor wants to see a visual representation of the current and historical status of the motors on the production floor, particularly their speed, to better monitor and manage the production process.

  • What is the first step in creating a motor model in AWS IoT SiteWise?

    -The first step in creating a motor model in AWS IoT SiteWise is to navigate to the 'Models' section and click 'Create model', providing a model name such as 'Motor Model' and defining attributes and measurements like 'Serial Number' and 'Speed' with appropriate units and data types.

  • How is the motor data sent to AWS IoT SiteWise in the tutorial?

    -In the tutorial, a Python script named 'send_data.py' is used to generate and send motor data to AWS IoT SiteWise. The script sends randomly generated speed values with timestamps at 1-second intervals.

  • What is the role of a property alias in AWS IoT SiteWise?

    -A property alias in AWS IoT SiteWise is used to associate a measurement with a specific asset. In the tutorial, a property alias 'SL_Factory_SL_Motor_One/speed' is created to send data to the 'Motor One' asset.

  • What is the purpose of creating a workspace in AWS IoT Twin Maker?

    -Creating a workspace in AWS IoT Twin Maker is necessary to organize and manage the digital twin components, entities, and scenes. It also involves setting up an S3 bucket for data storage and defining roles and policies for permissions.

  • Why is an S3 bucket needed when creating a workspace in Twin Maker?

    -An S3 bucket is needed to store the data and assets related to the Twin Maker workspace, ensuring that the 3D models, annotations, and other resources are saved and accessible for the visualization.

  • How is the 3D model of the motor added to the Twin Maker scene?

    -The 3D model of the motor is added to the Twin Maker scene by selecting 'Add 3D Model' from the scene interface, choosing the motor model file from the resource library, and placing it within the scene environment.

  • What is the significance of the 'Factory Rule' created in the Twin Maker scene?

    -The 'Factory Rule' is significant as it defines the conditions under which the visual representation of the motor changes color based on its speed. For example, if the speed is greater than 400 RPM, the motor section turns red, and if it is less than or equal to 400 RPM, it turns green.

  • How is Grafana used in conjunction with AWS IoT Twin Maker?

    -Grafana is used as a visualization tool to create dashboards that display the Twin Maker scene and time series data of the motor's speed. It connects to the Twin Maker data source and allows users to monitor the motor's performance in real-time.

  • What is the final outcome of the AWS IoT Twin Maker tutorial?

    -The final outcome of the tutorial is a functional Twin Maker workspace with a 3D model of a motor, annotations for speed display, and a scene that updates based on motor speed. Additionally, a Grafana dashboard is set up to visualize the motor's speed data in real-time.

Outlines

00:00

πŸ“š AWS IoT Twin Maker Tutorial Setup

This paragraph introduces a tutorial on setting up AWS IoT Twin Maker for a factory motor monitoring use case. It explains the creation of a motor model in AWS IoT Sitewise, including attributes and measurements like speed in RPM. The tutorial proceeds with the setup of an asset named 'Motor One' and the configuration of data streaming to AWS Sitewise using a Python script. The script simulates motor data being sent to the cloud at one-second intervals.

05:02

πŸ›  Configuring AWS IoT Twin Maker Workspace

The second paragraph details the process of creating a workspace in AWS IoT Twin Maker, which includes setting up an S3 bucket named 'factory WS bucket' and defining necessary roles and policies for Twin Maker, Sitewise, and S3 access. A policy named 'Factory policy' is created for permissive permissions, and a role 'Factory role' is established for service access. The workspace creation involves selecting Amazon managed Grafana for dashboard management and associating it with the previously created role.

10:04

🏭 Building the Twin Maker Visual Representation

This section describes the creation of entities and components within the Twin Maker workspace. It involves adding a motor entity and a component that connects to the IoT Sitewise data. The paragraph also covers testing the component to ensure data connectivity and the addition of a 3D model of the motor as a resource. Furthermore, it explains the creation of a scene called 'factory scene' and the integration of the 3D model into the scene, including scaling and annotations for displaying motor speed.

15:06

🎨 Customizing Visual Alerts with Rules and Shaders

The fourth paragraph focuses on customizing the visual representation by adding rules and shaders to the Twin Maker scene. It explains creating a 'motor rule' that changes the color of a motor section based on speed thresholdsβ€”red for speeds greater than 400 RPM and green for speeds 400 or below. The paragraph also details the process of applying a model shader to the 3D model to reflect these rules visually.

20:10

πŸ“Š Integrating Grafana for Real-time Data Visualization

The final paragraph outlines the integration of Grafana for real-time data visualization. It covers creating a 'factory workspace, Grafana' and setting up a user named 'Joe' with access to this workspace. The tutorial continues with configuring a data source in Grafana to connect with AWS IoT Twin Maker, and creating a dashboard with panels for visualizing the Twin Maker scene and a time series graph of motor speed data. The dashboard updates in real-time as motor data is sent from the Python script, reflecting the color changes on the 3D model based on speed.

Mindmap

Keywords

πŸ’‘AWS IoT Twin Maker

AWS IoT Twin Maker is a service that allows users to create digital twins of physical assets for monitoring and management purposes. In the context of the video, it is used to create a digital representation of a motor on a factory production floor, providing a visual and data-driven interface for production supervisors to monitor the motor's status. The script describes the process of setting up Twin Maker with a workspace, entities, components, and integrating it with AWS IoT SiteWise and Grafana for visualization.

πŸ’‘AWS CloudSiteWise

AWS IoT SiteWise is a service that collects, stores, and organizes industrial data from various sources. It is integral to the video's tutorial as it receives motor data and serves as the data source for the digital twin created in Twin Maker. The script mentions creating a model and asset in SiteWise, which are then used to send and visualize the motor's data.

πŸ’‘Digital Twin

A digital twin is a virtual representation of a physical object or system. In the video, the digital twin is created in Twin Maker to mirror the real-world motor's operational data, such as speed and historical performance. The script details the creation of a 'motor model' and 'motor one asset' as part of setting up the digital twin.

πŸ’‘Grafana

Grafana is an open-source platform for time-series analytics and visualization. In the video, it is used to create a dashboard that displays the motor's data in real-time, providing a visual representation of the motor's status as monitored by the digital twin in Twin Maker. The script outlines the process of setting up a Grafana workspace and integrating it with Twin Maker.

πŸ’‘Asset Model

In the context of AWS IoT SiteWise and Twin Maker, an asset model defines the data structure and properties for a type of asset, such as a motor. The script describes creating a 'motor model' with attributes and measurements like 'speed' and 'serial number' that are used to structure the data sent from the motor.

πŸ’‘Measurement

A measurement in the script refers to a specific data point that is associated with an asset, such as the speed of the motor. It is defined during the creation of the asset model in SiteWise and is crucial for capturing and visualizing the operational data of the motor.

πŸ’‘Property Alias

A property alias in SiteWise is a unique identifier used to send data to a specific asset. In the script, a property alias is created for the motor's speed measurement, which allows data to be accurately routed and associated with the correct asset within the system.

πŸ’‘3D Model

A 3D model in the script represents the physical motor in the digital space within Twin Maker. It is used to create a visual scene that corresponds with the motor's operational data, allowing for a more intuitive understanding of the motor's status. The script describes adding a 3D model of the motor to the Twin Maker scene.

πŸ’‘Scene

In Twin Maker, a scene is a virtual environment where digital twins and their associated data are displayed. The script describes creating a 'factory scene' that includes the 3D model of the motor and visual indicators for the motor's status based on its speed.

πŸ’‘Annotation

Annotations in the script are used within the Twin Maker scene to display specific data points, such as the current speed of the motor. They provide a way to overlay data directly onto the 3D model, enhancing the visual representation and understanding of the motor's status.

πŸ’‘Model Shader

A model shader in the script is a component that changes the visual appearance of a 3D model based on certain conditions or data values. It is used to make parts of the motor's 3D model turn green or red depending on the motor's speed, providing a visual indicator of the motor's performance.

πŸ’‘Rule

Rules in Twin Maker define conditions under which certain actions or visual changes occur, such as changing the color of a model based on its speed. The script describes creating a 'motor rule' that triggers the model shader to change the color of the motor's 3D model in the scene.

Highlights

Introduction of AWS IoT Twin Maker for creating a digital twin of a motor in a factory setting.

Use case scenario where production supervisors require a visual representation of motor status.

Architecture overview involving AWS Cloud, Sitewise, Twin Maker, and Grafana for visualization.

Step-by-step guide on creating a motor model in Sitewise with attributes and measurements.

Asset creation in Sitewise using the predefined motor model.

Adding property aliases to measurements for data streaming to AWS Sitewise.

Utilization of a Python script to simulate motor data generation and transmission to Sitewise.

Data verification in the AWS console to ensure motor data is being received.

Workspace creation in Twin Maker with associated S3 bucket and necessary roles and policies.

Entity creation in Twin Maker representing the physical motor with a component.

Component testing in Twin Maker to validate data source connectivity.

Inclusion of a 3D model of the motor as a resource in Twin Maker.

Scene creation in Twin Maker to visualize motor data with a 3D model.

Annotation addition to the scene for displaying current motor speed.

Rule creation for conditional color changes based on motor speed thresholds.

Integration of model shader for visual representation of motor speed conditions.

Grafana workspace setup for dashboard creation and data visualization.

Configuration of a data source in Grafana to connect with Twin Maker.

Dashboard creation in Grafana with panels for real-time and historical motor speed data.

Real-time data visualization demonstrating motor speed with color-coded conditions.

Tutorial conclusion summarizing the setup and functionality of AWS IoT Twin Maker.

Transcripts

play00:00

AWS iot twin maker

play00:04

tutorial our use case is we have a

play00:07

factory where there are Motors running

play00:09

on the production floor production

play00:11

supervisors want to see a visual

play00:13

representation of current and historical

play00:16

status of these motors specifically

play00:18

their

play00:21

speed and this is what our overall

play00:24

architecture would look

play00:28

like for the purpose of tutorial we will

play00:31

use one motor on AWS Cloud sitewise will

play00:34

receive motor data digital twin is

play00:37

created in Twin maker and visualized via

play00:41

grafana let's begin by creating a motor

play00:44

model in

play00:48

sitewise in AWS console under AWS iot

play00:51

sitewise section select

play00:54

models and here hit create model provide

play00:58

a model name

play01:00

we will call that motor

play01:04

model add an

play01:08

attribute a name for that serial

play01:12

number next we will add a

play01:16

measurement so that will be

play01:20

speed and uh unit as RPM and data type

play01:24

as

play01:27

double

play01:28

now create

play01:31

model we need to provide a default value

play01:34

for the attribute so let's just call it

play01:39

default hit that create

play01:42

model and here we have a new Moto model

play01:47

right so there you can see the attribute

play01:50

and measurement

play01:57

definitions next we will create an asset

play02:00

in sitewise using the model we just

play02:03

created select the asset submenu and

play02:06

then hit create

play02:08

asset and uh choose the model we just

play02:11

created which is the motor model and

play02:13

provide an asset name right so this is

play02:16

motor

play02:17

one okay and then hit create

play02:21

asset so that's our motor one

play02:27

asset now we will add an allies to the

play02:31

measurement so for that hit edit

play02:34

asset come down to the measurement

play02:37

section and add a property allias of the

play02:41

form SL

play02:43

Factory SL motor one/ speed make sure

play02:47

that mqd notification status is

play02:50

active hit save now Lis is where we send

play02:55

data to right so when we want to send

play02:57

data to an asset

play03:00

we use the property

play03:02

allias okay so now we are done with the

play03:06

asset

play03:11

Creation in real world the motor would

play03:13

send its data to AWS sitewise on the

play03:16

cloud via an iot or Greengrass device in

play03:19

the factory for our tutorial we will use

play03:22

a python script to generate and send

play03:24

motor data to

play03:26

sitewise hit the cloud shell icon in AWS

play03:29

console

play03:30

this will open uh Linux prompt and here

play03:33

I have already uploaded a send data. py

play03:36

python script let's take a quick look at

play03:39

that so this will send uh randomly

play03:42

generated speed along with timestamp to

play03:45

sitewise at the top you can see the l/f

play03:49

factory SL motor one/

play03:57

speeed now uh let's let's run that file

play04:01

so python send dat.

play04:06

py and it should send data with 1 second

play04:11

intervals right so there you can see uh

play04:13

double value on the right hand side

play04:15

that's the speed that is being sent so

play04:17

let's come to AWS console asset section

play04:20

in sitewise and under

play04:23

measurements against speed we can see

play04:26

the latest

play04:28

value right

play04:39

let's focus on Twin Maker Now we will

play04:41

start by creating a workspace while

play04:43

doing that we will also create S3 bucket

play04:47

roles and policies we

play04:49

need we are in AWS iot twin maker

play04:52

section hit create

play04:54

workspace we'll provide a name for the

play04:57

workspace Factory workspace and and we

play04:59

need to associate an S3 bucket with that

play05:01

so let's create an S3

play05:04

bucket okay provide a bucket name we'll

play05:08

call

play05:09

that factory WS

play05:14

bucket and uh leave everything else as

play05:17

default hit create

play05:20

bucket all right now go back to our

play05:23

workspace creation and U associate this

play05:27

S3

play05:28

bucket

play05:31

all right so that is Factory WS

play05:36

bucket and for the execution role we

play05:39

will go to the AWS section first we'll

play05:42

create a

play05:43

policy okay let's hit create

play05:47

policy and uh choose Json and paste this

play05:53

Json where we provide permissions for

play05:56

twin maker sitewise and S3 now now this

play06:00

is a really permissive permission now

play06:03

for your production workloads make sure

play06:05

that your permissions are restrictive

play06:07

and you have only what you need okay now

play06:11

we'll give that policy a name Factory

play06:15

policy now we will create a role okay so

play06:19

choose custom trust policy and uh

play06:22

provide this trust policy for iot twin

play06:26

maker and grafana services hit next

play06:30

okay now choose the policy we had

play06:32

created

play06:33

earlier Factory policy hit next provide

play06:37

a role name we'll call that factory

play06:40

role okay and hit create role we come

play06:44

back to the workspace and for execution

play06:46

role we select the role we just created

play06:49

Factory

play06:51

role then hit next and for dashboard

play06:54

management we select Amazon managed

play06:58

grafana

play07:00

and for grafana authentication

play07:04

provider we again choose the factory

play07:08

Ro hit

play07:11

next and for the dashboard policy we

play07:14

leave that as no video

play07:17

permissions and for dashboard role we

play07:19

again select Factory role hit

play07:25

next review everything and hit create

play07:28

workspace

play07:29

so our workspace has been created

play07:37

successfully now that our twin maker

play07:39

workspace is ready let's add an entity

play07:42

to

play07:43

it choose the workspace and uh here we

play07:47

are going to create an entity so from

play07:50

the menu on the left select

play07:53

entities okay and here hit create

play07:57

entity and provide in

play07:59

entity name so that will be motor

play08:04

one okay and then choose create

play08:13

entity now it's time to add component to

play08:16

The

play08:18

Entity select the entity and hit add

play08:23

component here we will provide the

play08:25

component name we will call that motor

play08:31

and for type you will select iot

play08:33

sitewise

play08:35

connector and under asset model we will

play08:38

select motor

play08:40

model under asset motor

play08:43

one and we will leave all the rest of

play08:46

the properties as they

play08:48

are and hit add

play08:51

component so our component has been

play08:54

created so we have a new motor metrix

play08:56

component under motor one entity

play09:01

select the test component option to test

play09:04

this component to make sure that it is

play09:06

connected to the right data source and

play09:09

under test select speed time series

play09:11

property provide

play09:14

a Time range and hit run test and you

play09:18

can see the

play09:22

data next let's add a resource a

play09:25

resource is simply a 3D model of the

play09:27

physical asset so in our case it will be

play09:30

a 3D model of the motor a 3D model can

play09:33

be created using a variety of 3D

play09:35

modeling software and it will be in a

play09:37

specific file format for example

play09:41

glb choose the resource Library option

play09:44

hit add

play09:46

resources then select choose

play09:48

file and select your 3D model file it

play09:53

open okay

play09:56

so our 3D model file has been can added

play09:59

as a

play10:03

resource next we will create a scene and

play10:06

add our resource or 3D model to it the

play10:09

scene will be configured to show motor

play10:11

data from sitewise and update the

play10:13

display based on

play10:14

it select scenes on the left hand side

play10:18

hit create scene provide a scene ID we

play10:21

will call that factory scene hit create

play10:27

scene and this is our scene interface

play10:31

here we can see hierarchy rules and

play10:35

settings options on the left hand

play10:39

side and if you hit the plus icon you

play10:42

will see various submenus like add 3D

play10:45

model annotations Etc select the add 3D

play10:49

model option and then add a resource

play10:51

from the resource Library so here we

play10:53

select the motor model that we had added

play10:55

earlier to the resource library and

play10:57

place it here here on the scene so the

play11:01

model will be loaded

play11:04

shortly and uh if the model does not

play11:06

appear to be of correct scale you can

play11:08

change that so under transform there is

play11:11

a scale property and you can change the

play11:15

values of that so that the model appears

play11:17

in correct

play11:20

scale so that's our Moto

play11:23

model you can move it around to take a

play11:26

look at it from all all

play11:34

sides let's explore this a bit and on

play11:37

the left hand side under hierarchy you

play11:39

can see that motor and when you expand

play11:42

that you can see various sub models

play11:44

there so these are sections of the motor

play11:46

right so as you move your mouse over

play11:48

them you can see various parts of the

play11:50

motor getting highlighted okay and when

play11:53

you select uh one of

play11:56

them on the right hand side uh uh you

play11:59

can see there is an inspector

play12:06

panel Now using that uh plus icon let's

play12:11

select the add annotation option

play12:15

so this will allow us to place an

play12:18

annotation on the

play12:19

scene uh we'll provide details for that

play12:22

in the inspector section so we'll rename

play12:24

that to speed annotation where we want

play12:27

to display the current speed of the

play12:29

motor right and in the markdown

play12:32

section we just write speed colon and

play12:38

provider markdown dollar with curly

play12:43

brackets and then hit add binding

play12:47

option and here

play12:48

select entity

play12:50

ID component name and property

play12:57

speed

play12:59

right so let's change the binding name

play13:02

we'll call that speed and update the

play13:05

markdown section as

play13:11

shown next we'll add a rule so under the

play13:13

rule section on the left hand side let's

play13:15

create a rule called motor

play13:18

rule okay and uh expand that and add

play13:24

statements under it so we provide an

play13:27

expression something like

play13:30

speed greater than say

play13:33

400 okay at that point in time the

play13:37

target color should

play13:40

turn this particular color red okay and

play13:46

uh when the speed is less than or equal

play13:49

to 400 then uh the color should

play13:56

be uh let's say green

play13:59

okay right so when speed is greater than

play14:03

400 the color is red and when the speed

play14:06

is less than or equal to 400 the color

play14:08

is green and we will see how to use

play14:14

this now let's go to uh hierarchy and uh

play14:18

expand that motor model and under that

play14:22

let's select a section which we want to

play14:25

highlight in different colors right so

play14:27

we'll select that uh Z exag circular

play14:30

object right so we will turn that into

play14:32

red or green depending on the speed of

play14:34

the

play14:34

motor okay so with that selected we will

play14:39

add a model Shader right so which will

play14:42

appear under the inspector

play14:44

section select the entity

play14:47

ID select component

play14:49

name property s speed and in addition

play14:53

select the rule we just created motor

play14:55

Rule now our scene is ready overall we

play14:58

added a 3D model to the scene and we

play15:00

added a model Shader to one of its

play15:02

submodels in addition we have added a

play15:06

annotation to the scene and there are

play15:07

many other options that you could play

play15:09

around

play15:14

with now we can move on to grafana which

play15:16

is a visualization tool let's begin by

play15:19

creating a workspace in

play15:22

grafana in ews console we are in the

play15:25

Amazon manage grafana section and here

play15:28

let's it create

play15:30

workspace and provide a workspace name

play15:34

we will call

play15:36

that factory workspace

play15:40

grafana okay scroll down hit

play15:45

next okay choose an authentication

play15:48

method we'll choose AWS IM identity

play15:52

Center and uh for permission type

play15:57

customer managed

play15:59

and we will select

play16:00

an role so this is the same role that we

play16:04

created earlier Factory

play16:06

role

play16:08

okay and hit

play16:10

next all right then hit

play16:14

next okay review all the settings and

play16:17

then hit create

play16:20

workspace so our workspace is being

play16:22

created this takes some

play16:25

time and here our workspace is ready

play16:28

Factory workspace

play16:31

grafana in the IM identity Center under

play16:34

users let's add a user so this is the

play16:37

user who will be able to login into

play16:40

grafana so we will associate this user

play16:42

with grafana workspace so we'll call

play16:45

this username

play16:46

Joe and uh generate a password for that

play16:51

hit next okay we need also need to

play16:53

provide an email ID so so let's provide

play16:56

an email

play16:57

ID

play16:59

okay confirm

play17:02

that provide a first

play17:05

name and provide the last

play17:08

name and now we are ready

play17:11

to hit

play17:13

next all right hit

play17:18

next next review all the

play17:23

details add

play17:26

user so not down the pass password that

play17:28

has been

play17:33

autogenerated in grafana workspace under

play17:35

authentication assign new

play17:38

user select the user Joe assign users

play17:42

and

play17:43

groups okay now make this user an

play17:52

admin now go back to the grafana

play17:54

worksspace and here hit the grafana

play17:57

workspace URL this will will open a new

play18:00

window and sign in

play18:03

here okay provide

play18:08

username

play18:10

next provide

play18:12

password sign

play18:14

in now this prompts us to um set new

play18:18

password since the previous password was

play18:20

autogenerated so let's do

play18:24

that okay set new

play18:27

password

play18:29

and now we are successfully logged in

play18:32

right so this is

play18:33

the grafana interface presented to

play18:41

us next we will configure a data

play18:44

source select the data sources option to

play18:47

add a data

play18:49

source and here filter by twin

play18:53

maker and select that AWS iot twin

play18:57

maker so this takes us to a setting

play19:01

screen where we have to take a look at

play19:05

the connection details so provide uh the

play19:08

factory role Arn this is the role we

play19:11

created earlier so provide Arn for that

play19:14

and under workspace choose Factory

play19:16

workspace this is the twin maker

play19:19

workspace hit save and test and there

play19:21

you can see twin maker data source

play19:23

successfully

play19:27

configured now we can create a dashboard

play19:30

and panels one for the twin maker scene

play19:32

and another a Time series

play19:36

graph now go back to the home screen and

play19:38

hit

play19:39

dashboards select add new

play19:42

panel and for this panel on the right

play19:45

hand

play19:47

side select AWS

play19:49

iot twin maker scene

play19:52

viewer okay now let's change the title

play19:56

of this panel

play19:58

we will call

play19:59

it Factory Motor

play20:03

panel

play20:05

okay let's scroll down and under scene

play20:09

select the factory scene this is the

play20:11

same scene that we had created in Twin

play20:13

maker so this scene should load here now

play20:17

okay so that scene has loaded here in

play20:21

the

play20:22

UI okay now scroll down slightly and

play20:25

here under data source make sure that uh

play20:28

and it is AWS it twin maker for query

play20:31

type select get property value history

play20:33

by entity select the entity motor one

play20:38

then select component motor metric and

play20:42

uh selected properties select speed so

play20:45

when you do that you can see that in the

play20:48

panel uh speed shows

play20:50

up top right hit the save option provide

play20:55

a name for the dashboard we will call it

play20:58

Factory dashboard okay hit

play21:02

save so that's a dashboard with one

play21:05

panel Factory Motor

play21:09

panel for this panel select the view

play21:14

option now we need to send uh data to

play21:18

this particular asset so let's do that

play21:22

we'll go back to our Cloud shell and run

play21:24

our program python send data so this

play21:28

again start sending data at 1 second

play21:31

intervals randomly generated

play21:34

data and here on the screen let's put

play21:37

the refresh interval to 5

play21:40

seconds so here you will see that a

play21:43

section of the motor turns green the

play21:46

zigzag uh motor part it turns green or

play21:49

red depending on the speed so whenever

play21:52

the speed is less than 400 it is green

play21:55

and whenever it is greater than 400 it

play21:57

is red

play22:00

red this is working on expected

play22:06

lines back to the dashboard let's select

play22:10

add a new

play22:11

panel and make sure that it is of type

play22:14

time series and under data source it is

play22:17

AWS iot twin maker query type is get

play22:20

property value history by entity and

play22:23

entity is motor one and

play22:26

component motor

play22:29

metrics and selected

play22:32

properties Let's uh select speed

play22:36

there and here we can see the

play22:41

graph and uh we can also change the time

play22:47

range so for last 30

play22:51

minutes this is what the graph looks

play22:55

like let's change that again

play22:59

to 15

play23:06

minutes and

play23:08

uh how about 5

play23:11

minutes to see the details in a more

play23:13

granular

play23:16

fashion uh in addition we can change

play23:20

the view to table view right to

play23:23

see raw data right as it comes in

play23:30

so this is working on expected lines

play23:34

let's save the

play23:37

dashboard hit

play23:41

save and that's our time series panel so

play23:45

we will change the title to speed time

play23:49

series

play23:52

panel right and hit

play23:56

apply back to the factory dashboard here

play24:00

we can see our two panels now speed time

play24:02

series panel and Factory Motor panel in

play24:05

the first panel you can see the speed

play24:08

data as it comes in in real time and in

play24:11

the second panel you can see the motor

play24:15

with a part of it turning green or red

play24:19

depending on the

play24:25

speed so with that we come to the end of

play24:28

our AWS iot twin maker

play24:34

tutorial

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
AWS IoTTwin MakerSitewiseFactory AutomationData VisualizationGrafana DashboardsMotor MonitoringCloud ComputingIoT DevicesPython Scripting