Starting!

Hello Everyone!

On the air, Andrew Romanenko. I am an IT Architect and Instructor. My main specialization and area of professional interests is Virtualization, Cloud Technologies, Infrastructure as a Code and everything that has to do with this topic.

This Blog is an attempt to systematize, summarize and digitize everything that has accumulated in the form of paper diaries, electronic notes, documents, and just the sudden thoughts that have come over the last 20 years. Some notes will be dated as they are written.

I would be glad if every visitor finds something useful here.

Sincerely, Andrew.

P.S. List of study areas and courses, which I can teach is on the Training page. Contact information will be available on the About Me page.

Posted in General | Tagged , , | Leave a comment

Azure VMware Solution. Part 1. Introduction. What is Azure VMware Solution? Cluster and hosts. Networks. Monitoring. The next steps.

Introduction


Hello to all readers of the blog about Architecture and Training.

Today we will talk about a joint technological solution of two irreconcilable, at first glance competitors – Microsoft and VMware. Azure VMware Solution will allow you to combine your usual VMware tools and technologies and the breadth and power of Microsoft Azure cloud services.

Let’s take a look at this hybrid solution from VMware and Microsoft, and try to take a deeper look at how these technologies work.

What is Azure VMware Solution?


So what is Azure VMware Solution?

Azure VMware Solution gives us the ability to use the private cloud model in Azure data centers. With the help of the self-service portal and together with Azure Resource Manager, we are deploying a cluster of three hardware hyper-converged servers, to which you can later add up to 16 more nodes. This environment will be managed through the usual management tool – VMware vCenter Server, and in the case of a virtual network using NSX Manager. Also included in this decision are such mandatory components of the Software Defined Data Center as vSAN and NSX-T.

The goal of this approach is to easily transfer workloads from your on-premises infrastructure, and easily integrate with popular Azure services such as Azure Web Applications or Azure SQL Databases.

It should also be noted that the list of operating systems that can be deployed in the VMware environment is much larger than in Microsoft Hyper-V, on which the Azure virtualization stack is built.

Cluster and hosts


As mentioned above, the hosts that make up the cluster are hyper-converged, bare metal. These are two-processor Intel Xeon Gold 6140 platforms with a clock speed of 2.3 GHz. The amount of RAM reaches 0.5 TB. In addition, hosts have two groups of disks to build vSAN – 15 TB SSD for data and 3 TB NVME for cache.

Networking


Because Azure VMware Solution is a private cloud environment, it must be accessible from local or Azure resources. This can be achieved through services such as Azure ExpressRoute, VPN connection, or Azure Virtual WAN.

When a private cloud is deployed, private networks for management, provisioning, and vMotion get created.

Access control and security


Azure VMware Solution Private Clouds use vSphere-based access control to increase security and integrate vSphere SSO LDAP with Azure Active Directory.

VSAN data encryption is enabled by default and is used to secure the vSAN data.

Monitoring


After deploying Azure VMware Solution, as with other Azure services, they are affected by Azure Monitor. With the help of which you can have an understanding of the state of health of your services, collect and analyze metrics and logs. For Linux and Windows virtual machines, you can install a special Monitoring agent and use standard or customized dashboards to control the required parameters.

The next steps


 Let me remind you that we recently reviewed this free resource from VMware in the series of articles “VMware Practice. Season 2021-2022”.

Thus, the next step of practical acquaintance with Azure VMware Solution technology is the service of practical laboratories – VMware Hands-on Labs.

But, I will tell about it in the following article.

See you on the air a few days,
Sincerely, AIRRA

Posted in Azure, Microsoft, Solution, Technology, Virtualization, VMware | Tagged , , , , , , , , | Leave a comment

VMware vRealize Operations Manager. Scripting and programming. Part 1. Introduction. Laboratory Environment. First Steps with Power CLI.

Introduction


Hello to all readers of the blog about SDDC and Architecture, Solution, Implementation and Operations as Code.

Today we will talk about such a conceptual approach as Operation as Code, as part of the strategy Anything as Code.

And I will use these features for a product like VMware vRealize Operations Manager, from VMware Realize Suite. Part of this material was written long ago, for version 6.x, but even today has not lost its relevance. I will start my story with the simple technologies of VROPs 6.x and gradually move to the 7.x and 8.x versions, gradually complicating the material.

We will need a laboratory environment to understand and test the code that will be published. So let’s start with his brief description.

Laboratory Environment


Posted in Uncategorized | Leave a comment

VMware Practice. Season 2021-2022. Part 1. Introduction. Practice. What is HOL (Hands-on Labs)?. Hands-on Labs types.

Introduction


Hello to all readers of the blog about IT Architecture and Learning!

Last year we published a series of articles “VMware Practice. Year 2020”. VMware recently released an updated catalog of Hands-On Labs.

So, we’re starting a new series of articles called “VMware Practice. Season 2021-2022.”, in which we will consider all new Hands-On Lab of VMware and we will update the information on previous versions of Labs.

To begin with, let us briefly recall last year’s topics in this area.

Practice


Recently in the series of articles “VMware Training. Season 2021-2022” we talked about the training programs for authorized learning VMware 2021-2022 season. Today we will talk about one of the options for gaining practical skills in working with VMware technologies.

During the authorized study, students have access to the laboratory environment in which they perform tasks according to the course scenario. This is enough to gain basic technology skills. However, after the end of the course, this access is terminated, and to consolidate skills, such a laboratory must be constantly available, and training in a productive environment is a very bad idea.

There are several main options: to create a permanent laboratory or even a home one mini data center, or take advantage of a special resource from VMware – Hands-on Labs.

What is HOL (Hands-on Labs)?


So what is a HOL (Hands-on Labs)?

VMware Hands-on Labs provide a quick and easy way to access VMware products and solutions, testing use cases and learning about the latest features with no installation required. There are no special hardware or licenses needed. VMware Hands-on Labs delivers a real, virtualized infrastructure in the cloud using VMware managed infrastructure including vCloud Foundation, vRealize Operations, VMware Learning Platform, Wavefront and more. Best of all, they are provided at no charge and you only need a modern browser to run them. All labs are created by product experts, documented and supported by the VMware Hands-on Labs team and community.

Hands-on Labs types


In general, there are three types of Hands-on Labs:

  • Lightning Labs;
  • Comprehensive Labs;
  • Odyssey Game Labs.

Lightning Labs – The quickest and easiest way to experience VMware products in 30-minutes or less. Lightning Labs help you experience and evaluate VMware products in small segments of time. “Bite-sized” labs allow you to learn about core product features quickly!

Comprehensive Labs – Dive deep into VMware products features and capabilities with full guided labs. Experience the full range of VMware products and learn about new features. Up and running on any browser in minutes and 100% free. No installation, licenses, or special hardware required. Relevant content available and updated year round.

Odyssey Game Labs – Test your knowledge and skills of VMware products by completing tasks. Where will you rank on the leaderboard? VMware Odyssey are short tasks that challenge your knowledge of VMware products and solutions. Go against the clock and players online to top the leaderboard! Get instant feedback on your progress. Sharpen your skills and showcase your technical expertise.

Brief Summary


So, from this short publication you learned about VMware Hands-on Labs, about the types of labs. Since this resource is absolutely free, and only a modern browser is required for access, I advise you to bookmark the address of the resource “VMware Hands-on Labs” and quickly register and read a fairly large catalog of laboratory work.

And in the next publication, we will talk about the main available laboratory work in the direction of Lightning Labs, for a quick introduction to the technologies of VMware.

Follow the news until the meeting is on air in a few days.
Sincerely, AIRRA.

Posted in Education, Practice, Technology, Training, Virtualization, VMware | Tagged , , , , , , , , | Leave a comment

VMware Training. Season 2021-2022. Part 2. Authorized Training: Multi-Cloud. vSphere.

Introduction


Hello to all readers of the blog about IT Architecture and Learning!

In the previous article of the series “Learning VMware. Season 2021-2022.” we considered a list of areas and specifics of authorized learning VMware.

