TLDW logo

Building AI Agents for IoT Controls (Part 1.3)

By Code with Francis

Summary

## Key takeaways - **IoT Simulator with MQTT Broker**: Launch the Docker container to run an IoT MQTT data simulator that depends on a Mosquitto broker, generates data from different devices every 5 seconds, has APIs to control devices, and uses a SQL database to track device states. [01:36], [02:51] - **Classifier for IoT Requests**: Configure the classifier as an 'IoT request classifier' to analyze user requests and route to three cases: update device, turn on/off device, get latest telemetry, using keywords for classification. [05:41], [07:29] - **Specialized Agents with MQTT Tools**: Device update agent uses MQTT request response for settings like min/max values; on/off agent uses request response, bulk publish, subscribe; telemetry agent uses subscribe and request response, with detailed instructions and examples to prevent hallucinations. [08:40], [16:00] - **Agent Handles Multiple Tool Calls**: When asked for all devices and statuses, the telemetry agent first requests device list via IoT request topic, then makes separate status requests for each sensor like temperature sensor one, collecting responses from IoT response topic. [26:37], [29:05] - **Real-Time Device Control via MQTT**: Agent successfully disables flow rate sensor by sending disable command to its topic, receives confirmation device is online but action disabled, and verifies status using ID or name. [32:01], [34:29] - **Update Device Configurations**: Device update agent sets temp sensor 01 min to 20 and max to 80 via MQTT, confirming new values after update. [40:07], [40:43]

Topics Covered

  • LLMs Evolve to Agentic IoT
  • Detailed Instructions Prevent Hallucinations
  • Agents Iterate Tools Until Complete
  • Agentic IoT Enables Autonomous Control

Full Transcript

Like so far we've been able to create two HR related agents. So one that just uses the LLM, right? Use the LLMs but

doesn't really have any interaction with the world or just uses what it knows within the model. And now we were able to just finish this oil one, right? That

is able to interact with a database. And

we see how and also interact with a function, right? the two function that

function, right? the two function that we use for generating new UIDs. Right?

That's good. All right. And we see how even from the model we're able to the model is able to access data externally and use that data to prepare what it needs. So assuming maybe you wanted to

needs. So assuming maybe you wanted to call something on the internet, find maybe what the weather is today. It

could call maybe the a search tool, maybe Google search or to valley, right?

And then get that data. And then once it gets that data, then it uses that to prepare data. Now, that is nice.

prepare data. Now, that is nice.

However, you know, all this is nice and good, but we're an IoT class, right? And

we care more about IoT. Basically, these

examples were basically for us to understand the basic concepts of how these things work, right? And now we want to create something that talks with

an MQTT, right? And there is this project I created. If you copy that, if

you launch the using the docker um container, the the docker uh yaml, right? You'll see there is an IoT

right? You'll see there is an IoT simulator in here, right? So essentially

what this is is it's an IoT simulator.

It depends on this broker. So if you launch it, you'll also be launching this mosquito MQTT broker. It's just a mosquito image, right? And basically

it's also on the same do right account, right? So you could download it. It's

right? So you could download it. It's

open. It's you can use it. Essentially

what this does is this just generates IoT data from different devices. And

once you launch it, you'll see the data coming in and you can access that data.

It has some APIs you can, you know, send, you know, to set that specific device, put on a second device, put on put off some specific device. I will

have to remember to copy the MD file. I

don't think I added it, but I will have to remember to copy that and add that and upload that to Docker, right? If I

haven't, right, I'm not sure if I did at this point, but it looks like I did not, right? But anyways, we're going to use

right? But anyways, we're going to use it and then later I'll copy the MD file so you can get more information about what the agent really is and how it really works. That's that's fine. You

really works. That's that's fine. You

don't need the code. It's just it's just anybody can build that, right? So we're

going to use this to generate our IoT data and it's also a server. So it can collect data and set a particular device. It has a database in it, right?

device. It has a database in it, right?

It will create a database in it, a SQL like database, right? And it uses that and and you you can see that here, right? So it uses that to know what

right? So it uses that to know what state a specific device is in, right? So

that's that's all good. But first before we get there, let's build our agent. So

what do we want to do? So basically we have this already right and we're going to use the same process. The data comes

in it gets into the classifier. The

