Using Interoperability between Mobile Robot and KNX Technology for Occupancy Monitoring in Smart Home Care

It is important for older and disabled people who live alone to be able to cope with the daily challenges of living at home. In order to support independent living, the Smart Home Care (SHC) concept offers the possibility of providing comfortable control of operational and technical functions using a mobile robot for operating and assisting activities to support independent living for elderly and disabled people. This article presents a unique proposal for the implementation of interoperability between a mobile robot and KNX technology in a home environment within SHC automation to determine the presence of people and occupancy of occupied spaces in SHC using measured operational and technical variables (to determine the quality of the indoor environment), such as temperature, relative humidity, light intensity, and CO2 concentration, and to locate occupancy in SHC spaces using magnetic contacts monitoring the opening/closing of windows and doors by indirectly monitoring occupancy without the use of cameras. In this article, a novel method using nonlinear autoregressive Neural Networks (NN) with exogenous inputs and nonlinear autoregressive is used to predict the CO2 concentration waveform to transmit the information from KNX technology to mobile robots for monitoring and determining the occupancy of people in SHC with better than 98% accuracy.


Introduction
Globally, the number of older people and the demand for assistive care is growing rapidly [1].The number of older people with unmet care and support needs is increasing significantly due to the challenges faced by formal and informal care systems in different countries.The World Health Organization (WHO) suggests that the development of intelligent, physical, social, and age-friendly environments will improve the quality of life of older people.Current technological innovations and developments have the potential to address some of the challenges in the care and support of older people [2].Assistive technologies have been an important topic in both research and manufacturing industries in recent decades, with a focus on improving social interaction and supporting healthcare, business, education, and activities of daily living [3].There are different types of assistive technologies such as assistive autonomous robots, self-driving vehicles, smart health applications, wearable devices with Artificial Intelligence (AI) support, novel drug release mechanisms, wearable diagnostics, voice-activated devices, virtual, augmented, and mixed reality, or building automation technologies in smart buildings [2].Considering the situation with the COVID-19 pandemic in the world [4], Social Companion Robots (SCRs) integrated with various sensing technologies such as vision, voice, or touch to interact with other smart devices in the home can enable the development of advanced artificial intelligence solutions towards Smart Home Care with assistive services to address the needs of the elderly and disabled [1].The knowledge of the spatial distribution of physical quantities in Smart Home (SH) supports the development of new context-aware applications where new methodologies for multi-sensor data fusion and information processing are needed [5], with possible applications such as multi-point path planning for a home mobile robot [6].The increasing isolation of elderly people in their own homes and in homes for the elderly has made the problem of caring for the elderly living alone an urgent priority.Experiments conducted using robots in the home support the conclusion that an assistive robot can correctly design activities to ensure a good quality of life for the elderly [7].Within the Smart Cities platform, robots can perform simple tasks in hotels as hotel receptionists, museum guides, waiters in cafes and restaurants, home assistants, and others [8].Robotics, artificial intelligence, and the Internet of Things support various processes in many scenarios of modern life, such as e-health [9] and psychological treatment [10].Robotic doctors and nurses developed through IoT technology will provide healthcare to patients in the future [11].Brunete, A. et al. present a new architecture that integrates Internet of Things (IoT) devices, service robots, and users into an intelligent assistive environment that supports disabled and bedridden patients [12][13][14].
In the presented study, a unique hardware and software solution is newly described to ensure mutual communication and interoperability between KNX technology (standard EN 50090, ISO/IEC 14543 [15] for building automation) and an autonomous mobile robot (AMR) [16][17][18][19][20][21][22] designed to serve and assist Smart Home Care residents in the framework of social assistance robotics for indirect monitoring of occupancy of SHC premises and indirect localization of people without the use of cameras.The proposed solution uses the KNX open data protocol to provide data connectivity with other technologies.The Smart Home Care technology concept is used to support independent living for the elderly and disabled in the home environment.Different technologies and software (SW) implementation can be used for the automation of intelligent buildings in Smart Home Care (Table 1).