Today we will talk about the main training programs in the field of Multi-Cloud.

Direction of training – Multi-Cloud includes training programs on VMware vSphere 7, vSAN, Site Recovery Manager, VMware Cloud Foundation, VMware Intergrated OpenStack, vRealize Suite Lifecycle Manager, Automation, Orchestrator, Operations, Log Insight, VMware Cloud Director technologies.

The number of training programs on these products is quite large, so today we will talk only about the direction of the VMware Sphere 7.

VMware vSphere 7


VMware vSphere is server virtualization software and the heart of a Software-Defined Data Center (SDDC) that helps you run, manage, connect and secure applications in a shared cloud operating environment.

New version of vSphere 7 – the biggest innovation since the launch of ESXi – Unified management technology for Containers and VMs.

The main current training programs for vSphere 7 technologies are:

VMware Data Center Virtualization: Core Technical Skills

  • Duration: 4 days.
  • Level of difficulty: Professional.
  • Target audience: Administrators, Operators.
  • Prerequisites: Working knowledge of operating systems and Understanding of basic network, storage, and computer hardware concepts.
  • Certification: Attending this course is recommended to achieve the following certification: VMware Certified Technical Associate – Data Center Virtualization (VCTA-DCV).

This four-day, hands-on training course is an introduction to VMware vSphere. In this course, you acquire the skills needed to perform Day 2 operational tasks that are typically assigned to the roles of operator or junior administrator in a vSphere environment.

● VMware vSphere: What’s New [V6.7 to V7]

  • Duration: 3 days.
  • Level of difficulty: Professional.
  • Target audience: Administrators, Operators.
  • Certification: Attending this course allows candidates who hold a valid VCP-DCV 2019 to upgrade to VCP-DCV 2020 without taking the certification exam.

In this three-day, hands-on training course, you explore the new features and enhancements in VMware vCenter Server 7 and VMware ESXi 7. Real-world use-case deployment scenarios, hands-on lab exercises, and lectures teach you the skills that you need to effectively implement and configure VMware vSphere 7. This course is recommended for customers who want to deploy vSphere 7 in their existing vSphere environment.

● VMware vSphere: Install, Configure, Manage [V7]

  • Duration: 5 days.
  • Level of difficulty: Professional.
  • Target audience: Administrators, Operators.
  • Prerequisites: System administration experience on Microsoft Windows or Linux operating systems.
  • Certification: Attending this course meets the training requirement to achieve the following certification: VMware Certified Professional – Data Center Virtualization (VCP-DCV).

This five-day course features intensive hands-on training that focuses on installing, configuring, and managing VMware vSphere 7, which includes VMware ESXi 7 and VMware vCenter Server 7. This course prepares you to administer a vSphere infrastructure for an organization of any size. This course is the foundation for most of the other VMware technologies in the software-defined data center.

● VMware vSphere: Advanced Administration Workshop [V7]

  • Duration: 5 days.
  • Level of difficulty: Advanced.
  • Target audience: Senior Administrators, Implementers and Consultants, Architects.
  • Prerequisites: Completion of VMware vSphere: Optimize and Scale [V7] course; VMware Certified Professional – Data Center Virtualization (VCP-DCV) certification; System administration experience on Microsoft Windows or Linux operating systems
  • Certification: The course aligns fully with the VMware Certified Advanced Professional – Data Center Virtualization Deploy exam objectives.

This five-day course provides hands-on training to equip students with a range of skills: from performing routine VMware vSphere 7 administrative tasks to complex vSphere operations and configurations. Through lab-based activities, students are immersed in real-life situations faced by VMBeans, a fictitious company. These situations expose students to real-life scenarios faced by companies that are building and scaling their virtual infrastructure.

This course uses scenario-based lab exercises and does not provide guided step-by-step instructions. To complete the scenario-based lab exercises, you are required to analyze the task, research, and deduce the required solution. References and suggested documentation are provided.

Approximately 90% of the class is application-focused and taught through labs.

● VMware vSphere: Optimize and Scale [V7]

  • Duration: 5 days.
  • Level of difficulty: Advanced.
  • Target audience: Senior Administrators, Implementers and Consultants, Architects.
  • Prerequisites: Understanding of concepts presented in the VMware vSphere: Install, Configure, Manage course.
  • Certification: Attending this course meets the training requirement to achieve the following certification: VMware Certified Professional – Data Center Virtualization (VCP-DCV).

This five-day course teaches you advanced skills for configuring and maintaining a highly available and scalable virtual infrastructure. Through a mix of lecture and hands-on labs, you configure and optimize the VMware vSphere 7 features that build a foundation for a truly scalable infrastructure, and you discuss when and where these features have the greatest effect. Attend this course to deepen your understanding of vSphere and learn how its advanced features and controls can benefit your organization..

● VMware vSphere: Troubleshooting [V7]

  • Duration: 5 days.
  • Level of difficulty: Advanced.
  • Target audience: Senior Administrators, Implementers and Consultants, Architects.
  • Prerequisites: VMware vSphere: Install, Configure, Manage. Experience in working with a command-line interface is highly recommended, as is completion of VMware vSphere: Optimize and Scale.
  • Certification: Attending this course meets the training requirement to achieve the following certification: VMware Certified Professional – Data Center Virtualization (VCP-DCV). Attending this course is also recommended if you aim to achieve the following certification: VMware Certified Advanced Professional – Data Center Virtualization (VCAP-DCV) Deploy.

This five-day, hands-on training course provides you with the advanced knowledge, skills, and abilities to achieve competence in troubleshooting the VMware vSphere 7.x environment. This workshop increases your skill and competence in using the command-line interface, VMware vSphere Client, log files, and other tools to analyze and solve problems.

● VMware vSphere: Fast Track [V7]

  • Duration: 5 days.
  • Level of difficulty: Advanced.
  • Target audience: Senior Administrators, Implementers and Consultants, Architects.
  • Prerequisites: System administration experience on Microsoft Windows or Linux operating systems.
  • Certification: Attending this course meets the training requirement to achieve the following certification: VMware Certified Professional – Data Center Virtualization (VCP-DCV).

This five-day, intensive course takes you from introductory to advanced VMware vSphere 7 management skills. Building on the installation and configuration content from our best-selling course, you will also develop advanced skills needed to manage and maintain a highly available and scalable virtual infrastructure. Through a mix of lecture and hands-on labs, you will install, configure and manage vSphere 7. You will explore the features that build a foundation for a truly scalable infrastructure and discuss when and where these features have the greatest effect. This course prepares you to administer a vSphere infrastructure for an organization of any size using vSphere 7, which includes VMware ESXi 7 and VMware vCenter Server 7.

● VMware vSphere: Optimize and Scale plus Troubleshooting Fast Track [V7]

  • Duration: 5 days.
  • Level of difficulty: Advanced.
  • Target audience: Senior Administrators, Implementers and Consultants, Architects.
  • Prerequisites: Completion of the VMware vSphere: Install, Configure, Manage [V7] course Or Equivalent knowledge and administration experience with ESXi and vCenter Server. Experience in working at the command prompt is highly recommended.
  • Certification: Attending this course meets the training requirement to achieve the following certification: VMware Certified Professional – Data Center Virtualization (VCP-DCV).

This five-day, accelerated, hands-on training course is a blend of the VMware vSphere: Optimize and Scale and VMware vSphere: Troubleshooting courses. This Fast Track course includes topics from each of these advanced courses to equip experienced VMware administrators with the knowledge and skills to effectively optimize and troubleshoot vSphere at an expert level.

Attend a VMware delivered Fast Track course and receive a free VCP Exam voucher to use toward certification.

● VMware vSphere: Design [V7]

  • Duration: 3 days.
  • Level of difficulty: Advanced.
  • Target audience: Implementers and Consultants, Architects.
  • Prerequisites: Completion of the VMware vSphere: Install, Configure, Manage and VMware vSphere: Optimize and Scale courses.
  • Certification: This course is recommended if you aim to achieve the following certification: VMware Certified Advanced Professional – Data Center Virtualization (VCAP-DCV) Design.

