{"id":777,"date":"2024-07-24T16:38:57","date_gmt":"2024-07-24T16:38:57","guid":{"rendered":"https:\/\/www.bleuio.com\/blog\/?p=777"},"modified":"2024-07-24T16:45:45","modified_gmt":"2024-07-24T16:45:45","slug":"create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio","status":"publish","type":"post","link":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/","title":{"rendered":"Create your own Apple HomeKit Accessories to monitor air quality data using BleuIO"},"content":{"rendered":"\n<p>In this tutorial, we&#8217;ll walk you through the process of creating your own Apple HomeKit accessory that monitor and manage air quality data from a BLE device, specifically the <strong>HibouAir<\/strong> air quality monitoring device. By the end of this tutorial, you&#8217;ll have a functional BLE application that integrates with Apple&#8217;s HomeKit, demonstrating how easily you can develop BLE applications with the BleuIO dongle.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Overview of the Project<\/h3>\n\n\n\n<p>In this project, our goal is to create a BLE application that communicates with the HibouAir device, which provides air quality data. The application will:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Connect to a BleuIO USB dongle to communicate with BLE devices.<\/li>\n\n\n\n<li>Scan for the HibouAir device using AT commands.<\/li>\n\n\n\n<li>Decode the air quality data from the HibouAir device.<\/li>\n\n\n\n<li>Integrate with HomeKit to display and manage the data in a smart home environment.<\/li>\n\n\n\n<li>Update the accessory information and continuously monitor the air quality data.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">What is HomeKit?<\/h3>\n\n\n\n<p><strong><a href=\"https:\/\/www.apple.com\/home-app\/\" target=\"_blank\" rel=\"noreferrer noopener\">HomeKit<\/a><\/strong> is Apple&#8217;s framework for home automation that allows users to control smart home devices using their Apple devices. With HomeKit, you can control a wide range of devices like lights, thermostats, locks, and sensors through the Apple Home app, Siri voice commands, and other Apple devices.<\/p>\n\n\n\n<p>The key features of HomeKit include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Secure Communication<\/strong>: HomeKit uses end-to-end encryption to ensure that data transmitted between your devices and the Home app remains private and secure.<\/li>\n\n\n\n<li><strong>Integration with Siri<\/strong>: HomeKit-enabled devices can be controlled using Siri voice commands, enabling hands-free control of your smart home.<\/li>\n\n\n\n<li><strong>Automation<\/strong>: Users can create automated routines and scenes that trigger actions based on time, location, or device status. For example, you can set up a &#8220;Good Night&#8221; scene that turns off the lights and locks the door when you say goodnight to Siri.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">What is HAP-NodeJS?<\/h3>\n\n\n\n<p><strong>HAP-NodeJS<\/strong> is an open-source implementation of the HomeKit Accessory Protocol (HAP) written in Node.js. It allows developers to create HomeKit-compatible accessories and bridge devices that can be controlled through Apple&#8217;s HomeKit ecosystem.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Devices Required<\/h3>\n\n\n\n<p>To follow this tutorial, you will need:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/www.bleuio.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">BleuIO USB Dongle<\/a><\/strong>: A Bluetooth Low Energy USB dongle used to interface with BLE devices.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.hibouair.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>HibouAir Device<\/strong>:<\/a> A BLE air quality monitoring device that provides air quality metrics such as temperature, CO2 levels, humidity, and light levels.<\/li>\n\n\n\n<li><strong>A Computer<\/strong>: Running Windows, macOS, or Linux , \u00a0Raspberry Pi or any other platform that can run Node.js.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Connecting to BleuIO<\/h3>\n\n\n\n<p>To connect to the BleuIO dongle, we&#8217;ll use Node.js and the <code>serialport<\/code> package to communicate with the BLE device. The BleuIO dongle interfaces with your computer over a serial port, which allows you to send AT commands and receive data from BLE devices.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Decoding the Data<\/h3>\n\n\n\n<p>Once we receive the data from the HibouAir device, we need to decode it. The data is encoded in a specific format that we will parse and extract the relevant air quality metrics. We use a function to decode the advertisement data, which includes temperature, CO2 levels, humidity, and light levels.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Setting Up HomeKit Environment Data<\/h3>\n\n\n\n<p>We will use the <code>hap-nodejs<\/code> library to integrate our application with HomeKit. This will allow us to create HomeKit accessories that represent our air quality metrics. We set up services for temperature, CO2 levels, humidity, and light, and update these services with real-time data from the HibouAir device.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Running the Script<\/h3>\n\n\n\n<p>Here&#8217;s a step-by-step guide on how to set up and run the script:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Install Required Packages<\/strong><br>First, make sure you have Node.js installed on your computer. Then, install the required npm packages by running<br> <code>npm install hap-nodejs serialport<\/code><\/li>\n\n\n\n<li><strong>Create the Script<\/strong> <br>Save the following code as <code>hibouair.js<\/code> or clone it from https:\/\/github.com\/smart-sensor-devices-ab\/bleuio-hibouair-homekit-integration<br><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>const hap = require('hap-nodejs');\nconst { SerialPort } = require('serialport');\n\nconst Accessory = hap.Accessory;\nconst Characteristic = hap.Characteristic;\nconst CharacteristicEventTypes = hap.CharacteristicEventTypes;\nconst Service = hap.Service;\n\n\/\/ Get the device ID from the command-line arguments\nconst deviceId = process.argv&#91;2];\n\nif (!deviceId) {\n  console.error(\n    'Device ID not present. Please provide the device ID as follows:'\n  );\n  console.error('node hibouair.js &lt;device_id>');\n  process.exit(1);\n}\n\n\/\/ Define the manufacturer name you're looking for\nconst targetManufacturer = 'Smart Sensor Devices';\n\n\/\/ Buffers to hold the incoming data\nlet buffer = '';\nlet scanningDetected = false;\nlet responseFound = false;\nlet port; \/\/ Variable to hold the SerialPort instance\n\n\/\/ Initialize HomeKit accessories globally\nlet temperature, co2, humidity, light;\n\nasync function connectAndSendCommands() {\n  try {\n    \/\/ Get a list of all serial ports\n    const ports = await SerialPort.list();\n\n    \/\/ Find the port with the specified manufacturer\n    const targetPort = ports.find(\n      (port) => port.manufacturer === targetManufacturer\n    );\n\n    if (!targetPort) {\n      console.log(`No port found with manufacturer: ${targetManufacturer}`);\n      return;\n    }\n\n    \/\/ Log the selected port\n    console.log(`Connecting to port: ${targetPort.path}`);\n\n    \/\/ Create a new SerialPort instance for the selected port\n    port = new SerialPort({\n      path: targetPort.path,\n      baudRate: 9600, \/\/ Adjust the baud rate as needed\n    });\n\n    \/\/ Event handler for when the port opens\n    port.on('open', () => {\n      console.log(\n        `Port ${targetPort.path} is open and ready for communication.`\n      );\n\n      \/\/ Write the initial command\n      port.write('AT+CENTRAL\\r\\n', (err) => {\n        if (err) {\n          console.error('Error writing initial command:', err.message);\n        } else {\n          console.log('Initial command sent: AT+CENTRAL');\n        }\n      });\n\n      \/\/ Start the periodic scanning for BLE data\n      setInterval(() => {\n        port.write(`AT+FINDSCANDATA=${deviceId}=5\\r\\n`, (err) => {\n          if (err) {\n            console.error('Error writing scan command:', err.message);\n          } else {\n            console.log(`Scan command sent: AT+FINDSCANDATA=${deviceId}=5`);\n          }\n        });\n      }, 20000); \/\/ 20000 milliseconds = 20 seconds\n    });\n\n    \/\/ Event handler for when data is received on the port\n    port.on('data', (data) => {\n      buffer += data.toString();\n      processBuffer();\n    });\n\n    \/\/ Event handler for when there is an error\n    port.on('error', (err) => {\n      console.error('Error:', err.message);\n      if (port) {\n        port.close(() => {\n          console.log('Port closed due to error.');\n        });\n      }\n    });\n  } catch (err) {\n    console.error('Error listing or connecting to serial ports:', err);\n    if (port) {\n      port.close(() => {\n        console.log('Port closed due to error.');\n      });\n    }\n  }\n\n  function processBuffer() {\n    \/\/ Split the buffer into lines\n    const lines = buffer.split('\\r\\n');\n\n    for (let i = 0; i &lt; lines.length; i++) {\n      const line = lines&#91;i].trim();\n\n      if (line === 'SCANNING...') {\n        scanningDetected = true;\n      } else if (line === 'SCAN COMPLETE') {\n        scanningDetected = false;\n      } else if (scanningDetected &amp;&amp; line.length > 0) {\n        \/\/ Extract the data from the line\n        const dataMatch = line.match(\/^\\&#91;.*?\\] Device Data \\&#91;ADV\\]: (.+)$\/);\n        if (dataMatch &amp;&amp; dataMatch&#91;1]) {\n          const extractedData = dataMatch&#91;1].trim();\n          console.log('Extracted data:', extractedData);\n\n          \/\/ Decode the data\n          const decodedData = advDataDecode(extractedData);\n          console.log('Decoded data:', decodedData);\n\n          responseFound = true;\n          buffer = ''; \/\/ Clear the buffer after finding the response\n\n          if (!temperature || !co2 || !humidity || !light) {\n            setupAccessory(decodedData); \/\/ Setup accessory if not already done\n          } else {\n            updateAccessory(decodedData); \/\/ Update accessory with decoded data\n          }\n\n          return;\n        }\n      }\n    }\n\n    \/\/ Keep the remaining buffer if no relevant line was found\n    buffer = lines&#91;lines.length - 1]; \/\/ Retain the last part of the buffer\n  }\n\n  \/\/ Function to decode the advertisement data\n  function advDataDecode(adv) {\n    let pos = adv.indexOf('5B0705');\n    let dt = new Date();\n    let currentTs =\n      dt.getFullYear() +\n      '\/' +\n      (dt.getMonth() + 1).toString().padStart(2, '0') +\n      '\/' +\n      dt.getDate().toString().padStart(2, '0') +\n      ' ' +\n      dt.getHours().toString().padStart(2, '0') +\n      ':' +\n      dt.getMinutes().toString().padStart(2, '0') +\n      ':' +\n      dt.getSeconds().toString().padStart(2, '0');\n    let tempHex = parseInt(\n      '0x' +\n        adv\n          .substr(pos + 22, 4)\n          .match(\/..\/g)\n          .reverse()\n          .join('')\n    );\n    if (adv) dataShowing = true;\n    if (tempHex > 1000) tempHex = (tempHex - (65535 + 1)) \/ 10;\n    else tempHex = tempHex \/ 10;\n    return {\n      boardID: adv.substr(pos + 8, 6),\n      type: adv.substr(pos + 6, 2),\n      light: parseInt(\n        '0x' +\n          adv\n            .substr(pos + 14, 4)\n            .match(\/..\/g)\n            .reverse()\n            .join('')\n      ),\n      pressure:\n        parseInt(\n          '0x' +\n            adv\n              .substr(pos + 18, 4)\n              .match(\/..\/g)\n              .reverse()\n              .join('')\n        ) \/ 10,\n      temp: tempHex,\n      hum:\n        parseInt(\n          '0x' +\n            adv\n              .substr(pos + 26, 4)\n              .match(\/..\/g)\n              .reverse()\n              .join('')\n        ) \/ 10,\n      voc: parseInt(\n        '0x' +\n          adv\n            .substr(pos + 30, 4)\n            .match(\/..\/g)\n            .reverse()\n            .join('')\n      ),\n      pm1:\n        parseInt(\n          '0x' +\n            adv\n              .substr(pos + 34, 4)\n              .match(\/..\/g)\n              .reverse()\n              .join('')\n        ) \/ 10,\n      pm25:\n        parseInt(\n          '0x' +\n            adv\n              .substr(pos + 38, 4)\n              .match(\/..\/g)\n              .reverse()\n              .join('')\n        ) \/ 10,\n      pm10:\n        parseInt(\n          '0x' +\n            adv\n              .substr(pos + 42, 4)\n              .match(\/..\/g)\n              .reverse()\n              .join('')\n        ) \/ 10,\n      co2: parseInt('0x' + adv.substr(pos + 46, 4)),\n      vocType: parseInt('0x' + adv.substr(pos + 50, 2)),\n      ts: currentTs,\n    };\n  }\n}\n\n\/\/ Function to setup HomeKit accessory\nfunction setupAccessory(data) {\n  const accessoryUuid = hap.uuid.generate('hap.hibouair.sensor');\n  const accessory = new Accessory('HibouAir', accessoryUuid);\n\n  \/\/ Create a function to initialize services\n  function initializeService(\n    serviceType,\n    serviceName,\n    initialValue,\n    characteristicType\n  ) {\n    const service = new serviceType(serviceName);\n\n    const characteristic = service.getCharacteristic(characteristicType);\n\n    characteristic.on(CharacteristicEventTypes.GET, (callback) => {\n      console.log(`Queried current ${serviceName}: ${initialValue}`);\n      callback(undefined, initialValue);\n    });\n\n    accessory.addService(service);\n\n    return {\n      service,\n      characteristic,\n      initialValue,\n    };\n  }\n\n  \/\/ Initialize temperature, CO2, humidity, and light services\n  temperature = initializeService(\n    Service.TemperatureSensor,\n    'Temperature Sensor',\n    data.temp,\n    Characteristic.CurrentTemperature\n  );\n\n  co2 = initializeService(\n    Service.CarbonDioxideSensor,\n    'CO2 Sensor',\n    data.co2,\n    Characteristic.CarbonDioxideLevel\n  );\n\n  humidity = initializeService(\n    Service.HumiditySensor,\n    'Humidity Sensor',\n    data.hum,\n    Characteristic.CurrentRelativeHumidity\n  );\n\n  light = initializeService(\n    Service.LightSensor,\n    'Light Sensor',\n    data.light,\n    Characteristic.CurrentAmbientLightLevel\n  );\n\n  \/\/ Set accessory information\n  accessory\n    .getService(Service.AccessoryInformation)\n    .setCharacteristic(Characteristic.Manufacturer, 'Smart Sensor Devices')\n    .setCharacteristic(Characteristic.SerialNumber, deviceId);\n\n  \/\/ Publish the accessory\n  accessory.publish({\n    username: '17:51:07:F4:BC:8B',\n    pincode: '123-45-678',\n    port: 47129,\n    category: hap.Categories.SENSOR, \/\/ value here defines the symbol shown in the pairing screen\n  });\n\n  console.log('Accessory setup finished!');\n}\n\n\/\/ Function to update HomeKit accessory with new data\nfunction updateAccessory(data) {\n  temperature.initialValue = data.temp;\n  co2.initialValue = data.co2;\n  humidity.initialValue = data.hum;\n  light.initialValue = data.light;\n\n  console.log(`Updated current temperature: ${temperature.initialValue}`);\n  console.log(`Updated current CO2 level: ${co2.initialValue}`);\n  console.log(`Updated current Humidity level: ${humidity.initialValue}`);\n  console.log(`Updated current light level: ${light.initialValue}`);\n\n  \/\/ Update the characteristic values\n  temperature.service.setCharacteristic(\n    Characteristic.CurrentTemperature,\n    temperature.initialValue\n  );\n  co2.service.setCharacteristic(\n    Characteristic.CarbonDioxideLevel,\n    co2.initialValue\n  );\n  humidity.service.setCharacteristic(\n    Characteristic.CurrentRelativeHumidity,\n    humidity.initialValue\n  );\n  light.service.setCharacteristic(\n    Characteristic.CurrentAmbientLightLevel,\n    light.initialValue\n  );\n}\n\n\/\/ Call the function to connect and send commands\nconnectAndSendCommands();\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Run the Script<\/h3>\n\n\n\n<p>Execute the script from your terminal by providing the device ID as an argument:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>node hibouair.js 220069<\/code><\/pre>\n\n\n\n<p>This command will start the script, connect to the BleuIO dongle, scan for the HibouAir device, decode the data, and set up the HomeKit accessories with the real-time data from the device.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Output<\/h3>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/apple%20home%20output%20hibouair%20bleuio.webm\"><\/video><\/figure>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"866\" data-id=\"787\" src=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3958-1.png\" alt=\"\" class=\"wp-image-787\" srcset=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3958-1.png 400w, https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3958-1-139x300.png 139w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"866\" data-id=\"788\" src=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3959.jpg\" alt=\"\" class=\"wp-image-788\" srcset=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3959.jpg 400w, https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3959-139x300.jpg 139w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><figcaption class=\"wp-element-caption\">Screenshot<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"866\" data-id=\"782\" src=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3960.png\" alt=\"\" class=\"wp-image-782\" srcset=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3960.png 400w, https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3960-139x300.png 139w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"866\" data-id=\"783\" src=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3961.png\" alt=\"\" class=\"wp-image-783\" srcset=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3961.png 400w, https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3961-139x300.png 139w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"866\" data-id=\"785\" src=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3962.png\" alt=\"\" class=\"wp-image-785\" srcset=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3962.png 400w, https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3962-139x300.png 139w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"866\" data-id=\"784\" src=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3963.png\" alt=\"\" class=\"wp-image-784\" srcset=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3963.png 400w, https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/IMG_3963-139x300.png 139w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>This tutorial demonstrates how easy it is to develop BLE applications using BleuIO and integrate them with HomeKit. By following these steps, you can create real-time monitoring solutions for a variety of BLE-enabled devices, enhancing the functionality of your smart home environment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we&#8217;ll walk you through the process of creating your own Apple HomeKit accessory that monitor and manage air quality data from a BLE device, specifically the HibouAir air quality monitoring device. By the end of this tutorial, you&#8217;ll have a functional BLE application that integrates with Apple&#8217;s HomeKit, demonstrating how easily you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":778,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2],"tags":[],"class_list":["post-777","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bleuio","category-bleuio-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Create your own Apple HomeKit Accessories to monitor air quality data using BleuIO - BleuIO - Create Bluetooth Low Energy application<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create your own Apple HomeKit Accessories to monitor air quality data using BleuIO - BleuIO - Create Bluetooth Low Energy application\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we&#8217;ll walk you through the process of creating your own Apple HomeKit accessory that monitor and manage air quality data from a BLE device, specifically the HibouAir air quality monitoring device. By the end of this tutorial, you&#8217;ll have a functional BLE application that integrates with Apple&#8217;s HomeKit, demonstrating how easily you [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/\" \/>\n<meta property=\"og:site_name\" content=\"BleuIO - Create Bluetooth Low Energy application\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-24T16:38:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-24T16:45:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/homekit-accessory-create.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"435\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"BleuIO\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\\\/\"},\"author\":{\"name\":\"BleuIO\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#\\\/schema\\\/person\\\/89bc581382d5964043f96efc54b75b80\"},\"headline\":\"Create your own Apple HomeKit Accessories to monitor air quality data using BleuIO\",\"datePublished\":\"2024-07-24T16:38:57+00:00\",\"dateModified\":\"2024-07-24T16:45:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\\\/\"},\"wordCount\":705,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/homekit-accessory-create.jpg\",\"articleSection\":[\"BleuIO\",\"BleuIO tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\\\/\",\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\\\/\",\"name\":\"Create your own Apple HomeKit Accessories to monitor air quality data using BleuIO - BleuIO - Create Bluetooth Low Energy application\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/homekit-accessory-create.jpg\",\"datePublished\":\"2024-07-24T16:38:57+00:00\",\"dateModified\":\"2024-07-24T16:45:45+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#\\\/schema\\\/person\\\/89bc581382d5964043f96efc54b75b80\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/homekit-accessory-create.jpg\",\"contentUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/homekit-accessory-create.jpg\",\"width\":800,\"height\":435},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create your own Apple HomeKit Accessories to monitor air quality data using BleuIO\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/\",\"name\":\"BleuIO - Create Bluetooth Low Energy application\",\"description\":\"Learn Bluetooth Low Energy programming and build Bluetooth Low Energy Application\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#\\\/schema\\\/person\\\/89bc581382d5964043f96efc54b75b80\",\"name\":\"BleuIO\",\"sameAs\":[\"https:\\\/\\\/www.bleuio.com\\\/blog\"],\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/author\\\/biadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create your own Apple HomeKit Accessories to monitor air quality data using BleuIO - BleuIO - Create Bluetooth Low Energy application","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/","og_locale":"en_US","og_type":"article","og_title":"Create your own Apple HomeKit Accessories to monitor air quality data using BleuIO - BleuIO - Create Bluetooth Low Energy application","og_description":"In this tutorial, we&#8217;ll walk you through the process of creating your own Apple HomeKit accessory that monitor and manage air quality data from a BLE device, specifically the HibouAir air quality monitoring device. By the end of this tutorial, you&#8217;ll have a functional BLE application that integrates with Apple&#8217;s HomeKit, demonstrating how easily you [&hellip;]","og_url":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/","og_site_name":"BleuIO - Create Bluetooth Low Energy application","article_published_time":"2024-07-24T16:38:57+00:00","article_modified_time":"2024-07-24T16:45:45+00:00","og_image":[{"width":800,"height":435,"url":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/homekit-accessory-create.jpg","type":"image\/jpeg"}],"author":"BleuIO","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/#article","isPartOf":{"@id":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/"},"author":{"name":"BleuIO","@id":"https:\/\/www.bleuio.com\/blog\/#\/schema\/person\/89bc581382d5964043f96efc54b75b80"},"headline":"Create your own Apple HomeKit Accessories to monitor air quality data using BleuIO","datePublished":"2024-07-24T16:38:57+00:00","dateModified":"2024-07-24T16:45:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/"},"wordCount":705,"commentCount":0,"image":{"@id":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/homekit-accessory-create.jpg","articleSection":["BleuIO","BleuIO tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/","url":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/","name":"Create your own Apple HomeKit Accessories to monitor air quality data using BleuIO - BleuIO - Create Bluetooth Low Energy application","isPartOf":{"@id":"https:\/\/www.bleuio.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/#primaryimage"},"image":{"@id":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/homekit-accessory-create.jpg","datePublished":"2024-07-24T16:38:57+00:00","dateModified":"2024-07-24T16:45:45+00:00","author":{"@id":"https:\/\/www.bleuio.com\/blog\/#\/schema\/person\/89bc581382d5964043f96efc54b75b80"},"breadcrumb":{"@id":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/#primaryimage","url":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/homekit-accessory-create.jpg","contentUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2024\/07\/homekit-accessory-create.jpg","width":800,"height":435},{"@type":"BreadcrumbList","@id":"https:\/\/www.bleuio.com\/blog\/create-your-own-apple-homekit-accessories-to-monitor-air-quality-data-using-bleuio\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.bleuio.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create your own Apple HomeKit Accessories to monitor air quality data using BleuIO"}]},{"@type":"WebSite","@id":"https:\/\/www.bleuio.com\/blog\/#website","url":"https:\/\/www.bleuio.com\/blog\/","name":"BleuIO - Create Bluetooth Low Energy application","description":"Learn Bluetooth Low Energy programming and build Bluetooth Low Energy Application","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bleuio.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.bleuio.com\/blog\/#\/schema\/person\/89bc581382d5964043f96efc54b75b80","name":"BleuIO","sameAs":["https:\/\/www.bleuio.com\/blog"],"url":"https:\/\/www.bleuio.com\/blog\/author\/biadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts\/777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/comments?post=777"}],"version-history":[{"count":2,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts\/777\/revisions"}],"predecessor-version":[{"id":789,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts\/777\/revisions\/789"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/media\/778"}],"wp:attachment":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/media?parent=777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/categories?post=777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/tags?post=777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}