Topic of the Article Ref. No. Observations
Use of Social Companion Robot (SCR) for Adults with Motor Disabilities (MD).
[16] SCR, MD A Multirobot (MR) System in an Assisted Home Environment (AHE) to Support the Elderly in Their Daily Lives (DL).[17] MR, Support elderly, AHE, DL Personalized home-care (PHC) robot support for the elderly.
[18] R, PHC Artificial Intelligence-Based Smart Comrade Robot for Elders Healthcare (HC) with Strait Rescue System.
[20] R, HC, HLPR Automatic pathological gait recognition (PGR) by a mobile robot using ultrawideband-based localization and a depth camera.
[21] R, PGR Bridging gaps in the design and implementation of socially assistive technologies (SAT) for dementia care: the role of occupational therapy.
[23] R, HMM, HA The AI devices utilized in elderly healthcare were summarized as robots.
[24] R, AI, HC Virtual reality technologies (VRT), smart wearables, and robots were used to provide telerehabilitation services (TRS) [ The presented work describes a new unique solution, which is based on the use of AMR in SHC for the localization of people, monitoring the presence of people, and determining the occupancy of the monitored spaces.
The newly designed indirect method was used for follow-up actions (resulting from the set mode of operation of the AMR) from measured operational variables to determine the quality of the indoor environment (CO 2 ) and variables within the monitoring of the opening of windows and doors (magnetic contacts) in the framework of building automation used KNX technology.In the framework of the newly proposed method, Nonlinear Autoregressive (NAR) and Nonlinear Autoregressive Exogenous (NARX) Neural Network (NN) with different network settings have been used for CO 2 waveform prediction.
Research contribution-The research contribution contains four main parts as follows (Figure 1):  The proposed architecture will be applied to an existing decentralized KNX technology in a smart home environment for the purpose of monitoring and monitoring the occupancy of individual SHC rooms.The paper is structured as follows: Section 2 introduces relevant studies and key technologies in smart home solutions using the SHC platform with KNX and AMR; Section 3 describes AMR; Section 4 introduces KNX technology designed for SHC automation (indoor environment quality monitoring, security functions of opening/closing windows, and doors); Experimental Section 5 is divided into Part 1 KNX-AMR (localizes the position of a person), Part 2 KNX-AMR (monitors room occupancy indirectly with time advance using CO 2 concentration prediction using NAR neural network), Part 3 KNX-AMR (monitors room occupancy indirectly with time advance using CO 2 concentration prediction using NARX neural network), Part 4(monitoring the presence of people in SHC using sensors placed on AMR description of experiments); Section 6 compares NAR and NARX NNs in an application to determine the presence of people in a monitored room; Section 7 concludes, evaluates, and outlines the next steps in solving the described problem.

Related Work
Assistive technology has been a significant topic in both the research and manufacturing industry for the past decades focusing on improving social interaction, supporting health care, business, education, and daily activities.There are different types of assistive technologies such as wearable devices, mobile applications, automated home appliances, and robots [1] (socially assistive robotics (SAR).The increasing isolation of the elderly both in their own homes and in care homes has made the problem of caring for elderly people who live alone an urgent priority [2].However, for robotic assistive applications to be effective, they need to satisfy the particular needs of each user and be well-perceived [3].A rising proportion of older people has more demand for services including hospitals, retirement homes, and assisted living facilities [4].A summary of state-of-the-art mobile robot implementations in smart home care automation is presented in Table 1.
None of the articles mentioned in the above research (Table 1) describes a comprehensive solution to provide intercommunication and interoperability between KNX technology designed for building automation and AMR designed to serve and assist SHC occupants, using it for indirect occupancy monitoring of SHC premises and indirect occupant localization without the use of cameras.
The presented study describes a new unique solution for the use of AMR in SHC for occupant localization, monitoring the presence of people, and determining the occupancy of the monitored spaces using an indirect method without the use of cameras for subsequent actions (resulting from the set mode of operation of the AMR) based on the measured operational variables for determining the quality of the indoor environment [46][47][48][49][50][51][52] and operational variables for the building security area-opening/closing windows and doors within the automation of the SHC using KNX technology with the use of CO 2 prediction using the nonlinear autoregressive recurrent dynamic neural network (NN) with exogenous inputs (NARX), which is used for time-series modeling and nonlinear autoregressive (NAR) NN:

•
The AMR determines the position of the person (information sent from the KNX technology); • AMR monitors the presence of a person in the SHC in advance (information sent from KNX technology), NN (NARX, NAR); • AMR provides monitoring of the presence of persons in the SHC using sensors placed on the robot, namely two lidars and ultrasonic sensors (information sent to KNX technology).

Autonomous Mobile Robot
An autonomous mobile robot (AMR) is an industrial device containing a sensing part and an actuating part (motors).It also contains an industrial control computer with a Linux operating system, a 24 V Li-ion battery with a capacity of 0.9 kWh, and other sensorics safety and support systems as shown in Figure 2. The sensor system consists mainly of two lidars from Sick, placed diagonally, as well as ultrasonic sensors at the front and rear of the robot and proximity sensors monitoring the robot's immediate surroundings.
An autonomous mobile robot (AMR) is an industrial device containing a sensing part and an actuating part (motors).It also contains an industrial control computer with a Linux operating system, a 24 V Li-ion battery with a capacity of 0.9 kWh, and other sensorics safety and support systems as shown in Figure 2. The sensor system consists mainly of two lidars from Sick, placed diagonally, as well as ultrasonic sensors at the front and rear of the robot and proximity sensors monitoring the robot's immediate surroundings.The AMR is capable of autonomous movement in a given space based on a virtual map of the environment, which it compares with the data collected by sensors (Figure 3).The AMR is capable of autonomous movement in a given space based on a virtual map of the environment, which it compares with the data collected by sensors (Figure 3).

Robot Specification
For the purpose of this thesis, the AMR developed by the Danish company MiR was selected.Specifically, it is the MiR100 model.It is the smallest robot in the portfolio with dimensions of 890 mm in length, 580 mm in width, and 352 mm in height and a total payload of 100 kg.Due to its compact size, the robot can be used in the home and in apartments.At the same time, its load capacity is sufficient for transporting people with reduced mobility or larger loads.

Navigation System of Robot
In order to find a route, the navigation system needs initialization data to plan the route.The user enters information about where the robot should arrive.However, in order for AMR to plan a route, it also needs to know the space it is moving in and its current location.A virtual map is used to navigate the space, which is stored in the robot's memory and contains information about all walls and obstacles.This map must be created before the AMR can be used.Once the virtual map is created, the points on which the robot moves can be inserted.However, the map can be modified with zones, landmarks, and special planning rules.
Once all the data is obtained, route planning is initiated.The route is planned by the robot itself, which is in charge of the global planning system.It is an algorithm that generates the route to the desired point.However, it is important that the global planning

Robot Specification
For the purpose of this thesis, the AMR developed by the Danish company MiR was selected.Specifically, it is the MiR100 model.It is the smallest robot in the portfolio with dimensions of 890 mm in length, 580 mm in width, and 352 mm in height and a total payload of 100 kg.Due to its compact size, the robot can be used in the home and in apartments.At the same time, its load capacity is sufficient for transporting people with reduced mobility or larger loads.

Navigation System of Robot
In order to find a route, the navigation system needs initialization data to plan the route.The user enters information about where the robot should arrive.However, in order for AMR to plan a route, it also needs to know the space it is moving in and its current location.A virtual map is used to navigate the space, which is stored in the robot's memory and contains information about all walls and obstacles.This map must be created before the AMR can be used.Once the virtual map is created, the points on which the robot moves can be inserted.However, the map can be modified with zones, landmarks, and special planning rules.
Once all the data is obtained, route planning is initiated.The route is planned by the robot itself, which is in charge of the global planning system.It is an algorithm that generates the route to the desired point.However, it is important that the global planning system generates the path to the destination only once and only tracks fixed obstacles that are recorded on the virtual space map.This means that if a new obstacle appears in the robot's environment that is not recorded on its virtual space map, the global planning system is unaware of this obstacle and plans the path despite this obstacle.The planned route is displayed on the map or on the dashboard using points.Figure 4 shows an example of robot navigation on a virtual map.The black contours represent fixed obstacles such as walls, whereas the red contours represent fixed obstacles detected by the robot.The purple areas are the areas that the robot, or the robot's planning and navigation system, has automatically marked as not preferred in terms of navigation.They are usually found around obstacles to avoid the risk of collision.
memory and contains information about all walls and obstacles.This map must be created before the AMR can be used.Once the virtual map is created, the points on which the robot moves can be inserted.However, the map can be modified with zones, landmarks, and special planning rules.
Once all the data is obtained, route planning is initiated.The route is planned by the robot itself, which is in charge of the global planning system.It is an algorithm that generates the route to the desired point.However, it is important that the global planning system generates the path to the destination only once and only tracks fixed obstacles that are recorded on the virtual space map.This means that if a new obstacle appears in the robot's environment that is not recorded on its virtual space map, the global planning system is unaware of this obstacle and plans the path despite this obstacle.The planned route is displayed on the map or on the dashboard using points.Figure 4 shows an example of robot navigation on a virtual map.The black contours represent fixed obstacles such as walls, whereas the red contours represent fixed obstacles detected by the robot.The purple areas are the areas that the robot, or the robot's planning and navigation system, has automatically marked as not preferred in terms of navigation.They are usually found around obstacles to avoid the risk of collision.

AMR and KNX Interoperability
By default, the AMR is connected to a local network or technology via Wi-Fi.MiR100 includes a built-in REST API based on HTTP GET/POST protocol.Using this API, it is possible to communicate with the robot, read its operational data, and assign tasks, called missions [54].The connection of the MiR100 robot to the KNX system is made using a communication server that mediates the communication between KNX and the MiR100 robot.The communication server is connected to a wireless router to which the MiR100 mobile robot is simultaneously connected via a WIFI wireless network.Through this network, they communicate with each other using the HTTP GET/POST protocol [54].The KNX technology is connected to the communication server via LAN using a SpaceLYnk logic controller.SpaceLYnk is used to provide visualization of operational and technical functions in buildings.At the same time, SpaceLYnk can be used as an interface between KNX technology, BACnet, DALI, Modbus, or IoT platforms (through MQTT).SpaceLynk allows providing connectivity for different types of technologies with the following technical options: IP LAN connection 10/100 Mbit, USB 2.0 (for GMS modem, EnOcean. ..) 5 V, 500 mA max., RS-232, Modbus (RS-485), Wi-Fi using IP connection and wireless router, KNX/EIB TP Bus.The MQTT protocol is used to ensure communication between AMR and KNX technology.Thus, the communication server (Figure 5) serves as a request translator between the mobile robot's REST API and the MQTT protocol (supported by the Space-LYnk module).The communication server can be implemented as a service running on a local machine or server.In certain cases, it is possible to use the services of a router or NAS system that can also serve as the local server.However, the most suitable solution seems to be the use of an embedded computer located in a rack together with a SpaceLYnk module running the translation service of the individual communication interfaces.A block diagram of the communication system is shown in Figure 5.
translator between the mobile robot's REST API and the MQTT protocol (supported by the SpaceLYnk module).The communication server can be implemented as a service running on a local machine or server.In certain cases, it is possible to use the services of a router or NAS system that can also serve as the local server.However, the most suitable solution seems to be the use of an embedded computer located in a rack together with a SpaceLYnk module running the translation service of the individual communication interfaces.A block diagram of the communication system is shown in Figure 5.

Living Laboratory-Smart Home Care
It is a functionally defined 2 + 1 apartment, so-called Living laboratory (Smart Home Care) designed for research, simulation, and data processing from the "smart" home at the VŠB TU Ostrava (Czech Republic).Specifically, the rooms are the living room with kitchen 220, bedroom 217, bathroom and toilet 216, hall 215, entrance hall 213, and technical room 214, where the switchboards are located (Figure 6).For this functionally defined part of the building, a switchboard is installed for both the power line connection and the measurement and control (MaC) equipment using KNX technology.The KNX technology provides comfortable lighting control over the DALI bus, its control, and possibly dimming.For this purpose, separate push-button controllers with signal LEDs or combined controllers with sensing of physical variables (temperature, humidity, CO2, and lighting intensity) are installed in the rooms.Occupancy detectors with integrated light intensity measurements are also installed in the living rooms, which, in coordination with the weather control panel, can automatically control the blinds and light intensity to

Living Laboratory-Smart Home Care
It is a functionally defined 2 + 1 apartment, so-called Living laboratory (Smart Home Care) designed for research, simulation, and data processing from the "smart" home at the VŠB TU Ostrava (Czech Republic).Specifically, the rooms are the living room with kitchen 220, bedroom 217, bathroom and toilet 216, hall 215, entrance hall 213, and technical room 214, where the switchboards are located (Figure 6).For this functionally defined part of the building, a switchboard is installed for both the power line connection and the measurement and control (MaC) equipment using KNX technology.The KNX technology provides comfortable lighting control over the DALI bus, its control, and possibly dimming.For this purpose, separate push-button controllers with signal LEDs or combined controllers with sensing of physical variables (temperature, humidity, CO 2 , and lighting intensity) are installed in the rooms.Occupancy detectors with integrated light intensity measurements are also installed in the living rooms, which, in coordination with the weather control panel, can automatically control the blinds and light intensity to ensure the light comfort of the space-based on the position of the sun and the angle of the sun's rays.The weather station also provides other important information such as outside temperature, wind speed, presence of rain, etc. From the presence detection, it is also possible to set the parameters of space usage (lighting blocking, heating attenuation, etc.).A touch panel is installed at the entrance to the functionally defined area for user settings or system parameterization.All sensors (sensors) and controls (actuators) are connected to a common KNX bus.Ventilation and space heating are provided by an autonomous Heating, Ventilation, and Air Condition (HVAC) unit with Modbus communication (connected via a system integrator to the building control system), as well as a variable refrigerant flow (VRF) system in combination with one outdoor and several indoor units.The entire VRF system can be controlled via BMS software (Desigo CC V5.0) using a BACnet gateway down to the level of the end distribution elements.The control concept is based on a room automation station.This integrates the control logic algorithms, KNX, and DALI bus and connects the system to the higher-level BMS system.The actuators control the lighting for the kitchen and dining table as well as the bathroom fan.The kitchen ventilation is controlled by the kitchen and bathroom fans.The shutter actuators are used for the outdoor blinds and shutters.
When selecting a control system, the important criterion of the system's ability to handle HW and SW requirements for individual control tasks is accepted.KNX technology is capable of variable expansion of HW and SW inputs/outputs.For the possibility of changing control parameters, a control panel with an LCD display is placed in anteroom 215 (Figure 6).The KNX bus is used as the communication platform.The visualization software Wiser (Embedded Systems SIA © 2021 Schneider Electric © 2021) integrates the visualization, archiving, and control of the operational and technical functions in the SHC using the SpaceLYnk controller.The ETS 6 software tool (version 6.1.0)is used for programming the KNX technology.
communication (connected via a system integrator to the building control system), as well as a variable refrigerant flow (VRF) system in combination with one outdoor and several indoor units.The entire VRF system can be controlled via BMS software (Desigo CC V5.0) using a BACnet gateway down to the level of the end distribution elements.The control concept is based on a room automation station.This integrates the control logic algorithms, KNX, and DALI bus and connects the system to the higher-level BMS system.The actuators control the lighting for the kitchen and dining table as well as the bathroom fan.The kitchen ventilation is controlled by the kitchen and bathroom fans.The shutter actuators are used for the outdoor blinds and shutters.When selecting a control system, the important criterion of the system's ability to handle HW and SW requirements for individual control tasks is accepted.KNX technology is capable of variable expansion of HW and SW inputs/outputs.For the possibility of changing control parameters, a control panel with an LCD display is placed in anteroom 215 (Figure 6).The KNX bus is used as the communication platform.The visualization software Wiser (Embedded Systems SIA © 2021 Schneider Electric © 2021) integrates the visualization, archiving, and control of the operational and technical functions in the SHC using the SpaceLYnk controller.The ETS 6 software tool (version 6.1.0)is used for programming the KNX technology.

Experimental Part
KNX sensors MTN6005-0001 (temperature, relative humidity, and CO2) and MTN630719 (lighting) were used to measure the quality of the indoor environment.The CO2 concentration is an excellent indicator of the quality of the air and its "breathability" indoors.Since every person naturally releases a significant amount of CO2 by breathing (the exhaled air of an adult contains approximately 40,000 ppm CO2), measuring the CO2 concentration provides reasonably accurate information about the number of people in an

Experimental Part
KNX sensors MTN6005-0001 (temperature, relative humidity, and CO 2 ) and MTN630719 (lighting) were used to measure the quality of the indoor environment.The CO 2 concentration is an excellent indicator of the quality of the air and its "breathability" indoors.Since every person naturally releases a significant amount of CO 2 by breathing (the exhaled air of an adult contains approximately 40,000 ppm CO 2 ), measuring the CO 2 concentration provides reasonably accurate information about the number of people in an enclosed space and can be easily used to regulate ventilation intensity.The location of the sensors was chosen according to CSN EN ISO 16000-26.The area of the rooms where the measurements were performed was less than 50 m 2 , therefore it was possible to use only one measurement point at a height of 1.5 m and 1 m from the wall.This is a naturally ventilated area.It was assumed that the CO 2 concentration in the room was the same at all points.For the measurements, a five-minute interval was chosen to record the values in the SpaceLYnk controller.The measurements were carried out over a period of one month 15 March-14 April 2022.For the security area of the SHC apartment, magnetic contacts SA203 were connected to the KNX module of binary inputs MTN 644,592 to monitor the opening and closing windows (W1, W2, and W3) and doors (D1, D2, D3, and D4) (Figure 6).

Part 1 KNX-AMR-Localization of the Position of the Person in the SHC
AMR locates the position of a person using an indirect method (without using cameras) based on the connection of AMR with KNX technology-opening/closing a window (W1, W2, and W3) (Figure 7a) or a door (D1, D2, D3, and D4) (Figure 7b).

Part 1 KNX-AMR-Localization of the Position of the Person in the SHC
AMR locates the position of a person using an indirect method (without using cameras) based on the connection of AMR with KNX technology-opening/closing a window (W1, W2, and W3) (Figure 7a) or a door (D1, D2, D3, and D4) (Figure 7b).

Part 2 KNX-AMR Monitors Room Occupancy Indirectly Ahead of Time by Predicting CO2 Concentration Using NAR's NN
The AMR indirectly monitors (without the use of a camera) the presence of a person in a room ahead of time based on the prediction of the CO2 concentration using the NAR

Part 2 KNX-AMR Monitors Room Occupancy Indirectly Ahead of Time by Predicting CO 2 Concentration Using NAR's NN
The AMR indirectly monitors (without the use of a camera) the presence of a person in a room ahead of time based on the prediction of the CO 2 concentration using the NAR NN, and then transmits the information to the AMR without the use of a camera (indirect determination of the occupancy of the monitored spaces in the SHC).The CO 2 concentration was measured using a KNX sensor MTN6005-0001.The CO 2 measurement range is from 300 ppm to 9999 ppm.The accuracy is for measured CO 2 values from 300 to 1000 ppm; ±120 ppm, for measured CO 2 values from 1000 to 2000 ppm; ±250 ppm, and for measured CO 2 values from 2000 to 5000 ppm; ±300 ppm. Figure 8 shows a block diagram describing the processing of the measured quantities using the selected NAR and NARX NN.

Part 2 KNX-AMR Monitors Room Occupancy Indirectly Ahead of Time by Predicting CO2 Concentration Using NAR's NN
The AMR indirectly monitors (without the use of a camera) the presence of a person in a room ahead of time based on the prediction of the CO2 concentration using the NAR NN, and then transmits the information to the AMR without the use of a camera (indirect determination of the occupancy of the monitored spaces in the SHC).The CO2 concentration was measured using a KNX sensor MTN6005-0001.The CO2 measurement range is from 300 ppm to 9999 ppm.The accuracy is for measured CO2 values from 300 to 1000 ppm; ±120 ppm, for measured CO2 values from 1000 to 2000 ppm; ±250 ppm, and for measured CO2 values from 2000 to 5000 ppm; ±300 ppm. Figure 8 shows a block diagram describing the processing of the measured quantities using the selected NAR and NARX NN.The MATLAB R2020b development environment was used to create the prediction models.Specifically, the NN Time Series Tool (ntstool) in the NN Toolbox was used for this purpose.This is used exclusively for the prediction of dynamic time series, where using one or more past values of a given time series, a prediction of its future evolution is made.This tool allows a choice of three prediction models.In this paper, the NAR and NARX prediction models were used.Mean Squared Error (MSE), Mean Absolute Percentage Error (MAPE), and Spearman's correlation coefficient R were used to evaluate the prediction (Tables 2 and 3).

Nonlinear Autoregressive (NAR) Model
The first prediction model used was a nonlinear autoregressive NN model from MATLAB R2020b.The display of measured reference CO 2 and predicted CO 2 concentration waveform using NN NAR (10 neurons, d = 5) is shown in Figure 9.The individual data are sorted into these three sets by random selection.Then, the number of neurons in the hidden layer of a given NN was chosen to be 10, and the number of output delay periods from 2 to 5.

Part 3 KNX-AMR Monitors Room Occupancy Indirectly Ahead of Time by Predicting CO2 Concentration Using a NARX NN
The AMR indirectly monitors (without the use of a camera) the presence of people in the room in advance based on the prediction of the CO2 concentration in advance using measured KNX technology operational variables such as indoor temperature, indoor relative humidity, indoor light intensity, window opening/closing information (W1, W2, and W3), and door opening/closing information (D1, D2, D3, and D4) using the NARX NN and then transmitting the information to the AMR.

Nonlinear Autoregressive with External (Exogenous) Input (NARX) Model
The second prediction model used in this work was a nonlinear autoregressive NN model with an external (exogenous) input.This can predict the future values of a time series based on its past values and other supporting data that come together at the network input.This would provide better prediction capabilities to the NN as it has more data and connections between them.Mathematically, this model can be expressed as () = (( -1),…, ( -), ( -1),…, ( -)), where the CO2 value prediction of a time series () is determined by  the number of values of its preceding and following time series x() and their  the number of values of their preceding (Figure 10).Then, the number of neurons in the hidden layer of a given NN was chosen to be 10, and the number of output delay periods from 2 to 5.

Part 3 KNX-AMR Monitors Room Occupancy Indirectly Ahead of Time by Predicting CO 2 Concentration Using a NARX NN
The AMR indirectly monitors (without the use of a camera) the presence of people in the room in advance based on the prediction of the CO 2 concentration in advance using measured KNX technology operational variables such as indoor temperature, indoor relative humidity, indoor light intensity, window opening/closing information (W1, W2, and W3), and door opening/closing information (D1, D2, D3, and D4) using the NARX NN and then transmitting the information to the AMR.

Nonlinear Autoregressive with External (Exogenous) Input (NARX) Model
The second prediction model used in this work was a nonlinear autoregressive NN model with an external (exogenous) input.This can predict the future values of a time series based on its past values and other supporting data that come together at the network input.This would provide better prediction capabilities to the NN as it has more data and connections between them.Mathematically, this model can be expressed as y(t) = f (x(t − 1),. .., x(t − n), y(t − 1),. .., y(t − n)), where the CO 2 value prediction of a time series y(t) is determined by n the number of values of its preceding and following time series x(t) and their n the number of values of their preceding (Figure 10).Then, the number of neurons in the hidd of a given NN was selected and the number of output delay periods was set.The NN model view (Figure 10) shows the number of neurons in the hidden layer, the value delay, the activation functions at each layer, and the number of exogenous entering the network.Subsequently, the NN trained using the Levenberg-Ma algorithm is created, and the Mean Squared Error (MSE) method is used to meas error.After training, a table with the error results for each set is displayed.From be seen that the NARX model achieves better MSE and R results than the NAR.The prediction NARX model used was a nonlinear autoregressive NN model from M R2020b.The display of measured reference CO2 and predicted CO2 concen waveform using NN NAR (10 neurons, d = 5) is shown in Figure 11.In contrast to the NAR prediction model, the NARX model has two variables, where the first contains the desired values of the CO 2 concentration waveform and the second contains the measured values within the KNX operational measurements of indoor temperature, indoor relative humidity, indoor lighting intensity, window opening/closing information (W1, W2, and W3), and door opening/closing information (D1, D2, D3, and D4)-input external variables that represent the exogenous input of the NARX network.Other network settings are the same as in the NAR model described above.The data are also divided into three sets with a ratio of 70 percent of the data for the training set, 15 percent for the validation set, and 15 percent for the test set.The individual data are sorted into these three sets by random selection.Then, the number of neurons in the hidden layer of a given NN was selected and the number of output delay periods was set.The NARX NN model view (Figure 10) shows the number of neurons in the hidden layer, the output value delay, the activation functions at each layer, and the number of exogenous inputs entering the network.Subsequently, the NN trained using the Levenberg-Marquardt algorithm is created, and the Mean Squared Error (MSE) method is used to measure the error.After training, a table with the error results for each set is displayed.From it, it can be seen that the NARX model achieves better MSE and R results than the NAR.The second prediction NARX model used was a nonlinear autoregressive NN model from MATLAB R2020b.The display of measured reference CO 2 and predicted CO 2 concentration waveform using NN NAR (10 neurons, d = 5) is shown in Figure 11.In contrast to the NAR prediction model, the NARX model has two variables, where the first contains the desired values of the CO2 concentration waveform and the second contains the measured values within the KNX operational measurements of indoor temperature, indoor relative humidity, indoor lighting intensity, window opening/closing information (W1, W2, and W3), and door opening/closing information (D1, D2, D3, and D4)-input external variables that represent the exogenous input of the NARX network.Other network settings are the same as in the NAR model described above.The data are also divided into three sets with a ratio of 70 percent of the data for the training set, 15 percent for the validation set, and 15 percent for the test set.The individual data are sorted into these three sets by random selection.Then, the number of neurons in the hidden layer of a given NN was selected and the number of output delay periods was set.The NARX NN model view (Figure 10) shows the number of neurons in the hidden layer, the output value delay, the activation functions at each layer, and the number of exogenous inputs entering the network.Subsequently, the NN trained using the Levenberg-Marquardt algorithm is created, and the Mean Squared Error (MSE) method is used to measure the error.After training, a table with the error results for each set is displayed.From it, it can be seen that the NARX model achieves better MSE and R results than the NAR.The second prediction NARX model used was a nonlinear autoregressive NN model from MATLAB R2020b.The display of measured reference CO2 and predicted CO2 concentration waveform using NN NAR (10 neurons, d = 5) is shown in Figure 11.Monitoring the presence of people in the SHC using sensors placed on the AMR (MiR100) is shown in Figure 12.MiR100 exploits its sensor suite, mapping, and localization capabilities, along with computer vision algorithms, to recognize the presence of people in the environment it navigates.By distinguishing between free space and obstacles and employing safety protocols, the robot ensures the safety of both itself and the people in its vicinity.
Monitoring the presence of people in the SHC using sensors placed on the AMR (MiR100) is shown in Figure 12.MiR100 exploits its sensor suite, mapping, and localization capabilities, along with computer vision algorithms, to recognize the presence of people in the environment it navigates.By distinguishing between free space and obstacles and employing safety protocols, the robot ensures the safety of both itself and the people in its vicinity.
The principle of people recognition relies on dynamic evaluation of changes from lidar and ultrasonic sensors, exploiting the assumption that there is no motion for fixed obstacles.In the case of detecting people or pets, AMR uses an algorithm that detects the movement of objects in space.Even if the person is not in direct motion, there is some interference with natural movement, breathing, and other biological processes.

Discussion
In this article, we present a unique proposal for the implementation of a mobile robot to KNX technology in a home environment within SHC automation to determine the presence of people and occupancy of occupied spaces in SHC using measured operational and technical variables (to determine the quality of the indoor environment) such as temperature, relative humidity, light intensity, and CO2 concentration and for locating occupancy in SHC spaces using magnetic contacts monitoring the opening/closing of windows and doors by indirectly monitoring occupancy without the use of cameras.
We used nonlinear autoregressive Neural Networks (NN) with NAR and NARX prediction models to predict the CO2 concentration waveform to transmit the information from KNX technology to mobile robots for monitoring and determining the occupancy of people in SHC with better than 98% accuracy.Enhanced predictive accuracy is possible using the optimization of algorithms [55][56][57][58][59][60][61][62] or filtration of predicted waveforms with adaptive algorithms [63,61] or with wavelet transformation [64,65].In this article, we focused on NAR and NARX prediction models.We trained the NN NAR predicted model using the Levenberg-Marquard algorithm because it is the fastest and has standard data processing quality.For better results in training NN to predict the measured data, we could use the Bayesian Regularization algorithm, but it is slow.We did not use the Scaled Conjugate Gradient algorithm due to the poorer quality of the measured data processing.The principle of people recognition relies on dynamic evaluation of changes from lidar and ultrasonic sensors, exploiting the assumption that there is no motion for fixed obstacles.In the case of detecting people or pets, AMR uses an algorithm that detects the movement of objects in space.Even if the person is not in direct motion, there is some interference with natural movement, breathing, and other biological processes.

Discussion
In this article, we present a unique proposal for the implementation of a mobile robot to KNX technology in a home environment within SHC automation to determine the presence of people and occupancy of occupied spaces in SHC using measured operational and technical variables (to determine the quality of the indoor environment) such as temperature, relative humidity, light intensity, and CO 2 concentration and for locating occupancy in SHC spaces using magnetic contacts monitoring the opening/closing of windows and doors by indirectly monitoring occupancy without the use of cameras.
We used nonlinear autoregressive Neural Networks (NN) with NAR and NARX prediction models to predict the CO 2 concentration waveform to transmit the information from KNX technology to mobile robots for monitoring and determining the occupancy of people in SHC with better than 98% accuracy.Enhanced predictive accuracy is possible using the optimization of algorithms [55][56][57][58][59][60][61][62] or filtration of predicted waveforms with adaptive algorithms [61,63] or with wavelet transformation [64,65].In this article, we focused on NAR and NARX prediction models.We trained the NN NAR predicted model using the Levenberg-Marquard algorithm because it is the fastest and has standard data processing quality.For better results in training NN to predict the measured data, we could use the Bayesian Regularization algorithm, but it is slow.We did not use the Scaled Conjugate Gradient algorithm due to the poorer quality of the measured data processing.
For training of the NN NARX predicted model.the properties of the algorithms described above were similar.
In our studies, in which a detailed description is provided, we dealt with the various optimization steps that could be undertaken to enhance the predictive accuracy of designed models [60][61][62][63][64].The results of the proposed method are comparable with the state-of-the-art approaches, as summarized in Table 4.The first prediction model in this study was the NAR model.It is a very fast learning model using which a high success rate can be achieved (Table 2) in predicting the CO 2 concentration trend (Figure 9a).The NAR prediction model allowed the optimization steps to search for the ideal setting to solve a particular problem.Despite their combinability, they are very time-consuming, since after every single setting the network has to be retrained again and evaluated whether the change produced a better result or just the opposite.One of the biggest drawbacks of this model is that the NAR model only works with historical data of a given CO 2 concentration path and thus does not provide room for additional input data that could further improve its success rate.However, when the NAR prediction model is properly tailored to a specific CO 2 concentration history, the model can serve as a fairly significant decision support tool regarding the presence of people in the SHC monitoring area well in advance.

Evaluation of NARX Prediction Model
The second prediction model in this work was the NARX model.It is also one of the fast learning models and its best result in predicting the future CO 2 concentration (Figure 11) was better than 99% (Table 3).Of course, such a high success rate can only be achieved in certain cases and with proper optimization of the prediction model.NARX can predict the future values of a time series based on its past values and other supporting data that come together at the input of the network, thus eliminating the main drawback of the NAR model.Specifically, the technical indicators should provide the network with an even better prediction success rate because of the availability of more data and the relationships between them.This was reflected in its tested model series, where it provided more consistent results.Similar to NAR, there is room for optimization in the NARX model.However, the variety of settings and the number of optimization steps, in this case, increases as it is additionally possible to optimize and adjust the calculations of technical indicators.After the analyses performed on both tested prediction models, the NARX model appears to be the best model for predicting the future CO 2 concentration path for determining the presence of people in the SHC monitoring area.This is due to its greater variability, the larger amount of input data on which it can perform technical analyses, and more consistent results in prediction compared to the NAR model.When properly tailored and optimized to a specific problem, it can provide valuable information to investors when making decisions about the occupancy of SHC-monitored space.

Practical Use of AMR within SHC Using KNX Technology
The article describes the modes of interaction of AMR with people in the monitored SHC space using information about the location, presence, or occupancy of the SHC space using the connection between AMR and building automation using KNX technology.6.2.1.I. Mode-Robot Invisible I. Mode-robot invisible (Figure 13): the robot tries not to bother the persons in the monitored area (state-avoiding persons, parking AMR in a reserved area, and cleaning in a different room where the person is not present (vacuuming and washing the floor)); in the absence of persons, the robot receives information from KNX technology about opening/closing windows (Figure 7a), doors (Figure 7b), (CO 2 increase/decrease), and localization of window and door contacts by AMR.Leaving/entering the apartment is an indication of the opening of the main door and decrease/increase in CO 2 in the monitored rooms (Figure 7b).13), in case of absence of persons in the apartment: binding to the door lock, lock, motion sensors, detection of opening of the main door closing, CO 2 drops (vacuum, wash the floor, and take out the garbage)-switching on KNX using the button.6.2.3.III.Mode-Be Nearby III.Mode-be nearby (Figure 13): the robot is used to serve people and bring food and drink (Figure 12a), (KNX button 1-kitchen-come, 2 living room-come, 3-bedroom-come, and 4 bathroom-come).

IV. Standby Mode
IV. Standby mode (Figure 13): monitoring the presence of a person, monitoring the occupancy of the premises (localization of persons) in order to prevent possible situations (e.g., fall of a person (Figure 12b), I am not well (illness)-bring food and drink): (a) Indirectly monitoring based on the evaluation of measured values of operational technical functions in the apartment (CO 2 concentration, prediction of CO 2 concentration (Figures 9a and 11a) from other variables, activity (opening windows, doors, kitchen, refrigerator, starting water, starting the washing machine, dishwasher), W1, W2, W3, D1, D2, D3, and D4-localization of coordinates); (b) Monitoring the presence of people in the SHC using sensors placed on the robot, specifically two lidars and ultrasonic sensors.

Robustness of the System and Measures to Mitigate Potential Failures
The mobile robot's safety functions are managed using the utilization of Sick's safety PLC system, known for its excellence in comparison to other systems, for example, the industrial PC.This robust safety system guarantees a comprehensive level of safety during the robot's operation.The mobile robot is inherently capable of fully autonomous operation and is programmed to strictly adhere to safety protocols, rendering it incapable of executing any actions that contravene established safety rules.
The safety of the robot is ensured by a number of sensor systems.Essential functions such as basic navigation and spatial orientation are facilitated using a pair of lidars.Nevertheless, lidar technology has inherent limitations, including the inability to detect objects such as transparent obstacles and vulnerability to sun-induced interference.When faced with sun interference, the robot's mobility ceases immediately until normal conditions are restored.To address the challenge of transparent obstacles, the robot is equipped with ultrasonic sensors, providing reliable obstacle detection capabilities.Additionally, proximity sensors are integrated into the robot to monitor items, such as small objects on the floor, contributing to its overall safety.
An additional layer of safety is realized using the robot's navigation system, which relies on a predefined map.This map can encompass various zones with distinct attributes, including one-way streets, restricted areas, and non-preferred zones.The robot is programmed to refrain from entering these zones, even when physically feasible.This navigation, while complex, is seamlessly managed by the mobile robot's planning and navigation system, which takes these defined areas into account.
Originally designed for industrial applications, the mobile robot's safety system is intentionally engineered to facilitate its safe coexistence with human environments, emphasizing its adaptability and versatility.

Conclusions
The article presents its own unique implementation of AMR with connectivity to KNX technology in the home environment within SHC automation for determining the presence of people and occupancy of occupied spaces in SHC using measured operational and technical variables, (for determining the quality of the indoor environment) such as temperature, relative humidity, lighting intensity, and CO 2 concentration and for locating the presence of people in SHC spaces using magnetic contacts monitoring the opening of windows via the indirect method of monitoring the presence of people and occupancy of monitored SHC spaces without the use of cameras.
In this paper, the implementation of a learned NN NARX and NAR with a learning Levenberg-Marquard algorithm for predicting the CO 2 concentration waveform in advance to forward information from KNX AMR technology for monitoring and determining occupancy in Smart Home Care with an accuracy of better than 98%.
The proposed architecture was applied to an existing decentralized KNX technology in a Smart Home environment for the purpose of occupancy monitoring of individual SHC rooms.
In the experimental part, the localization of the person's position by exchanging information between KNX and AMR technology was described, and an example of using NN NAR to monitor room occupancy indirectly with time advance by predicting CO 2 concentration was presented.
In the next section, a method for determining the presence of persons using measured variables by KNX technology was described, where AMR monitors room occupancy indirectly in advance by predicting CO 2 concentration using a NARX NN.
The experiments also described the monitoring of occupant presence in SHC using sensors placed on the AMR.
In future studies, the authors will focus on the detailed description of occupant localization and occupant presence determination using AMR in conjunction with KNX technology designed to build automation.

• Part 1 . 21 Figure 1 .
Figure 1.Block Diagram-Interoperability between KNX and AMR Technologies.The proposed architecture will be applied to an existing decentralized KNX technology in a smart home environment for the purpose of monitoring and monitoring the occupancy of individual SHC rooms.The paper is structured as follows: Section 2 introduces relevant studies and key technologies in smart home solutions using the SHC platform with KNX and AMR; Section 3 describes AMR; Section 4 introduces KNX technology designed for SHC automation (indoor environment quality monitoring, security functions of opening/closing windows, and doors); Experimental Section 5 is divided into Part 1 KNX-AMR (localizes the position of a person), Part 2 KNX-AMR (monitors room occupancy indirectly with time advance using CO2 concentration prediction using NAR neural network), Part 3 KNX-AMR (monitors room occupancy indirectly with time advance using CO2 concentration prediction using NARX neural

Figure 4 .
Figure 4. Example diagram to demonstrate the AMR automatic route planning in practice.Figure 4. Example diagram to demonstrate the AMR automatic route planning in practice.

Figure 4 .
Figure 4. Example diagram to demonstrate the AMR automatic route planning in practice.Figure 4. Example diagram to demonstrate the AMR automatic route planning in practice.

Figure 5 .
Figure 5. Block diagram of AMR and KNX interoperability.

Figure 5 .
Figure 5. Block diagram of AMR and KNX interoperability.

Figure 6 .
Figure 6.Floor plan with positioned sensors and bus buttons for controlling operational and technical functions in Smart Home Care (using the eConfigure software tool, version 1.7.5.7).

Figure 6 .
Figure 6.Floor plan with positioned sensors and bus buttons for controlling operational and technical functions in Smart Home Care (using the eConfigure software tool, version 1.7.5.7).
Sensors 2023, 23, x FOR PEER REVIEW 9 of 21 enclosed space and can be easily used to regulate ventilation intensity.The location of the sensors was chosen according to CSN EN ISO 16000-26.The area of the rooms where the measurements were performed was less than 50 m 2 , therefore it was possible to use only one measurement point at a height of 1.5 m and 1 m from the wall.This is a naturally ventilated area.It was assumed that the CO2 concentration in the room was the same at all points.For the measurements, a five-minute interval was chosen to record the values in the SpaceLYnk controller.The measurements were carried out over a period of one month 15 March-14 April 2022.For the security area of the SHC apartment, magnetic contacts SA203 were connected to the KNX module of binary inputs MTN 644,592 to monitor the opening and closing windows (W1, W2, and W3) and doors (D1, D2, D3, and D4) (Figure6).

Figure 7 .
Figure 7. AMR locates the position of a person using an indirect method (without using cameras) based on the connection with KNX technology: (a) opening/closing a window (W1); (b) opening/closing a door (D2).

Figure 7 .
Figure 7. AMR locates the position of a person using an indirect method (without using cameras) based on the connection with KNX technology: (a) opening/closing a window (W1); (b) opening/closing a door (D2).

Figure 7 .
Figure 7. AMR locates the position of a person using an indirect method (without using cameras) based on the connection with KNX technology: (a) opening/closing a window (W1); (b) opening/closing a door (D2).

Sensors 2023 , 21 Figure 9 .
Figure 9. Display of (a) measured reference and predicted CO2 concentration waveform using NN NAR (10 neurons, d = 5); (b) larger detail of measured reference and predicted CO2 concentration waveform using NN NAR (10 neurons, d = 5); (c) Bland-Altman plot comparing predicted and reference CO2 waveform.It can predict future values based on past values of a given time series.Subsequently, the measured CO2 waveform values are divided into three sets, where 70 percent of the data is used for training the network, 15 percent for validation to better generalize the network and stop training when the generalization stops improving, and the remaining 15 percent for a test set to evaluate the network performance during and after training.The individual data are sorted into these three sets by random selection.Then, the number of neurons in the hidden layer of a given NN was chosen to be 10, and the number of output delay periods from 2 to 5.

Figure 9 .
Figure 9. Display of (a) measured reference and predicted CO 2 concentration waveform using NN NAR (10 neurons, d = 5); (b) larger detail of measured reference and predicted CO 2 concentration waveform using NN NAR (10 neurons, d = 5); (c) Bland-Altman plot comparing predicted and reference CO 2 waveform.It can predict future values based on past values of a given time series.Subsequently, the measured CO 2 waveform values are divided into three sets, where 70 percent of the data is used for training the network, 15 percent for validation to better generalize the network and stop training when the generalization stops improving, and the remaining 15 percent for a test set to evaluate the network performance during and after training.The individual data are sorted into these three sets by random selection.Then, the number of neurons in the hidden layer of a given NN was chosen to be 10, and the number of output delay periods from 2 to 5.

Sensors 2023 ,Figure 10 .
Figure 10.The model of the NARX network.

Figure 10 .
Figure 10.The model of the NARX network.

Figure 11 .
Figure 11.Display of (a) measured reference and predicted CO2 concentration waveform using NN NARX (10 neurons, d = 2); (b) larger detail of measured reference and predicted CO2 concentration waveform using NN NARX (10 neurons, d = 2); (c) Bland-Altman plot comparing predicted and reference CO2 waveform.5.4.Part 4-Monitoring the Presence of People in the SHC Using Sensors Placed on the AMR

Figure 12 .
Figure 12.The AMR locates the position of the person using sensors placed on the AMR, specifically two lidars and ultrasonic sensors.(a) Mode III-be nearby: the robot is used to assist the person while eating; (b) Mode IV-standby: the robot is used to assist the person when trying to get up from the ground after a fall.

Figure 12 .
Figure 12.The AMR locates the position of the person using sensors placed on the AMR, specifically two lidars and ultrasonic sensors.(a) Mode III-be nearby: the robot is used to assist the person while eating; (b) Mode IV-standby: the robot is used to assist the person when trying to get up from the ground after a fall.

Sensors 2023 , 21 Figure 13 .
Figure 13.The effect of each mode.6.2.2.II.Mode-Cleaning Mode II.Cleaning mode (Figure13), in case of absence of persons in the apartment: binding to the door lock, lock, motion sensors, detection of opening of the main door closing, CO2 drops (vacuum, wash the floor, and take out the garbage)-switching on KNX using the button.

Figure 13 .
Figure 13.The effect of each mode.

Table 1 .
Studies that investigate the application of robots within Smart Home Care.

Table 2 .
Calculated values of MSE, R, and MAPE NAR for the number of hidden neurons 10.

Table 3 .
Calculated MSE, R, and MAPE values of NN NARX for the number of hidden neurons 10, number of delays d = 2, and d = 4.

Table 4 .
Comparison with state-of-the-art approaches for occupancy estimation and CO 2 sensing.