This three-day training course equips you with the knowledge, skills, and abilities to design a VMware vSphere 7 virtual infrastructure. You follow a proven approach to design a virtualization solution that ensures availability, manageability, performance, recoverability, and security, and that uses VMware best practices. This course discusses the benefits and risks of available design alternatives and provides information to support making sound design decisions. Given a case study, you practice your design skills by working with peers on a design project.

Brief Summary


In this article, we are introduced to training programs in the direction of Multi-Cloud: VMware vSphere 7.

In the next publication of the cycle “VMware Training. Season 2021-2022” we will talk about training programs in Multi-Cloud: VMware vSAN directions.

Follow the news until the meeting is on air in a few days.
Sincerely, AIRRA.

Posted in Education, Technology, Training, Virtualization, VMware | Tagged , , , , , , , , , , , , , , , , , , , | Leave a comment

VMware Training. Season 2021-2022. Part 1. Introduction. Authorized Training. Learning Paths.

Introduction


Hello to all readers of the blog about IT Architecture and Learning!

Last year we published a series of articles “VMware Learning. Year 2020”. Vmware recently released an updated “VMware Learning Course Catalog October – December 2021“.

So, we’re starting a new series of articles called “Learning VMware. Season 2021-2022.”, in which we will consider all new educational directions of VMware and we will update the information on previous versions of courses.

To begin with, let us recall the features of authorized training.

Authorized Training


Authorized training from the vendor is a pointer to the best way to master this or that technology. Training programs vary in duration, difficulty level, target audience, training format. Given the trends of recent events in the world, training centers will have to reorient themselves mainly to online learning.

The main components of authorized training are branded textbooks, access to the laboratory environment during training, certified instructors. The training programs themselves are focused on official international certification and are based on new versions of products and technologies, reflect the latest advances in virtualization and cloud technologies in VMware. The content of the Authorized trainings of the last generation have a practice-oriented nature and form the professional competencies of the specialist. VMware provides an equally high level of education, regardless of the location of the training center, controls the content of courses, provides educational and methodological and technical support. There is a system and regulations for training and certification of instructors. An independent certification system allows course participants to obtain internationally recognized documents. Different forms of training allow students to choose the most convenient training option.

To understand the list of training programs and directions, you must visit the official resource: VMware Learning and the corresponding section with the areas of study: Learning Paths.

Learning Paths


In the last school season 2020-2021 in Vmware Education were formed four major product areas of study:

  • Data Center Virtualization & Hybrid Cloud Infrastructure;
  • Network Virtualization & Security;
  • Virtualization & Cloud Management Platform;
  • Desktop, Application Virtualization & Mobility.

Now there are five such major product areas:

  • Multi-Cloud;
  • Virtual Cloud Network;
  • Digital Workspace;
  • App Modernization;
  • Intrinsic Security.

Brief Summary


In this article, we have read the list of areas and specifics of authorized training VMware. In the next post, we will learn about Multi-Cloud training programs.

Follow the news until the meeting is on air in a few days.
Sincerely, AIRRA.

Posted in Education, Technology, Training, Virtualization, VMware | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment

My Smart Home. Step by step from start to… Part 4. Implementation based on Home Assistant. The first steps. Hardware and Software Health sensors, Integrations, Add-ons.

Step by step…


Congratulations to all who have been looking forward to the next post in the series “My Smart Home. From the beginning, Step by step to… ”. At the moment we have a working copy of the Home Assistant. From the software applications we have the File Editor and Terminal. We made the first settings in the configuration.yaml configuration file and updated the system to the current version.

Today we will talk about Sensors for monitoring the parameters of the hardware system – Raspberry Pi Power Quality Control Sensor and Processor Temperature sensor. It is also important to know about the health of the software part of the Home Assistant system: we configure the Sensors to monitor the status of the Processor, Memory, Disk and Network. Home Assistant stores the collected data in a database, so we will monitor the growth of its volume with an appropriate sensor. With the help of integration, we will control the Internet connection. We will also configure communication with external devices: configure the control sensors of the Uinterruptible Power Supply.

So, get comfortable, it will be interesting!

Sensors for monitoring system parameters.


All the functioning of our Smart Home depends on the reliable work of the Home Assistant. We entrust control of the basic parameters to the corresponding sensors. Of the hardware, it is the Raspberry Pi power quality control sensor and the processor temperature sensor. From software, – control of loading of the processor, memory, a disk, a network. It is also important to control Internet access settings.

Let’s start with hardware sensors.

● ● ●

Raspberry Pi Power Quality Control Sensor.

On all models of Raspberry Pi since the Raspberry Pi B+ (2014) except the Zero range, there is low-voltage detection circuitry that will detect if the supply voltage drops below 4.63V (+/- 5%). This will result in a warning icon being displayed on all attached displays and an entry being added to the kernel log.

Raspberry Pi Power Supply Checker is based on this algorithm. In the Home Assistant, it is activated by adding the integration component of the same name.

To add this component to the integration, use the Configuration menu, Integration tab. Choose + Add Integration:

Figure 1: We begin the stage of adding and configuring the integration component
Raspberry Pi Power Supply Checker.

In the new window Set up a new integration in the search field enter Rasp. The search result should be displayed as a found integration component Raspberry Pi Power Supply Checker:

Figure 2: Search for the integration component Raspberry Pi Power Supply Checker.

We confirm the installation of the Raspberry Pi Power Supply Checker integration component:

Figure 3: Request to confirm the installation of the Raspberry Pi Power Supply Checker integration component.

If the Raspberry Pi Power Supply Checker is successfully installed, we receive the following message:

Figure 4: Raspberry Pi Power Supply Checker is successfully installed:

And the newly installed component will appear in the list of integrations:

Figure 5: List of installed integration components in which the newly installed Raspberry Pi Power Supply Checker appeared.

Select the link – 1 entity, and on the Entity tab we will get the filter of integration elements “Raspberry Pi Power Supply Checker”:

Figure 6: Filtered integration elements “Raspberry Pi Power Supply Checker”.

Let’s select this filtered element and find out some of its parameters in the RPi Power Status pop-up window. We are primarily interested in Entity ID: binary_sensor.rpi_power_status. Let’s write down this meaning for ourselves, we will need it later.

Figure 7: Basic parameters of the integration element “Raspberry Pi Power Supply Checker”.

We will also open another RPi Power Status pop-up window using the icon at the top right. But we will see the status of the sensor, and the message that the history of the change has already begun to work, and events in the logbook are not yet found. This is normal because the state of the sensor has not changed since installation.

Figure 8: RPi Power sensor status and change history.

This concludes the work with this element of integration. A little later, we will adjust the display of this sensor on the Lovelace panels of the Home Assistant.

● ● ●

Raspberry PI 4 Processor Temperature sensor.

Our copy of the Raspberry Pi will be housed in a case mounted on a din rail of the electrical switchboard. Therefore, the issue of cooling is very important. Before choosing a cooling strategy, let’s evaluate the actual values of the temperature sensor of the Raspberry PI 4 Processor. Especially since Home Assistant himself has every opportunity to do so.

So, let’s create a temperature sensor for the Raspberry PI 4 processor. To do this, add the following code section to the configuration.yaml file:

sensor:
 - platform: command_line
   name: RPi CPU Temperature
   command: "cat /sys/class/thermal/thermal_zone*/temp"
   unit_of_measurement: "°C"
   value_template: '{{ value | multiply(0.001) | round(1) }}'
Figure 9: Raspberry PI 4 processor temperature sensor settings in the configuration.yaml configuration file.

Let’s check the configuration:

ha core check
Figure 10: Check the configuration of the Home Assistant OS.

And reboot the system.

ha core restart
Figure 11: Restart the Home Assistant Core to apply the new settings.

Check the presence of the added sensor in the Configuration menu on the Entities tab.

Figure 12: Check the availability of the Raspberry PI 4 processor temperature sensor in Entities list.