classifier sends it to the switch and the switch will send it to the different processes we want to do on our IoT device. Right? One could be for sending

device. Right? One could be for sending data. Another could be for telemetry.

data. Another could be for telemetry.

And another could be maybe for turning off or turning on a particular device.

It just depends, right, what it needs.

And so let's do this. Let's save this again, but we'll save it as a new

workflow. And we will call it IoT

workflow. And we will call it IoT React agent.

Okay. Yeah. So again, just remember that this tool is a work in progress. I built

this tool. I put it out there. It's

good. We're using it in this class as part of a larger application that I'm working on in my free time. But again,

if you have any if you like the tool or if you have any questions about the tool or if you know you see any problems, I haven't really, you know, done QA for

everything. All right. So still building

everything. All right. So still building it at this point. It's not ready fully.

It's still in version 0.0.1. So it's

brand new tool, right? I just uploaded yesterday, right? So again, if you have

yesterday, right? So again, if you have any questions about the tool, feel free to reach out, but you could use it for this project. It's there. It's on um

this project. It's there. It's on um Docker Hub. You can get it and use it.

Docker Hub. You can get it and use it.

So let's get back. So we've created our IoT React agent, right?

And now what do we want to do? First of

all, our classifier has to be different, right? Now this classifier is for HR,

right? Now this classifier is for HR, right? So what do we do? We have to

right? So what do we do? We have to change that. We're going to give this

change that. We're going to give this and again in the thing you downloaded, I'm going to that from the my from the Git repository. I'm going to add

Git repository. I'm going to add everything there for you. I already did with some of it. Um so let's see the IoT agent.

And there's the classifier. So the

identity, you're an IoT uh for the classifier, you're an IoT request classifier. Your job is to analyze user

classifier. Your job is to analyze user requests and route them appropriately.

So going to copy that and that is the identity. Remember the

classifier is also an AI agent. Right?

Now let's also get the classification cases. We're also

telling it that okay there going to be three cases that you need to classify with right update device turn on or off a device and then get the latest telemetry and we told it the different

things. There's a bunch of stuff here,

things. There's a bunch of stuff here, right? So, we told it what it could be

right? So, we told it what it could be when a user is trying to do, you know, change a device. The keywords it should be looking for. Now, the agent doesn't really need it at this stage. It

probably knows. It's a, you know, it's a huge agent. We're using chat GPT, one

huge agent. We're using chat GPT, one of, you know, if not the best, one of the best out there, right? So, we're

just going to copy this, right? and

we're going to copy and we're going to paste that in the classification instructions. We're going to use the

instructions. We're going to use the same classifier output. The classifier

output is just where we saved the data that's coming out of the classifier so that the switch can pick it up. So now

we have everything we need in the classifier. It knows its identity. It

classifier. It knows its identity. It

knows what it's supposed to do and we've told it this is your job. Just do this, right? But we need to tell it what

right? But we need to tell it what categories we're looking for. And so

let's copy that from here. We have one for updating a device.

We have another one for turning on and off a device.

And then we have a third one for the telemetry.

Okay, so now this is done. We have a new classifier that can classify data for IoT. That's simple, right? Very easy.

IoT. That's simple, right? Very easy.

Now we're going to go to our switch, right? Switch is looking for the same

right? Switch is looking for the same output. So we're going to give it one

output. So we're going to give it one for the telemetry, right?

one for the on and off and one for the device.

So, we do not have an HR region anymore.

Unfortunately, we now have an IoT classifier and no longer a HR classifier.

Now what do we want to do? So let's

start with the update device, right? So

we're starting with the update device.

Okay. So with the update device, we give it an identity. You are an IoT device configuration agent. Your job is to

configuration agent. Your job is to update the device settings such as minmax values, units, other configurations and parameters. We do not know all of it, but we know these are

some of them. Right? Copy.

And here paste let's call it update agent.

Let's say update device. Um

let's say all right just device update.

I think it's fine.

So we've set the identity right and uh input the target we don't like that's fine we can keep it because this is how especially the output it's how we get

the output and the input also is how it gets the message but we don't need the input I think it we more need the output to send it out right so we have to change the instructions so let's get

these instructions out and now we will add the instructions. So, we're telling it that okay, you have one tool MQTT

