• 4 months ago
În acest tutorial, vă voi arăta cum să integrați în HomeAssistant înregistratoarele (DVR, XVR, NVR) de la Dahua.

~ Pentru informații mai complexe (link-uri și comenzi) vizitați pagina pe website. ~
~ Acest tutorial nu a fost creeat să fie frumos ci să fie util. ~
_______________________________________________________
Website: https://go-website-1.myshort.ro/vjlLju
Dacă vrei să ne ajuți click aici: https://go.myshort.ro/2hQL7w

Category

🤖
Tech
Transcript
00:00Hello everyone, in today's tutorial I will show you how you can monitor some Windows PCs in Home Assistant.
00:29You have here a small description, I will not read it out loud because it is not the case, only what is necessary.
00:36As I said here, you can do this thing if you do not have access or if the PCs are not in the location, you can monitor the parameters, you can automate and so on.
00:50For example, if you have a hard disk that collects information, you can send an email when it has a certain percentage and so on.
01:00The only disadvantage of this solution is that it is not developed for systems that are on 32 bits.
01:08Unfortunately, this is not the case because not many use 32 bits anymore.
01:15So, for me at least, I do not know about others, but for me it is important that the CPU temperature is not monitored for a while.
01:29That is, the processor remains, for a while the temperature cannot be monitored.
01:39From my point of view, it is an important parameter, but for now it is not.
01:46We hope it will be introduced in the next updates.
01:50What to do? On Home Assistant, the first thing you have to do is install the Hux add-on.
01:56If you have not installed it, you will have to do it.
02:02If you do not know how to install Hux, look through my tutorials.
02:06You will find a tutorial where it shows you how to install Hux.
02:17As I told you, I already have the Hux add-on installed.
02:23You see it here.
02:26Once you have installed the Hux, you have to look for HSS Agent in Hux.
02:36So, that's how you look for it.
02:38HSS Agent.
02:40Go to Integration, Explore, and find it here.
02:45If you do not write it, HSS Agent.
02:50And just download it.
02:54After you download it, you have to install MQTT Broker if you have not installed it.
03:01Although it is hard for me to believe, but let's say you have not installed it.
03:07Just install MQTT Broker.
03:10You will find it here.
03:13Go to Add Integration.
03:15Write here MQTT.
03:17You will find it.
03:19Yes.
03:21And you will have it here.
03:25Good.
03:26Once you have installed HSS Agent, you need to restart it.
03:33Yes.
03:34I'll do that too and we'll be back.
03:36Good.
03:37Now I have restarted the Home Assistant.
03:40Yes.
03:41Next, we have to install MQTT Broker.
03:45If it is not installed, as I said, it must be installed and it must be configured.
03:50Yes.
03:51As I said, I already have MQTT Broker installed at Addons.
03:57As you can see, it is here.
04:00Before we start it, go to Configuration and set a username and password.
04:05Yes.
04:06These usually do not come.
04:08You do them by hand.
04:11Yes.
04:12Write.
04:13Exactly here.
04:14Username and password.
04:15Change them.
04:16You put them as you want.
04:18Save.
04:19After that, you can launch MQTT.
04:23Of course, if you use it, activate it to start.
04:30Just like I did.
04:31And we start.
04:34MQTT is running.
04:37As you can see, it is colored and it is running.
04:41Good.
04:45What should be ensured at MQTT?
04:49The 1883 port is routed correctly to MQTT Broker.
04:56Yes.
04:57So it answers from the outside.
04:59As I wrote here, a virtual LAN solution can also be used.
05:03We'll talk about it another time.
05:07Good.
05:08Now.
05:09You did all the above.
05:13We actually move to the PC.
05:15Yes.
05:16We have to install the HASS Agent application.
05:19The application can be downloaded from my drive.
05:23You can also look for it on their GitHub page.
05:27It seems easier for me to take it from here.
05:30We download it.
05:32As I said here.
05:35You have to install the HASS Agent application.
05:40We'll do that too.
05:42Let's put it nicely.
05:44And we will install it.
06:02Here you give the device name.
06:15It's ok like this.
06:17For me, for you, everyone with it.
06:19Very important.
06:22We are and we want HASS Agent to launch at the start of Windows.
06:30Next.
06:32And here we actually get to the configuration part of the agent.
06:39As I said.
06:41MQTT runs.
06:43It has a username, it has a password.
06:52We copy the agent's address.
06:56We have to leave the port.
07:06And we put it here.
07:13As you can see.
07:16Now in Home Assistant.
07:23We go to Name.
07:26Security.
07:28And to generate a long-life token.
07:32Long-life access token.
07:35Create token.
07:36Here we give a name.
07:39It's good to give a name for the name calculator to know what we're talking about.
07:44In my case, it's ok like this.
07:46Ok.
07:47And it generates a token for us.
07:50Be careful with the token.
07:52If you copy it and close it, you won't see it anymore.
07:56We take that token.
07:58We put it here.
08:01And we give Test Connection.
08:12It tells us that the connection is correct.
08:15You can generate another test if you want.
08:19So, at this point, the agent knows how to talk to the Home Assistant.
08:26Next.
08:28This is the most complicated part, because you will have to complete the MQTT.
08:36MQTT means its location, port, username and password.
08:45The token is not here.
08:49We will go to MQTT here.
08:55Let's copy the username.
09:03And the password.
09:15Port.
09:17Everything is fine.
09:19We still have to give it Next.
09:23If we want Notification Media Player, it's optional.
09:29Next.
09:31Next.
09:33And Finish.
09:35We wait for it to configure.
09:44At this point, if Home Assistant, API, Satellite and MQTT are running, it is exactly what we were looking for.
10:15And now, as I told you, it also sees it via HasAgent.
10:23We configure.
10:25And we have it in MQTT.
10:33You can ignore this part for now.
10:35It's not mandatory.
10:39But, for now, it's kind of empty, so to speak.
10:53Good.
10:55Now, here, we have to start the services we need.
11:03Well, so we don't complicate things, I'm going to copy here to Sensors.
11:11So, again, go to Sensors.
11:16Add New.
11:18And, for example, from here, select the options, each option you need.
11:25For example, CPU Load.
11:28It gives us information.
11:30We give it Store Sensor and it appears here.
11:33Let's give it Memory.
11:39Where is it?
11:42Memory.
11:44We give it Store Sensor.
11:46And, as you can see, nothing happens to it until we give it Store Inactivate.
11:53We give it this command.
11:59And now Sensors is running.
12:02If we look here, it also reads the parameters.
12:05These parameters will be transmitted to Home Assistant.
12:11So, CPU Load, Memory Load.
12:29As you can see, a Device to Entities.
12:33And, as you can see, we have CPU Load and Memory Usage.
12:38With these you can put cards, you can do whatever you want.
12:43For example, let's give it here like this.
12:50CPU.
12:58Memory.
13:00Save.
13:01And, as you can see, we have them in cards.
13:03CPU and Memory.
13:05You can rename them.
13:07There is no problem.
13:09You can do them in graphics, in whatever you want.
13:12So.
13:16Good.
13:19As I said, you can also activate commands.
13:25The procedure is the same.
13:27Here you have more things.
13:29Important, from my point of view, are Shutdown, Restart, Sleep and so on.
13:38We give this command.
13:42At the end, Store Inactivate.
13:44And it seems to me that it is running.
13:49Here I already have three entities.
13:53Now, if you press this, the computer will restart.
13:59Of course, we can give it Add to Dashboard, if we want.
14:09If we press it, it will restart.
14:12I will not give it, because we are working on it.
14:15Believe me, it works.
14:17You can, of course, as I told you,
14:20to monitor, for example, network cards.
14:28You go to Network.
14:32Store.
14:36Store Inactivate.
14:41And you want to find it.
14:47Here.
14:50If I press Reload or not, it's the same thing.
14:55And now, as I told you, here are the network cards.
15:04They are updated, it's not a problem.
15:07The idea is that I have more virtual or physical cards.
15:12It tells you their status, if they are up or down,
15:16that is, connected or disconnected.
15:21If you do not need a specific parameter,
15:23for example, we consider that Bluetooth is unimportant,
15:29it deactivates it and disappears from the list.
15:31And then we can leave only those who interest us in the list.
15:34Of course, you can rename them,
15:37it will be easier to work with them.
15:43To make it easier for you to work with them,
15:45as I said, rename them and you will have them
15:47with an easier name than this one.
15:52Go to Name and say
15:55CPU Update.
16:00And so you do for everything you are interested in.
16:04Recommendation, if you are not interested,
16:06deactivate it, don't stay here.
16:08It just doesn't make sense.
16:13Now let's add a card.
16:25With a network card.
16:32It doesn't matter what network card,
16:34let's look for one that is up.
16:42Let's see.
16:51It will be up from here.
16:56We are not interested in the ASSET COUNTER.
16:58Let's not complicate it.
17:04Not here, here.
17:12We are not interested in this one.
17:16VLAN.
17:18We write here.
17:21VLAN.
17:25And then if we go here,
17:29we add a card.
17:31Let's add this one this time.
17:35And
17:44it tells us the status,
17:46if we click on it,
17:48on Attributes, it tells us
17:50all the information we need.
17:53How much it received, how much it transmitted,
17:55IP, URI and so on.
18:00Of course, it will tell us
18:02the speed at which it is connected.
18:05So all the information you need
18:08related to the network card.
18:14And
18:17through this thing you can
18:19monitor the network card
18:21without even the slightest problem.
18:25Let's add
18:28Just for fun, let's add the display,
18:32but they monitored it, I don't know what.
18:38We are interested in the storage, yes.
18:44Store and activate.
18:48As you can see,
18:51they are here.
18:54If we go now in ...
19:05As you can see, there are a lot of things.
19:09We are waiting for the information to come from
19:13the PC.
19:16And
19:18yes.
19:21Resolutions, if you are interested.
19:24At least it seems to me a very useful thing,
19:27I don't mess with it.
19:29Instead, here we have
19:31the URIs.
19:34This one, let's call it
19:39Update Storage.
19:43We go to House.
19:47We add a card.
19:59If we click on it,
20:03it tells us how much is used
20:05and how much is available.
20:09That's how you can do it with all
20:14all the storages you have.
20:17To be honest,
20:19I considered
20:21the tutorial over,
20:23after which I thought it was not correct to
20:27let you, so to speak, in the tail of the fish.
20:31Maybe some of you don't want this option.
20:34Yes.
20:37They want to see directly.
20:39I don't know.
20:41Strictly as an example, we will take
20:44the space used.
20:46The parameters can all be used from here, but we take
20:50Use Space, yes.
20:56By default, the Home Assistant does not know how to get
21:00you this information.
21:02I always thought how to make it as simple as possible for you.
21:07And I got an idea.
21:10What do you have to do?
21:11First and foremost,
21:13know the name of the sensor.
21:15The name of the sensor is this.
21:19Yes. So you go on it.
21:21And from here you can get the name of the sensor.
21:27The simplest,
21:29the most simple on earth,
21:31from my point of view,
21:33is to help you with AI.
21:35And now let's talk a little bit
21:37with ChatGPTU.
21:41And we'll tell it like this.
21:56Isolome.
22:15Isolome.
22:19Entity ID.
22:27Content.
22:36Content.
22:41Content.
22:52Content.
22:56Content.
23:18He, for example, made me here just for
23:21D.
23:23In order not to complicate things,
23:27we'll say
23:323
23:36M
23:38and
23:40follow sim
23:46%
23:53%
24:05And he created
24:07what we
24:09need.
24:11This is
24:13the template we need.
24:15We copy it.
24:18We go to Home Assistant.
24:21File Editor.
24:23We run it.
24:27And we add in Configuration
24:29this
24:31code that we copied
24:33from
24:35ChatGPT.
24:37We save.
24:39And of course we need
24:41a
24:43restart.
24:51Of course,
24:53if you need, you can extract
24:55the free space.
24:57Just for fun, you understood the idea,
24:59I showed you the space used,
25:01because that came to my mind faster.
25:08And now, once everything is restarted,
25:10if we go here,
25:12and
25:18let's say we add
25:20a card of this type.
25:23And here we say
25:33we have space used
25:35D.
25:37It tells us
25:39how many percent
25:41let's add
25:46space used
25:48E, for example.
25:52I make a mistake, I don't know why.
26:06I have to see why.
26:08The idea is that
26:10it works.
26:12As you can see,
26:16and we have it here.
26:18You can,
26:20as you know, edit the card here.
26:26By default it's 0,100.
26:30You can, for example,
26:32consider
26:34yellow, let's say, from 50%.
26:36Red from
26:3875%.
26:40And save.
26:42Done.
26:44Yes.
26:48As a recommendation,
26:50when you do
26:54here in
26:56File Editor,
26:58be careful
27:06and do them
27:08one by one, one by one.
27:14It is done well, now what I did wrong
27:16doing on speed 5
27:18unimportant,
27:20but you understood the idea.
27:22The simplest,
27:24either you make a template,
27:26write here sensor,
27:28take
27:30this information,
27:32it's easy to write,
27:34I did it by hand usually.
27:36Of course, once
27:38you've done it, you can copy it,
27:40put it down, just modify
27:42some parameters.
27:44Be careful
27:46at
27:48page arrangement, you know that
27:50email is sensitive to
27:52page arrangement.
27:54You have nothing
27:56to do wrong here.
28:00Now,
28:02let's see
28:04with the network card part.
28:08As you know,
28:10we take from here
28:12the name of the sensor,
28:14let's try
28:16with cgpt, I'll take it from the beginning.
28:20I have
28:24the
28:38extra line
28:50so
28:52we find the speed
28:54under the name of
29:00speed bytes per second.
29:22Let's
29:30copy the code.
29:36Here I will show you something.
29:44As you can see, it will be red.
29:46Whatever you do, it will be red.
29:48Why?
29:50Because the template
29:52exists.
29:56And then we delete
29:58this part.
30:00And as you can see, it's already
30:02green.
30:04I haven't tested, I'm not sure
30:06if it works from the first time, so
30:08let's assume it.
30:10And we speed up the laptop connection.
30:12We restart
30:16Home Assistant.
30:20And
30:38let's see if
30:40it works.
30:42Let's do
30:44entity
30:46speed
30:48connection
30:50save
30:52We wait a little
30:54to get the information.
31:06As you can see,
31:10they gave it to us in bytes per second.
31:12And
31:14let's see if I can
31:16pronounce it.
31:22megabytes
31:24mbpc
31:30mbpc
31:42As you can see,
31:46the only thing we have to do
31:48is change
31:52the unitary measure
31:54so I will take
31:58this code
32:02we go to
32:06pronounce
32:12And we will replace it, as I said.
32:21We save.
32:25And we give it a restart.
32:34We create a card.
32:42And as you can see, it is in megabits per second.
32:59Yes.
33:00You can, if you want, not to complicate yourself, but as I said, it is not complicated at all, you can, of course, activate these things anytime and visualize them in developer tools, as you can see, I have them here, for example.
33:30Here you have to search, like this, VLAN, what the sensor says, the state and all the information.
33:45If you don't want to complicate your life, you give this information to chatGPT, you tell it what you want it to extract and it creates the card for you, nothing complicated, from my point of view.
34:01Well, that's about it.
34:06As you have seen, neither easy nor complicated, a long tutorial came out, from my point of view, too long, that's what you have to do here.
34:18In the end, I want to thank those who subscribed to my YouTube channel, as well as those who watched, those who want to subscribe and so on.
34:28I want to thank you for the support of those who comment, who send me messages, I guess from the site, I guess it doesn't matter, who I consider deserves to be answered, I will do it, who I consider deserves to be answered, in the sense that it has a meaning, not something else.
34:50That's about it, I'm Remus, see you in the next tutorial.