Select this item and immediately open another RPi CPU Temperature pop-up using the icon at the top right. There we will see the temperature values that the sensor recently measured as well as the historical data.

Figure 13: Information about RPi CPU Temperature sensor data.

This concludes the work with this sensor. A little later, we will adjust the display of this sensor on the Lovelace panels of the Home Assistant.

● ● ●

Processor Monitoring Sensors.

Now let’s move from the hardware level of monitoring to software. We will be interested in the health parameters of such components of the Home Assistant OS as: Processor, Memory, Disks and Network.

Home Assistant has a built-in special platform called System Monitor with a set of sensors to monitor the local system. System Monitor allows you to monitor CPU usage and temperature, RAM and disk usage, traffic on network interfaces.

We will not immediately add all possible resource sensors to the monitoring. Let’s do it gradually, and start with CPU load sensors and system load sensors for the last 1 minute, 5 minutes, 15 minutes.

To activate the System Monitor platform and start collecting monitoring data in the configuration.yaml configuration file, add the following code:

sensor:
 - platform: systemmonitor
   resources:
     - type: processor_use
     - type: load_1m
     - type: load_5m
     - type: load_15m
Figure 14: We add the activation code of the System Monitor platform to monitor CPU load and system load for the last 1 minute, 5 minutes, 15 minutes.

After adding the parameters, check the configuration and reboot the system, as described above.

Important: In the Home Assistant version of 2021.12, the design of the Configuration section has been changed:

Figure 15: New design of the Configuration section Home Assistant interface.

Therefore, to check the operation of the added sensors, go to the already known section of the Configuration menu, Now the section is called Devices and Services, and the name of the Entities tab remains unchanged.

Here we will see recently added sensors:

Figure 16: New added processor load and system load sensors for the last 1 minute, 5 minutes, 15 minutes.

Similar to the above steps, open the Processor Use pop-ups with information about the status of the sensor and the collected data in historical terms.

Figure 17: Information about the status of the Processor Use sensor and the collected data in historical terms.

Perform similar steps for Load (1m), Load (5m), Load (15m) sensors.

Figure 18: Information about the status of the Load (1m) sensor and the collected data in historical terms.
Figure 19: Information about the status of the Load (5m) sensor and the collected data in historical terms.
Figure 20: Information about the status of the Load (15m) sensor and the collected data in historical terms.

This concludes the work with these sensors. A little later, we will adjust the display of these sensors on the Lovelace panels of the Home Assistant.

● ● ●

Memory Monitoring Sensors.

Now let’s move on to configuring and testing the memory usage monitoring sensors. Add a few more lines to the code we added above:

     - type: memory_use_percent
     - type: memory_use
     - type: memory_free
Figure 21: Add parameters to monitor usage and free memory capacity in the configuration.yaml file.

After adding the parameters, you should check the configuration again and reboot the system, as described above.

To check the operation of the added sensors, go to the already known section of the Configuration menu, Devices and Services section, Entities tab. Here we will see recently added sensors:

Figure 22: New added sensors to monitor memory usage, percentage and free capacity.

Similar to the above steps, open the “Memory use (persent)”, “Memory use”, “Memory free” pop-ups with information about the status of the sensor and the collected historical data.

Figure 23: Information about the state of the Memory use (persent) sensor and the collected data in historical terms.
Figure 24: Information about the state of the Memory use sensor and the collected data in historical terms.
Figure 25: Information about the state of the Memory free sensor and the collected data in historical terms.

This will similarly complete the work with these sensors. A little later, we will adjust the display of these sensors on the Lovelace panels of the Home Assistant.

● ● ●

Disk Monitoring Sensors.

The next step is to configure and test the disk usage and swap file sensors. Add a few more lines to the code we added above:

     - type: disk_use_percent
     - type: disk_use
     - type: disk_free
     - type: swap_use_percent		
     - type: swap_use		
     - type: swap_free
Figure 26: Add parameters to monitor disk usage and swap file in the configuration.yaml file.

After adding the parameters, you should check the configuration again and reboot the system, as described above.

The test is similar to the steps described above: In the Configuration menu, Devices and Services section, on the Entities tab, we will see the recently added sensors:

Figure 27: New added sensors to monitor disk usage, percentage and free capacity.
Figure 28: New added sensors to monitor swap file usage, percentage and free capacity.

Similar to the above steps, open the “Disk use / “, “Disk use / (percent)“, “Disk free /”, “Swap use“, “Swap use (percent)“, “Swap free” pop-ups with information about the status of the sensor and the collected data in historical terms.

Figure 29: Information about the state of the Disk use / sensor and the collected data in historical terms.
Figure 30: Information about the state of the Disk use / (percent) sensor and the collected data in historical terms.
Figure 31: Information about the state of the Disk free / sensor and the collected data in historical terms.
Figure 32: Information about the state of the Swap use sensor and the collected data in historical terms.
Figure 33: Information about the state of the Swap use (percent) sensor and the collected data in historical terms.
Figure 34: Information about the state of the Swap free sensor and the collected data in historical terms.

This will similarly complete the work with these sensors. A little later, we will adjust the display of these sensors on the Lovelace panels of the Home Assistant.

● ● ●

Network Monitoring Sensors.

Finally, the last group of sensors in the System Monitor platform is network monitoring sensors. But before adding the code to the configuration file, you need to find out the required parameter – the alias of the network interface.

This can be done with the following command:

ha network info
Figure 35: We get information about the alias of the network interface.

And now, to the code we added above, we add a few more lines, using the alias just clarified as an argument:

     - type: network_in
       arg: enp2s0
     - type: network_out
       arg: enp2s0
     - type: throughput_network_in
       arg: enp2s0
     - type: throughput_network_out
       arg: enp2s0
     - type: packets_in
       arg: enp2s0
     - type: packets_out
       arg: enp2s0
Figure 36: Add parameters to monitor network interface in the configuration.yaml file.

After adding the parameters, you should check the configuration again and reboot the system, as described above.

The test is similar to the steps described above: In the Configuration menu, Devices and Services section, on the Entities tab, we will see the recently added sensors:

Figure 37: New added sensors to monitor Network interface of Home Assistant OS.

Similar to the above steps, open the “Network in enp2s0”, “Network out enp2s0”, “Network throughput in enp2s0”, “Network throughput out enp2s0“, “Packets in enp2s0“, “Packets out enp2s0” pop-ups with information about the status of the sensor and the collected data in historical terms.

Figure 38: Information about the state of the Network in enp2s0 sensor and the collected data in historical terms.
Figure 39: Information about the state of the Network out enp2s0 sensor and the collected data in historical terms.
Figure 40: Information about the state of the Network throughput in enp2s0 sensor and the collected data in historical terms.
Figure 41: Information about the state of the Network throughput out enp2s0 sensor and the collected data in historical terms.
Figure 42: Information about the state of the Packets in enp2s0 sensor and the collected data in historical terms.
Figure 43: Information about the state of the Packets out enp2s0 sensor and the collected data in historical terms.

This will similarly complete the work with System Monitor sensors. We have considered the full range of sensors on this platform. A little later we will adjust the display of all sensors on the lovelace panels of the Home Assistant. And now let’s move on to monitoring another important component of Home Assistant.

Home Assistant Database Size monitoring.


Monitoring the size of the Home Assistant database is very important. The database will expand during long-term use and after adding a significant amount of integration. The larger the database, the more SQLite read and write operations, which means that Home Assistant slows down. Extreme I / O will increase the load on the SD card, which means their accelerated degradation and failure.

In the default configuration, Home Assistant keeps a history of all events and states for all objects for approximately 10 days. This data provides the functions of History and  Logbook. The data itself is stored using the Recorder integration, which by default writes it to the SQLite database file located in /config/home-assistant_v2.db.

The topic of database tuning is beyond the scope of this publication, but I promise that we will return to this issue later. For now, we will focus only on the process of monitoring the size of the database.

We add such code to the configuration.yaml file:

homeassistant:
  allowlist_external_dirs:
    - "/config"