request response and it's going to be used for sending commands. And we have a bunch of information here about how to use the tool, how the commands are because one of the things to notice is

you have to really tell it what to do because if not, it's not going to know, right? It's going to guess and that's

right? It's going to guess and that's where the hallucination comes in and then you can have problems with your system. So give it as much information

system. So give it as much information as possible. And so we've already

as possible. And so we've already formatted all this here. You can copy it. We even have examples of how to use

it. We even have examples of how to use it. And you can see examples of how to

it. And you can see examples of how to use it. Basically, we're telling it

use it. Basically, we're telling it like, hey, this is this stuff. I need

you to use it correctly. Do not make any mistakes. Right. And so let's copy that.

mistakes. Right. And so let's copy that.

Right.

Sure.

And we're going to put that here in the instructions, right? And that is it.

instructions, right? And that is it.

That's all we need. Oh, we missed a few things. Okay. So, we told it it has

things. Okay. So, we told it it has certain tools, but we haven't set those tools. So, there's one tool, MQTT

tools. So, there's one tool, MQTT request response, right? So, we're going to take out these old tools that we had here.

We're going to add the MQTT tool and we're going to say it's the request response tool. And you can see in here

response tool. And you can see in here there's also more examples that the agent can read and because it'll get the information about the tool from the tool itself. And we can we added more

itself. And we can we added more examples in there about how to use this tool and so that the agent can read it and get that information and be able to use it, right? And we have the tool. So

we're going to say that tool. So this

one just needs one tool, right? And

that's the MQTT request response to this. Right now looking at the billing

this. Right now looking at the billing support agent. Oh, sorry. I forgot this

support agent. Oh, sorry. I forgot this is this is our previous agent. Okay. So

now we're looking at the which one do we do next? One second. We're looking at

do next? One second. We're looking at the turn on and off agent, right? So

we'll call it onoff device, right? And we need an identity. So

identity. So So this is the identity. You're an IoT device control agent. Your job is to enable or disable IoT devices

based on the user's request. Right? So,

we're going to change that and we're going to input source out.

That's fine. We're going to change the instructions more detailed instructions for the onoff device agent. So, here's the

device agent. So, here's the instruction. This has three tools. It

instruction. This has three tools. It

has a tool for MQTT request response, right? So it can get a response from one

right? So it can get a response from one device. Oh sorry, MQTT request response,

device. Oh sorry, MQTT request response, right? So for single device control,

right? So for single device control, right? It also has the IoT and uh bulk

right? It also has the IoT and uh bulk publish for bulk, you know, sending to multiple devices. And it has a

multiple devices. And it has a subscription tool that it can use to subscribe. And again, a ton of

subscribe. And again, a ton of information about how it can use it, examples, references, and all of that so that it doesn't make any mistake because

any if it doesn't have enough if if this doesn't have enough information, it's going to hallucinate and it's going to start making calls the wrong way and you

might have your agent not working properly or not calling the right tool.

Right? So, we need to make sure it knows what to use, right? So, we're going to paste that in here, right? So, that does that for that. And

right? So, that does that for that. And

now, let's add the tools. There are

three tools, right? So, sure about that.

Right. So, I'm going to take out the current tools in here. One, two. We're

going to add the request response tool.

MQTT request response. So go to MQTT request response and we save that tool, right?

And then we're going to go to the bulk publish one. We're going to go to MQTT,

publish one. We're going to go to MQTT, right? Bulk publish.

right? Bulk publish.

And we're going to save that one. And

then it also needs the MQTT subscribe.

And so basically we're going to go here.

We're going to go to the MQTT subscribe and then subscribe and wait. Right. So,

MQTT subscribe. So, those are the tools that it needs, right? And the definition of how to use the tools already in there. Now, you may notice that when you

there. Now, you may notice that when you open this tool again, right, it will have the name of the agent that's calling it appended to it. That's fine,

right? Um that's u really fine. It's the

way it's designed right now. You append,

you can change the tool the way it's designed. Right now, you could change

designed. Right now, you could change the tool um specific for the agent if you wanted, right? But I guess in the future, we'll do it a little different where you can create a tool maybe in the

settings view and then reference that tool. So, they're all the same. So, but

tool. So, they're all the same. So, but

because of the way it's designed, right?

Now, we have it that way. Ah, guess I was rushing while designing, but it works. So, this is good. I think we have