sensor:
  - platform: filesize
    file_paths:
      - /config/home-assistant_v2.db
    scan_interval: 1800
Figure 44: Add parameters to monitor Home Assistant Database Size in the configuration.yaml file.

This sensor will be updated every half minute. Because each state change will add a couple of lines to the recorder’s database, we reduce the refresh rate with the scan_interval parameter.

After adding the parameters, you should check the configuration again. But to use them, this time you need to restart the host. This can be done with the following command:

ha host reboot

After rebooting, perform the verification in the same way as above: In the Configuration menu, Devices and Services section, on the Entities tab, we will see the recently added sensor:

Figure 45: New added sensor to monitor the size of the Home Assistant database.

Select this item, and immediately open another pop-up home-assistant_v2.db using the icon at the top right. There we will see the size of the Home Assistant database, which recently measured the sensor as well as historical data. You can see the attributes of the sensor:

Figure 46: Information about the Home Assistant Database Size monitoring sensor data.

This will similarly complete the work with the Home Assistant database size monitoring sensor. A little later, we will adjust the display of this sensor on the Lovelace panels of the Home Assistant.

Internet connection monitoring.


Another important parameter for constant monitoring is the quality of the Internet connection. It’s simple. Home Assistant has the ability to control these parameters using the integration component of Speedtest.net.

It is very easy to install. Go to the already familiar menu Configuration, section Devices and Services, Integration tab. We add a new Integration: + Add Integration. In the popup window Set up a new integration in the search field enter speedtest.net:

Figure 47: Installation of the integration component Speedtest.net.

After confirmation of the installation in a short period of time we will receive a message about the successful operation.

Figure 48: The integration component of Speedtest.net has been successfully installed.

After the successful installation of the speedtest.net integration component, we will see it in the list.

Figure 49: The integration component of speedtest.net is in the list of installed integrations.

Choose the link 3 entities. And we will see the filtered three sensors.

Figure 50: List of sensors of the integration component of Speedtest.net.

Similar to the steps described above in this article, we will open pop-ups “SpeedTest Ping“, “SpeedTest Download“, “SpeedTest Upload” with information about the status of the sensor and the collected data in historical terms.

Figure 51: Information about the state of the SpeedTest Ping sensor and the collected data in historical terms.
Figure 52: Information about the state of the SpeedTest Download sensor and the collected data in historical terms.
Figure 53: Information about the state of the SpeedTest Upload sensor and the collected data in historical terms.

This will similarly complete the work with the monitoring sensors of the Internet connection. A little later, we will adjust the display of these sensors on the lovelace panels of the Home Assistant.

Uninterruptible power supply monitoring.


The operation of smart home algorithms primarily depends on a reliable power supply. Our Home Assistant on the Raspberry Pi platform will be connected to the uninterruptible power supply. Therefore, our next step is to set up monitoring of this device.

First, let’s add the Network UPS Tools integration package. To do this, in the Supervisor menu, Dashboard tab, select Add-On Store:

Figure 54: We begin the stage of adding and configuring the integration component
Network UPS Tools.

In the search field, enter the UPS:

Figure 55: Search for the integration component Network UPS Tools. No results found in Official add-ons.

Important: If the search for Network UPS Tools did not return any results, it means that there are no official components. And in the repository community, the search was not performed in the absence of the repository address parameter.

Let’s check this assumption: Call the additional menu by selecting the three-dot icon at the top right of the page. Select Repositories. Manage add-on repositories pop-up window opens:

Figure 56: There are no registered Addresses of the repository of additional integration components.

The assumption of the absence of a repository address is true. Therefore, the following address should be added: https://github.com/hassio-addons/repository.

Figure 57: We add the address of the repository of additional integration components Home Assistant.
Figure 58: The result of successfully adding the address of the repository of additional integration components Home Assistant.

Immediately after adding the above parameter, the Network UPS Tools component we need appeared in the search results:

Figure 59: Successful Search Component Integration Network UPS Tools among the repository of community Add-ons.

Next, on the Info tab, we can read current information about this component, version, and if necessary, go to the link to the page of project developers. Choose Install:

Figure 60: Start installing Network UPS Tools.

Next, check the status of the Start on boot and Auto update options. They must be turned on. A red indicator at the top right of the page indicates that the component is not running. But it’s too early to start.

Figure 61: Component installation was successful. We check the options
Start on boot and Auto update. They must be turned on.

Next you need to configure the settings of this application. To do this, go to the Configuration tab and add the following code in the Options section:

devices:
  - config: []
    driver: usbhid-ups
    name: MGEEv1150
    port: auto
mode: netserver
shutdown_host: 'false'
users:
  - actions: []
    instcmds:
      - all
    password: 'Pa$$wOrd'
    username: nut
list_usb_devices: 'true'
Figure 62: Add the configuration code of the Network UPS Tools Add-on and save the settings.

We save the settings in the Options section. And in the network section, specify the host port on which data will be exchanged between the Client and the Network UPS Tools server. Save the settings in the Network section. And start the component. If all is well, a green indicator will appear at the top right of the page and at the bottom right indicators of CPU and memory usage by this component.

Figure 63: Successful start of the Network UPS Tools Add-on.

This is the end of the work on setting up the so-called Network UPS Tools server part, but that’s not all. That’s only half the job. You still need to configure the client part so that the Home Assistant can receive data.

To do this, we need to add the appropriate integration: Network UPS Tools (NUT). This can be done similarly to the steps described above (for example in the section with SpeedTest.net).

Go to the already familiar menu Configuration, section Devices and Services, Integration tab. We add a new Integration: + Add Integration. In the popup window Set up a new integration in the search field, enter the ups:

Figure 64: Search for the Network UPS Tools (NUT) Integration Component.

Component found. Select this element and get to the Connect to the NUT server pop-up window. We only need to enter two parameters: Username and Password, which we specified in the Network UPS Tools Add-on configuration earlier.

Figure 65: Specify the access parameters of the integration component to the Network UPS Tools service.

If we did not make a mistake in the user and password parameter and the previous steps of setup are performed correctly, we will be asked to select a list of resources (sensors) for monitoring. You can choose all, I chose only the following: Battery Charge, Battery Runtime, Input Voltage, Load, Self-Test Result, Status.

Figure 66: Selection of the list of resources (sensors) for monitoring.

In the final dialog, you will be prompted to link this object to the area of your Smart Home. We will not make this binding at the moment.

Figure 67: Network UPS Tools (NUT) configuration completed successfully.

Congratulations! All our actions were performed successfully.

The list of integrations includes a new integration component Network UPS Tools (NUT), which receives data from the server.

Figure 68: New integration component Network UPS Tools (NUT) in the list of installed integrations.

Select the 40 entities link to go to the list of filtered sensors. The sensors we have selected are active, all others are off.

Figure 69: Filtered List of active and disabled sensors Network UPS Tools (NUT).

Similar to the steps described above in this article, we will open pop-ups with sensor parameters Mgeev1150 Battery Charge, Battery Runtime, Input Voltage, Load, Self-Test Result, Status and data collected in historical terms.

Figure 70: Information about the state of the Mgeev1150 Battery Charge sensor and the collected data in historical terms.
Figure 71: Information about the state of the Mgeev1150 Battery Runtime sensor and the collected data in historical terms.
Figure 72: Information about the state of the Mgeev1150 Input Voltage sensor and the collected data in historical terms.
Figure 73: Information about the state of the Mgeev1150 Load sensor and the collected data in historical terms.
Figure 74: Information about the state of the Mgeev1150 Self-Test Result sensor and the collected data in historical terms.
Figure 75: Information about the state of the Mgeev1150 Self-Test Result sensor and the collected data in historical terms.
Figure 76: Information about the state of the Mgeev1150 Status sensor and the collected data in historical terms.

This will similarly complete the work with Network UPS Tools (NUT) monitoring sensors. In the following publications, we will explain how to configure the display of these sensors on the Lovelace panels of the Home Assistant.

What’s next?