works. So, this is good. I think we have the instructions, right? We have the identity and we're good on this agent.

This agent should know what it means.

Now, we're going to change this one. And that should be our telemetry agent, right? So, let's go and

we're going to get the telemetry agent here and we have an identity for it, right? So basically

right? So basically we have you are an IoT telemetry agent.

Your job is to receive current sensor readings and device status information.

That is very correct. So let's put that for the identity agent and then the tool. So it has two tools MQTT subscriber and the request

response. And we told it everything that

response. And we told it everything that it needs. You can see here we told it

it needs. You can see here we told it the actual tool names available may you may have a prefix IE right we told it that you know that what I said you know

like and then we said okay that may have that just know that when you're calling a tool you know so that you know that these examples don't have that because we don't know what the real tool name is

when you're adding it just so basically it's just you have to give it enough enough information so it knows what it's working with right if not it will call

the wrong thing. It will do the wrong thing. And so now we have this puppy,

thing. And so now we have this puppy, right? So

right? So let us now update this.

And with this updated, now we have two tools that we need to add. MQTT subscribe. So let's go ahead

add. MQTT subscribe. So let's go ahead and delete this guys.

Add the tool for IoT and MQTT and subscribe and wait.

Right. And then we're going to save that.

Right.

Okay. And then we're going to add another tool for MQTT request response.

Those are the two tools that it requires. Okay. So now

requires. Okay. So now

our agent is complete, right? So we've

set up everything. Once it gets data, it will classify it. The switch will take care of routing it to the correct place.

Once it routes it, then we get a response. Now it could be more complex

response. Now it could be more complex than that, but basically this is just a simple agent. And so what we're going to

simple agent. And so what we're going to do next is we're going to launch this agent right?

So now let's open it in Jupiter Lamb.

And everything should be as is. We

already have this requirement satisfied from previously.

So this one we you can see there's some extra things added here, right? We're

using IoT messaging. So we need to uncomment these two just to make sure. I

think pip should already I'm sorry follow MQTT should already be installed by default. But we're going to need to

by default. But we're going to need to enable file MQTT client because we use that's the library we're using for MQTT.

And um just just um We don't need this. I think we already have UU ID previously. Yeah, I don't

think we need this. Okay, so we just need this too, I think. So, let's run that.

Let's make sure.

Yeah. So, we already had file MQTT from previously, right? And now, let's run

previously, right? And now, let's run this.

It should have my key already, so should be good there. Let's run the the actual code. So the code is long.

code. So the code is long.

So you can see all the stuff we added in there, right? That we told it about the

there, right? That we told it about the agent. You can see all that is in there

agent. You can see all that is in there and everything, right? So now let's run the flow, right? So you know the graph, it's

flow, right? So you know the graph, it's the same graph. Just used basically the same graph from the previous example, right? That's why I used it because it

right? That's why I used it because it was just the same flow. But you can have more complicated things, but this kind of shortens the whole thing. And now

let's run the agent. Oh, it's saying it's a HR agent. Maybe we should just exit.

But again, you you get it, right? So, we

didn't have that because um yeah, we just have to come here. But again, it doesn't really matter, right?

Just put that as IOT, right? Again,

that's not a big deal. I just like having that for completeness basically.

All right. And then we go here. Open.

Open.

We already know this works. So we'll

just run this guy. We'll run this guy.

Run that guy. Run this guy. Run that

guy. Run this guy. Run that guy. That is

the graph, right? Everything looks good.

We switch it. And then we go to the different agents. Oh, again, I think we didn't update the names. We did the first one, device update. Well, it looks

like we didn't do the others. Okay, so

maybe we'll go back because the names might be confusing from the graph, right? So, let's go back here.

right? So, let's go back here.

So, we did device update. We did onoff device. See child support was the one.

device. See child support was the one.

All right. So that will be tele right let's say telemetry agent that should be fine.

Save the database update that workflow and then we'll go and load it to Jupiter lab.

Uh again, we don't need that once. Let's

run multiple times.

And now I think that looks better.

Right. So we have the update device. We

have the onoff. So if it requires to do an on and off, we'll go there. And then

we have the node telemetry agent right here. Now we can now run our agent.

here. Now we can now run our agent.

Right now it ask okay I'm a helpful IoT agent. How can I help you? Now, we're

agent. How can I help you? Now, we're

dealing with MQTT. We don't have our MQTT server yet running, right? So, I

think we probably want to have that running together with the simulator, right? The devices all need to be

right? The devices all need to be online. So, I'm going to go back here

online. So, I'm going to go back here and that's why we have this simulator.

It just helps, right? So, in the next series of this video, we're actually going to try to put on and off real devices, right? But for now you can see

devices, right? But for now you can see data is on the simulator and the simulator is started together with the so this is the data simulator and the

mosquito broker right. So basically

these two have been started and we can now use them. So right now they're sending data and how do we know

we can maybe reduce this view a little bit.

reduce this.

And then if you have MQTTX, it's a great tool, right? So if you have MQTTX, it's a great tool for this kind of thing, right? Uh basically, I'm

running this on my Mac. Yeah, there's

also MQTTX for Windows. And if you look at it, the configuration, we just have the name. It's connected to local host.

the name. It's connected to local host.

You can see it's on port 1883 which is which should be the port my mosquito broker is on right 1883. So it doesn't

it's not the TLS port. So 1883

and just the normal settings like you don't have to change the others. All you

need is just these guys. And this is usually by default anyways. Yeah, that's

all. And now we just So I have a few topics here that are set up so we can connect So now I'm connected to the broker right

and there are few topics here that I left open that are important right like this one IoT request IoT response

device temperature sensor01/comand device humidity sensor01/comand devices pressure01

command device status and then this is off for now. IoT D just in case if you want to see

all the data coming in, right? We can

maybe put on this one, right? Sends data

every 5 seconds. Just there's going to be too much data coming in, right? So,

you can see that the the simulator is actually working. It's sending a ton of

actually working. It's sending a ton of data. The reason why I have it off is

data. The reason why I have it off is there's just going to be too much stuff happening and we won't be able to understand what is really happening.

Right? And so for now I'm just going to turn this off. Right? And I will add all this also in the um MD file. Hopefully I

remember to do that. I'm just going to clear that history off because I want us to see what is happening. Right? And so

that's really all we need, right?

That's really all we need. So now let's go ahead and ask some questions.

Let's go ahead and ask some questions and see if our agent can work with that.

Right. So put this here so we can see that clearly. So, I'm going to ask what

that clearly. So, I'm going to ask what devices and their ids

do I have also show all the device

status. test.

status. test.

So let's see how it works. Okay, this is going to be a tricky one. So

we see the classifier classify this and said, huh, this is a telemetry request.

Looks like we're trying to get the and then it called the switch and you can see some data is already coming back and we're going to study what happened there. Right? So some data is already

there. Right? So some data is already coming here that it made and you can see it got all the devices. It says, "Okay, assistant, uh, here are the details of all the available devices and your

current status." So, it gave me all the

current status." So, it gave me all the devices, right? But it didn't make, if

devices, right? But it didn't make, if you notice here, it didn't make one call. It it didn't it made multiple

call. It it didn't it made multiple calls. So, it must have used multiple

calls. So, it must have used multiple tools, right? Or used the same tool

tools, right? Or used the same tool multiple times. So, remember we talked

multiple times. So, remember we talked about that, right? Uh, we said if tool are needed, it keeps executing until it's done. It tried to make sure it was

it's done. It tried to make sure it was able to answer all the requests, right?

So, let's go back and see what happened.

It gave the devices, their IDs, their type, the temperature, the units. It

gave everything, listed everything and their statuses also, right? Because I

asked for the status and I asked for the list of the devices, right? And it

provided everything that's needed. What

happened right?

It sent the first request. You could see it here on IoT request. It says give me the list of all the devices. This is the request that this is the in in the

description right in the comments we gave to it. This is what we told it it should call if it wants to get a list of devices and it sent a request and said get me the list of all the devices which

is what happened here, right? And so

what did we do in the IoT response which is the response topic for that kind of data? We got all these devices back. So

data? We got all these devices back. So

these are the list of devices. This is

how it got them. And then when it got the when it got the device, right, you can see there, you know, some hallucination going on here. This is not supposed to be here. Correlation ID

because we're not really using it. It's

not part of the description. I'm not

sure why it sent it, but again, it's fine. It did the right thing anyways.