So at the moment we know about the health of the hardware, software and database of our Smart Home core. We learned how to add and customize Add-on application components and Integrations. We also have information on the status of the power supply and the parameters of the uninterruptible power supply.

Do not forget to update the system and back up.

At this stage we will pause, and in the next publication we will tell about:

  • Large-scale Hardware Upgrade Raspberry Pi 4.

But about this in the next post!

See you,
Sincerely, AIRRA!

Posted in Smart Home, Technology | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

My Smart Home. Step by step from start to… Part 3. Implementation based on Home Assistant. The first steps. Software Add-0n, Configuration File, Update

The Next Step


Greetings to all who read the series of publications “My smart home. From the beginning, step by step to… ”. In a previous article, I described the process of installing Home Assistant and its first settings.

Today we will describe how to add and configure additional software components – File Editor, Terminal. Make the first changes to the main configuration file: configuration.yaml. Let’s update Home Assistant to the current version.

So, let’s move on!

Software add-on: File editor


In Home Assistant, many parameters can be configured through the user interface, but there are enough of them, which are in the .yaml configuration files. So we need a tool to edit them.

You can find and install this official Home Assistant component by selecting the Add-on Store tab in the Supervisor section and entering the word File in the search field:

Figure 1: Search for the Text Editor component in the Supervisor section, Add-on Store tab.

Next, select Install:

Figure 2: Read the description of the component and start the installation.

Next, check the Start on boot option. It must be on. Optionally, we can enable the Show in sidebar option – display the File Editor menu in the Navigator on the left. We start the component:

Figure 3: Set the necessary options and start the component.

If the start is successful, this will be indicated by the corresponding green indicator at the top right. There will also be indicators to monitor the load of this component of the processor and memory:

Figure 4: Checking the successful start of the component.

When the File Editor component is successfully installed, open it via the link in the left navigator. Select the shortcut Browse Filesystem, and open the main configuration file: configuration.yaml:

Figure 5: Open the File Editor.
Figure 6: Open the main configuration file: configuration.yaml.

This file now contains the default settings. There are not many of them. And we will gradually make our parameters there.

Figure 7: Configuration file – configuration.yaml. Default values.

Configuration file: configuration.yaml


Let’s start editing the configuration.yaml file. Enter the following parameters:

homeassistant:
# Name of the location where Home Assistant is running
 name: Elephant Home
# Location required to calculate the time the sun rises and sets
 latitude: 50.724928
 longitude: 30.380581
# Impacts weather/sunrise data (atitude above sea level in meters)
 elevation: 109
# metric for Metric, imperial for Imperial
 unit_system: metric
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
 time_zone: Europe/Kiev

The green indicator indicates no syntax errors. Do not forget to save the configuration through the appropriate graphic menu item:

Figure 8: Enter the following parameters in the configuration.yaml file. Save the file.

After saving successfully, this graphic element will disappear:

Figure 9: Сonfiguration.yaml file saved successfully.

And to apply these added parameters, you must restart the OS Home Assistant. This can be done through the Configuration – Server Controls section:

Figure 10: Configuration and status management section of Home Assistant OS.

Select the Restart option:

Figure 11: Restart OS Home Assistant to work with new parameters.

Communication with Home Assistant will be lost for a while. After restarting and reconnecting to web services, you can perform a small check of the added settings. To do this, go to the Maps section and see the location of your smart home on the map of OpenStreetMap:

Figure 12: Location of your smart home on the map of OpenStreetMap according to the entered parameters.

Software add-on: Terminal


Before proceeding to configure various integrations, we need another software application: a Terminal.

But before you can proceed, you must enable the Advanced Mode in user profile:

Figure 13: Enable the advanced control mode of the Home Assistant OS.

Now, Find and install this official Home Assistant component is similar to how we installed File Editor, only in the search box by entering Terminal:

Figure 14: Search for the Terminal component in the Supervisor section, Add On Store tab.

Additionally, enable the option Auto update. We start a component:

Figure 15: Set the necessary parameters for this component and start it.

Similarly, after starting the component, the CPU and memory monitor indicators will appear:

Figure 16: Checking the successful start of the component.

You can check the operation of the installed application in the Terminal menu:

Figure 17: Terminal functionality in the web interface of Home Assistant OS.

Upgrading Home Assistant components


Some time has passed since the establishment of Home Assistant. Updates to this platform are released regularly. So it’s time to upgrade the system.

The whole sequence of steps can be performed in two ways – through the graphical user interface and through commands in the terminal. I will perform these actions using the console commands of OS Home Assistant.

● ● ●

Step One: System Backup.

To backup the state of the system before performing the update, use the functionality of snapshots.

We open the session of the terminal.

First, let’s learn about the list of existing snapshots:

ha snapshot list

Let’s create a new snapshot:

ha snapshot new --name snapbeforeupdate

Again, ask for a list of snapshots to see its properties:

Figure 18: Request a list of existing snapshots. Creating a new and view its properties.

● ● ●

Step Two: Check the configuration.

For a successful update, it is recommended to check the configuration of the Home Assistant OS:

ha core check
Figure 19: Check the configuration of the Home Assistant OS.

● ● ●

Step Three: Update the Home Assistant OS.

First we learn about the version number of our system:

ha os info
Figure 20: Get version number of our system.

Next, perform the update:

ha os update

After the upgrade, the system will automatically reboot. We will be informed about this by the lost connection:

Figure 21: Succesfully update OS Home Assistant and automatically Reboot system.

After reconnecting, we will receive up-to-date information about the updated version:

Figure 22: View information about the updated version Home Assistant OS.

● ● ●

Step Four: Update Home Assistant Core.

Similar to the previous step, we first learn about the number of our version:

ha core info
Figure 23: Get version number of our system and latest version number of Home Assistant Core.

Next, perform the update:

ha core update

Similarly, after the upgrade, the system will reboot. The connection will be lost for a while. Also, after rebooting, we will be forced to go through the login process again.

Figure 24: Update Home Assistant Core and automatically Reboot system.

After rebooting, run the command again:

ha core info
Figure 25: Get version number of our system Home Assistant Core.

Congratulations! This completes the update to the current version!

What’s next?


So at this point in time we already have the ability to work with configuration files, monitor the work of Home Assistant using commands in the terminal and we have updated the system to the latest version.

At this stage we will pause, and in the next publication we will tell about:

  • Sensors for monitoring system parameters: Raspberry Pi Power Quality and Processor Temperature Control Sensors; Processor, Memory, Disk, Network Monitoring Sensors;
  • Home Assistant Database Size monitoring;
  • Integration: Internet connection monitoring;
  • Add-On and Integration with external devices: Uninterruptible power supply monitoring.

But about this in the next post!

See you,
Sincerely, AIRRA!

Posted in Smart Home, Technology | Tagged , , , , , , , , , , , , , | Leave a comment

My Smart Home. Step by step from start to… Part 2. Implementation based on Home Assistant. The first steps. Software. Basic settings.

The Next Step


Hello everyone who reads the series of publications “My Smart Home. From the beginning, step by step to…”. In the previous story, I described the necessary equipment to start implementation.

Now that all the components have arrived and are available, let’s move on to the software part. So we need any computer with Windows (x86 / x64), macOS, Linux x64 (64-bit) / x86 (32-bit), with the ability to work with an SD Card adapter and Internet access.

Let’s get started!

List of Software


The list for downloading software components is as follows:

Software Component NameFile NameSizeLinks
1.Etcher for Windows (x86|x64) (Installer), v.1.5.121balenaEtcher-Setup-1.5.121.exe140 MB
2.Home Assistant image for Raspberry Pi 4 64-bit, v.5.8hassos_rpi4-5.8.img.xz230 MB

Importantly! Other versions balenaEtcher and Home Assistant image will be required for other hardware platforms.

Figure 1: Select the required balenaEtcher software on the download page.
Figure 2: Select the required Home Assistant OS software on the download page.

Image burning


When all the software is available, you can start writing the image to the SD card. Three small steps.

The procedure is as follows:

  1. Run balenaEtcher. Select the option “Flash from file”:
Figure 3: Step One: Select the option “Flash from file” in balenaEtcher application:
  1. Choose the SD card that we will use to run the Home Assistant OS on the Raspberry Pi 4 platform:
Figure 4: Step Two: Select SD Card in balenaEtcher application.
  1. Select “Flash!” to start recording an image. When balenaEtcher finishes recording the image and checks the result of the recording with the original, we will receive a confirmation:
Figure 5: BalenaEtcher application: Image recording completed successfully!

Start Up Your Raspberry Pi


So the SD card with the image of Home Assistant is ready! The following sequence of steps is as follows:

  • Insert the newly created installation media (SD card) into the Raspberry Pi 4 slot;
  • Connect the Ethernet cable to the network;
  • Connect the power supply;
  • In a few minutes we will be able to access the Home Assistant page at http: //X.X.X.X: 8123, where X.X.X.X is the address that Raspberry Pi received from the DHCP server:
Figure 6: Within a few minutes after starting the Raspberry Pi, we will get access to the OS Home Assistant and then make the first settings.

The first settings


So, Home Assistant OS is installed, it’s time to start setting it up.

At this stage, the web interface Home Assistant itself will offer to configure the basic parameters.

  1. Create a Home Assistant owner account. This account will be an administrator and will always be able to change any settings. Enter the name, username, password:
Figure 7: Create a Home Assistant owner account. Enter the name, username, password.
  1. Specify the name and location parameters of the house, time zone:
Figure 8: Set your location, time zone, and unit system.
  1. If you want to share information with developers about the work of your copy of Home Assistant in terms of analytics, integration, statistics or diagnostic data – select the necessary items:
Figure 9: If want, set sharing information with developers.
  1. The integration setup phase can now be postponed. We will return to this direction later:
Figure 10: List of integrations found by the Home Assistant setup wizard.
  1. Finish, we get the configured start web interface of Home Assistant:
Figure 11: Home Assistant Starting Page.

Congratulations! And this important stage has been successfully completed!

Testing environment


We will need a test site to test the changes that will be made in the productive environment of Home Assistant. It is not necessary to allocate separate equipment for this task, so we will use the virtualization platform for this purpose.

As a cloud architect, I have my own test demo environment. It works on the basis of VMware vSphere 5.x and 6.x. Home Assistant OS can be successfully run in this virtualization platform, although with some features.

Since we will do such actions periodically, I decided to write a small script in Powershell (PowerCli). It is designed to automate the process of creating a test environment Home Assistant in the form of a virtual machine VMware vSphere 5.x, 6.x.

The script consists of 15 steps:

  1. Define variables;
  2. Download HASS OS vmdk.xz;
  3. Extract HASS OS vmdk, rename from .tar, delete .xz;
  4. Connect to VMware Infrastucture;
  5. Set Datastore properties;
  6. Create HASS OS Virtual Machine;
  7. Copy HASS OS vmdk to Virtual Machine Datastore Folder;
  8. Create Configuration Specification HASS OS Virtual Machine;
  9. Check if there is an IDE COntroller present;
  10. Add IDE harddisk to VM configuration;
  11. Set VM EFI firmware;
  12. Reconfigure HASS OS Virtual Machine;
  13. Start HASS OS Virtual Machine;
  14. Get Ip Address HASS OS Virtual Machine;
  15. Open Web Browser and go to Home Assistant Start Web page.

The script code is below:

<#
.SYNOPSIS
    Automate create Home Assistant test Virtual Machine in VMware vSphere.
.DESCRIPTION
    This script is designed to automate the process of creating
    a test environment Home Assistant in the VMware virtual machine.
.NOTES
    File Name      : HassVmwareTestEnv.ps1
    Author         : AIRRA (roman@airra.net)
    Prerequisite   : PowerShell V2 over Vista and upper, 
                     7zip4powershell module,
                     VMware.VimAutomation.Core snap-in.

    Copyright 2021 - AIRRA
.LINK
    Script posted over:
    http://blogs.airra.net
#>

# Step 1: Define variables
$HassVMDKUrl = "https://github.com/home-assistant/operating-system/releases/download/5.8/hassos_ova-5.8.vmdk.xz" # Home Assitant git download Release Path
$HassVMDKDownloadPath = $env:TEMP # Path to download Folder
$HassVMDKArchiveName = "hassos_ova-5.8" # Home Assitant VMDK Archive Name

$VIServer = "_" # Address of VMware Vcenter Server
$VIServerUser = "_" # User with admin permissions
$VIServerUserPassword = "_" # Password

$VIHost = "_" # Address of of VMware Esxi
$VIDatastoreName = "_" # Datasore Name
$VINetwork = "_" # Network Name
$HassVMName = "hassio.test" # Virtual Machine Name

$HassVMDKSourcePath = $env:TEMP
$HassVMDKSourceFile = "hassos.vmdk"
$HassVMDK = $HassVMDKSourcePath + "\" + $HassVMDKSourceFile
$PathDisk = "[" + $VIDatastoreName + "] " + $HassVMName + "/" + $HassVMDKSourceFile

# Step 2: Download HASS OS vmdk.xz.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri $HassVMDKUrl -OutFile ($HassVMDKDownloadPath + "/" + $HassVMDKArchiveName + ".vmdk.xz")

# Step 3: Extract HASS OS vmdk, rename from .tar, delete .xz.
Expand-7Zip -ArchiveFileName ($HassVMDKDownloadPath + "/" + $HassVMDKArchiveName + ".vmdk.xz") -TargetPath $HassVMDKDownloadPath
Remove-Item -Path ($HassVMDKDownloadPath + "/" + $HassVMDKArchiveName + ".vmdk.xz")
Get-Item -Path ($HassVMDKDownloadPath + "/" + $HassVMDKArchiveName + ".vmdk.tar") | Rename-Item -NewName $HassVMDKSourceFile

# Step 4: Connect to VMware Infrastucture.
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls,[System.Net.SecurityProtocolType]::Tls11,[System.Net.SecurityProtocolType]::Tls12
Connect-VIServer -Server $VIServer -User $VIServerUser -Password $VIServerUserPassword

# Step 5: Set Datastore properties.
$Datastore = Get-Datastore $VIDatastoreName
New-PSDrive -Location $Datastore -Name vids -PSProvider VimDatastore -Root ""
Set-Location vids:

# Step 6: Create HASS OS Virtual Machine.
New-VM -Name $HassVMName -VMHost $VIHost -Datastore $VIDatastoreName -MemoryMB 1024 -NumCPU 1 -DiskMB 1 -NetworkName $VINetwork -GuestID debian6_64Guest
Get-HardDisk -VM $HassVMName -Name 'Hard disk 1' | Remove-HardDisk -Confirm:$false -DeletePermanently:$true

# Step 7: Copy HASS OS vmdk to Virtual Machine Datastore Folder.
Copy-DatastoreItem -Item $HassVMDK -Destination vids:$HassVMName

# Step 8: Create Configuration Specification HASS OS Virtual Machine.
$vm = Get-VM -Name $HassVMName
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec

# Step 9: Check if there is an IDE COntroller present.
$ideCtrl = $vm.ExtensionData.Config.Hardware.Device | where {$_.GetType().Name -eq "VirtualIDEController"} | select -First 1 
if(!$ideCtrl){
    $ctrl = New-Object VMware.Vim.VirtualDeviceConfigSpec
    $ctrl.Operation = "add"
    $ctrl.Device = New-Object VMware.Vim.VirtualIDEController
    $ideKey = -1
    $ctrl.Device.ControllerKey = $ideKey
    $spec.deviceChange += $ctrl
}
else{
    $ideKey = $ideCtrl.Key
}

# Step 10: Add IDE harddisk to VM configuration.
$dev = New-Object VMware.Vim.VirtualDeviceConfigSpec 
$dev.Operation = "add"
$dev.Device = New-Object VMware.Vim.VirtualDisk
$dev.Device.backing = New-Object VMware.Vim.VirtualDiskFlatVer2BackingInfo
$dev.Device.backing.DiskMode = "persistent"
$dev.Device.Backing.FileName = $PathDisk
$dev.Device.ControllerKey = $ideKey
$dev.Device.UnitNumber = -1
$spec.deviceChange += $dev