fine. It did the right thing anyways.

Right after it got the device, it then says get status for temperature one.

Right. temperature sensor one. So, it

knew what to do. It first got the devices because the status is not in the device. This just gets you the the list

device. This just gets you the the list of devices. This just gets you the total

of devices. This just gets you the total list of devices that you have and not the status. And now it's asking it made

the status. And now it's asking it made a request for a command to get the status of temperature sensor one and it received that data here. Right? And then

it made another request and it says get me the status of humidity sensor one.

Right? It got humidity sensor one's uh status. It got the then it asked uh it

status. It got the then it asked uh it asked for the status of pressure sensor one. Same thing got the response. Flow

one. Same thing got the response. Flow

sensor one. Same thing got the response.

And then and then thank sensor one right you know and and so that is how it got all the

statuses right for all the devices right so basically oh because I only have the I only have a few of them open I didn't have all of them open right so basically

that's how it got the statuses of all of them right and once it got it that's how it's now able to get this information so

you can see that this is funny Right. We

have an LLM agent talking through MQTT to a service and you know, you know, getting data about device information.

Imagine you have a factory or something or imagine you have multiple devices out there. You design multiple devices out

there. You design multiple devices out there in the real world and you're trying to maybe make some sort of prediction or some sort of analysis. uh

you know on your devices the agent can think about it what do I need to do make the request to the devices get me all your statuses get me all your error you

know and look at that information and kind of classify or think about what to do next right again this is just a

simple use case but this is what the power of a gentic IoT this is how you can see you know how this can be used in

the real world to communicate with devices. Maybe some device, some real

devices. Maybe some device, some real device somewhere out there in the real world is listening to that topic and the agent is talking to it and it's able to monitor what's happening with that device in real time and it's able to

understand if there's a problem with it.

It maybe uses a rag model, a rag database, right, to figure out like, you know, what's happening based off what's there. And based off the rag database,

there. And based off the rag database, it then makes okay, this is what I'm supposed to do on this device and automatically sends the rest. You don't

need to code all of that. The agent can understand it, right? And and that is the power here of Agentic IoT. So let's

ask another question. This is cool. So

let's say turn off the flow rate.

sensor.

So now we're calling devices by name, right? Turn off the flow rate sensor,

right? Turn off the flow rate sensor, right? I'm going to clear this

right? I'm going to clear this string.

Do I have the probably don't have?

So let's open the one for let's open this to you know what let's do this I copy that

I'm going to add a new topic right and I'm going to call it what's the ID do we know the ID of flow rate sensor

I think I'm going to copy that because I don't have I'm not listening on that topic So I just copy that and then paste that here

before we start that. So I'm going to connect to that topic. Right. So that's

flow sensor. We have that.

Just go ahead. And now we're going to say turn off flow rate sensor. What

happens? Right?

It's going to take that information, classify it, and then figure out what to do next. And what did it do? You can see

do next. And what did it do? You can see that's why I added this, right? It sent

the disable command to the flow rate sensor, right? And then the flow rate

sensor, right? And then the flow rate sensor responded, the server responded that flow rate sensor uh status um action, sorry, is disabled, right? The

device is still online. You can still talk to it, but the action is disabled.

So, it's no longer working. And now if I say if I tell it to get the status of

you know so it it uses either it it can understand it uses the ID or the name because it has the context. So so let me just use the ID. Remember the first

request we made was made using the ID right and it knew what it was was made using the name and it knew what to do.

Now this one we're making now we're going to use the ID to make that and if we do that get the status of flow sensor one

and you can see that it sent that and it got the value right so enabled is known this device is currently disabled that

is funny right so how cool would it be if you had an agent, a Gentic system, right? A Gentic IoT system connected to

right? A Gentic IoT system connected to maybe some kind of voice, you know, service, right? That that can listen to

service, right? That that can listen to voice and convert it to text and you're able to talk to it just like it would do to your normal Echo, your normal Google Home. And based off of that, it can

Home. And based off of that, it can control whatever device that you set it to. You don't even have to code it. It

to. You don't even have to code it. It

knows what to call. It knows what method to call, how to call it, and you don't even have to start writing a ton of code to make that work, right? You just have

to define the functions properly and give it instructions on how to use it.