# Step 11: Set VM EFI firmware.
$spec.Firmware = [VMware.Vim.GuestOsDescriptorFirmwareType]::efi

# Step 12: Reconfigure HASS OS Virtual Machine.
$vm.ExtensionData.ReconfigVM($spec)

# Step 13: Start HASS OS Virtual Machine.
Start-VM -VM $HassVMName

# Step 14: Get Ip Address HASS OS Virtual Machine.
$Ip = (Get-VM -Name $HassVMName).Guest.IpAddress | ?{$_ -notmatch ':'}
Do {
    Start-Sleep -s 10
    }
While ($Ip -eq "" -or $Ip -eq $null)

# Step 15: Open Web Browser and go to Home Assistant Start Web page.
Invoke-Expression "cmd.exe /C start http://$Ip[1]:8123"

Important: The script uses the following components:

  • 7zip4powershell module,
  • VMware.VimAutomation.Core snap-in.

What’s next?


So, at this point we have a deployed and initially set up Home Assistant.

At this stage we will pause, and in the future we will talk about:

  • Software add-on: Text config editor, Terminal;
  • Configuration file: configuration.yaml;
  • Upgrading Home Assistant components to the latest version.

But about this in the next post!

See you,
Sincerely, AIRRA!

Posted in Smart Home, Technology | Tagged , , , , , , , , , , , , | Leave a comment

My Smart Home. Step by step from start to… Part 1. Implementation based on Home Assistant. The first steps. Hardware.

Introduction


Congratulations to everyone who periodically reads my blog. This time it will be about my attempt to implement the smart home model.

It all started down to the banal simple, with the purchase of a small townhouse. And while the main construction work was going on, experiments with different platforms of the Smart Home core began in parallel. Among the candidates were Home Assistant, MajorDoMo, OpenHUB and many others. After testing in a virtual environment, there is one candidate left – Home Assistant, about whom I want to tell you. And also about options of its integration with other systems.

This step-by-step review may be useful to some readers, because it will save the most important thing in our lives, it’s time. Much of what will be described was born of many successful and not-so-successful attempts.

So let’s get started!

Hardware


Let’s start with the hardware. At the first stage, the set of devices is not large, so you will fit into the mini budget.

● ● ●

Raspberry Pi 4 Model B

Figure 1: Raspberry Pi 4 Model B appearance.

This is the fourth generation of the main line of minicomputers from the Raspberry Pi Foundation.

Figure 2: Raspberry Pi 4 Model B placement of components and ports.

The technical characteristics of the board are as follows:

  • Processor: Broadcom BCM2711, Quad-core Cortex-A72 (ARM v8), 64-bit, 1.5 GHz core clock speed.
  • Memory: A choice of three hardware implementations – 2GB, 4GB or 8GB LPDDR4-3200 SDRAM.
  • Network: Gigabit Ethernet port, 2.4 GHz and 5.0 GHz IEEE 802.11ac Wireless Adapter, Bluetooth 5.0, BLE.
  • Storage Devices: Micro-SD card slot for booting the operating system and storing data.
  • Ports:
    • Multimedia:
      • 2 micro-HDMI ports (up to 4k resolution and 60p frames per second supported);
      • 2-line MIPI DSI display port;
      • 2-line port of the MIPI CSI camera;
      • 4-pole stereo port and composite video port;
      • Hardware coding of H.265 (4kp60 decoding), H264 (1080p60 decoding, 1080p30 coding);
      • Implementation of OpenGL ES 3.1, Vulkan 1.0 specifications.
    • Input, output:
      • 2 USB 3.0 ports;
      • 2 USB 2.0 ports;
      • Standard 40-pin GPIO Raspberry Pi connector (fully backwards compatible with previous boards).
  • Power:
    • 5V DC via USB-C connector (minimum 3A);
    • 5V DC via GPIO connector (minimum 3A).
  • Dimensions:
    • Height / Width / Depth – 2.22 in (56.5 mm) / 3.37 in (85.6 mm) / 0.43307 in (11 mm).
  • Weight: 1.62 oz (46 g).
Figure 3: Raspberry Pi 4 Model B GPIO Connector Pinout.
Figure 4: Raspberry Pi 4 Model B Physical Specifications.

● ● ●

Power Supply

Figure 5: Official Raspberry Pi USB-C power supply for Raspberry Pi 4 appearance.

Official Raspberry Pi USB-C power supply for Raspberry Pi 4 specifications:

  • The output direct current is 5.1 V / 3.0 A;
  • Operating range of input AC current – 96-264 V;
  • Built-in protection against short circuit, overload and overheating;
  • 1.5 m 18 AWG cable with USB-C output connector.

Subsequently, after the initial start-up and adjustment, this power supply was replaced by Mean Well on a DIN rail 15W 3A 5V HDR-30-5.

Figure 6: Mean Well on a DIN rail 15W 3A 5V HDR-30-5 appearance.

● ● ●

Micro SD Card

You will also need a class SD card no worse than A1 to work as a Home Assistant services.

Figure 7: SanDisk 32 GB microSDHC memory card UHS-I U3 Extreme Pro A1 + SD Adapter Kit appearance.

SanDisk 32 GB microSDHC memory card UHS-I U3 Extreme Pro A1 + SD Adapter specifications:

  • Type – microSDHC;
  • Capacity – 32 GB;
  • Speed class – 10;
  • UHS Class – UHS-I Class 3 (U3);
  • Video recording class – V30;
  • Class for applications – A1;
  • Data read speed – 90 MB / s;
  • Data write speed – 60 MB / s;
  • Adapter included.

● ● ●

Case for Raspberry Pi 4 Model B

In its design of a smart home, it was decided to place its control components as much as possible in electrical switchboards. So we will need a housing for the Raspberry Pi 4 Model B on a DIN rail.

Figure 8: The DIN rail case for Raspberry Pi 4 Model B appearance.

The DIN rail case for Raspberry Pi 4 Model B specifications:

  • Length – 88 mm;
  • Width – 90 mm;
  • Height – 58 mm;
  • The base material is plastic;
  • Material type – Polycarbonate;
  • Color – Gray.

● ● ●

Bill of materials


So the starting list for purchasing components is as follows:

Component NamePart NumberPrice, USD
1.Raspberry Pi 4 Model B, 2Gb~75$
2.Official Raspberry Pi USB-C power supply for Raspberry Pi 4~15$
3.SanDisk 32 GB microSDHC memory card UHS-I U3 Extreme Pro A1 + SD AdapterSDSQXCG-032G-GN6MA~13$
4.The DIN rail case for Raspberry Pi 4 Model B~19$
Total:122$

Prices for components are given in $, based on data from online stores in Kyiv, Ukraine. In your area, they can vary to a greater or lesser extent.

My set of starter components:

Figure 9: Raspberry Pi 4 Model B.
Figure 10: Official Raspberry Pi USB-C power supply for Raspberry Pi 4.
Figure 11: SanDisk 32 GB microSDHC memory card UHS-I U3 Extreme Pro A1 + SD Adapter Kit.
Figure 12: The DIN rail case for Raspberry Pi 4 Model B.

● ● ●

The next step


The components have been ordered and are expected to arrive. So what do we do next? Download the necessary software and start the installation phase.

But about this in the next post!

See you,
Sincerely, AIRRA!

Posted in Smart Home, Technology | Tagged , , , , , , , , , | Leave a comment

VMware vExpert 2021 Award!

Hi to all!

“Hello and welcome to the 2021 vExpert program” – a letter with this message I just received!

More than ten years from the first exam and certificate to this award! Thanks to VMware and everyone who helped me with this. There is still a lot of work ahead!

Sincerely,
Andriy Romanenko

Posted in Technology, VMware | Tagged , , | Leave a comment