This is good. It's it's a gamecher to how IoT can be used in the future, right? Even today, basically a lot of

right? Even today, basically a lot of devices today are getting things done this way. Right? Now, let's go ahead.

this way. Right? Now, let's go ahead.

Let's ask one last question, right?

We're going to ask it about two different sensors this time. So, I'm

going to clear this off and let's see what it does. You know what is the value

of You know what? Let me just copy the I'm just going to ask it.

So what's the value of temperature sensor one of the temperature sensor one and humidity sensor one right now let's send again what happens it's going to

take that value classify it as telemetry and it should go to the telemetry agent right and it execute the telemetry agent and it got the data remember it's just

getting live telemetry it didn't use any of the ones it's probably using these ones that are very noisy that gets the data every 5 seconds. So it knows to

listen on that until it gets the data and then it got it. Now remember this is using the telemetry agent that used the

telemetry agent. What it did? Okay, this

telemetry agent. What it did? Okay, this

also used telemetry agent. Oh, so this first one was telemetry agent.

Our second one was on off device agent.

Our third one was also telemetry agent.

So again, you know, we can basically it can, you know, make any change you want, right? You know, so let's let's see if

right? You know, so let's let's see if we can use something with the update device agent. Let's try that. Let's say

device agent. Let's try that. Let's say

update the status of pressure sensor 01. I think I

save and reduce.

Oh, let's let's do that first, right?

Update the stat disable, right? So,

so you can see it disabled pressure sensor one, right? What did it use here?

It used on off again. I'm not sure why it's not using anyway. Has to do with the instructions, but it did the right thing either way. So, maybe the way I wrote the instructions, it probably

looked better than on off though because disabled means like on off, right? So,

let's assume.

Let me see. I don't have the MD file here. So, let me

here. So, let me do this. Cleare this.

do this. Cleare this.

Let's do this. Get the status of see what it does there.

Okay, now that we have this, all right, let's see what it does here.

I'm looking for the device description.

So, we should be able to me look for the MD file.

Okay. So let's say get the minimum and maximum settings

value of temp sensor zero. Right. So let's see what it does

zero. Right. So let's see what it does here. Okay. So it got the min and the

here. Okay. So it got the min and the max. Right. This is what I needed.

max. Right. This is what I needed.

Right. And it used should use a telemetry there. Now let's do something.

telemetry there. Now let's do something.

Let's set the Now we know the minimum is 18 and the maximum is 75. Right. Set the

temp sensor 01 min to move it up to 20,

right? And max

right? And max to 80, right? So we know the current value

80, right? So we know the current value is 18 and 35. So now we're going to update that, right? So let's do that.

And yeah, so this used device update.

Now that was what I wanted to do, right?

So you can see now it used the kne that was a device update. And so what it did now is you can now see that the latest value is now 20 and 80, right? So

basically it it was able to figure out how to set the settings based off of what we told it and set that value. All

right, I think that's a long one. And

it's cool to see how this works. It's

cool to see how we can put this together with an AI agent and talk to an IoT device, you know, even though today we're not using a real IoT device. I

need some time to put that, you know, tutorial together, but even though we're we using a server, right, a simulator server, which is really more like as close as you can get to real world,

right? Talking to an actual device,

right? Talking to an actual device, right? So basically it connects to a

right? So basically it connects to a service, talk to the service and be able to set and update values on that service or even get data from that service. So

just imagine what you can do with that.

You can improve your manufacturing process. You can improve your lighting

process. You can improve your lighting process, right? You can improve

process, right? You can improve automotive. You can improve petroleum

automotive. You can improve petroleum machineries that you know work in a petroleum indifferent types of applications. General applications that

applications. General applications that require IoT connectivity can be improved or controlled using AI. Now there are

some things you have to watch out right there. A lot of hallucinations still

there. A lot of hallucinations still going on. So you need to be careful and

going on. So you need to be careful and you need to design and have the right architecture to make this work. So this

is a long one and I'm going to stop here for today. Again, I really hope you

for today. Again, I really hope you enjoyed this video. Please, please,

please, I need your subscriptions.

They're really helpful. Please subscribe

to my channel, like, subscribe, share this video, and also click on notifications so that if I have new notifications, you'll get them. And I

will see you in the next one. Thank you.

Loading...

Loading video analysis...