Home | IoT - Connected Objects | Blynk | Integrate Blynk IoT connected objects to iOS with Homebridge (HomeKit)

Integrate Blynk IoT connected objects to iOS with Homebridge (HomeKit)

Blynk consists of a server and an application for iOS. If you have your own Blynk private server (follow this article to learn how to do on Raspberry Pi), you can make your connected objects developed using Blynk from the internet without having to expose your material to be interleached through the Homebridge project . For this you will need an Apple TV (4th generation at least) or an iPad (iOS 8 minimum) to communicate with your objects outside your home. The other advantage of exposing Blynk objects to HomeKit is to have a much better integration with iOS. You can order by voice or view your data from an Apple Watch.

Installing Node.js on Raspberry Pi

This tutorial is adapted to Raspbian Pixel. First, make sure that Nodejs is not already installed on your distribution. If so, you can proceed to the next step.

Warning. Check the impact on other projects that use Node.js before you start

If Node.js is not at least version 6.3.1, it is necessary to install it. Start by updating your system

Then install Node.js and its dependencies

Finally install Homebridge and the homebridge-blynk plugin (GitHub repository page)

We will create a directory that will contain the configuration file

At first we will configure the bridge to make it detectable by iOS. Although this does not seem to be mandatory, I prefer to know the Raspberry Pi’s MAC address. By doing this, iOS immediately discovers the Homebridge Bridge. Run ifconfig and note the MAC address that corresponds to the connection mode (eth0 in Ethernet, and wlan0 in Wi-Fi).

hombridge domoticz adresse mac rpi hwaddr

Open the configuration file with a text editor

Paste this basis (source) by adapting it to your configuration: server IP, HTTPS port, accessories.

Here, I took again the example presented in this article which made it possible to recover the measurement of temperature and humidity of a probe DHT22. The plugin is documented very briefly. To retrieve measurements, here are the parameters

  • name: this name does not seem important. It seems to be just used for the Homebridge newspaper
  • widget: defines the type of service HomeKit. For example TemperatureSensor for publication of temperature, HumiditySensor for humidity. All types of services supported by HomeKit are defined in the HAP-Node project here. Here is a non-exhaustive list of services managed by HomeKit. By assigning the appropriate service, Maison will be able to display the pictogram and the corresponding unit:
    • AirPurifier
    • AirQualitySensor
    • BatteryService
    • CameraControl
    • CameraRTPStreamManagement
    • CarbonDioxideSensor
    • CarbonMonoxideSensor
    • ContactSensor
    • Door
    • Doorbell
    • Fan
    • FanV2
    • GarageDoorOpener
    • HeaterCooler
    • HumidifierDehumidifier
    • HumiditySensor
    • LeakSensor
    • LightSensor
    • Lightbulb
    • LockManagement
    • Microphone
    • MotionSensor
    • OccupancySensor
    • SecuritySystem
    • Slat
    • SmokeSensor
    • StatefulProgrammableSwitch
    • StatelessProgrammableSwitch
    • TemperatureSensor
    • Thermostat
    • Window
    • WindowCovering
  • caption: the label that will be displayed in the House application (can be modified directly in House)
  • pin: the pin on which the information is retrieved or on which Homekit can send a command (for example to light a lamp …).

Save the configuration with CTRLM + X then O. Launch Homebridge

Start Home on your iPhone or iPad, click Start

homekit homebridge blynk start configuration

Then add an accessory

homekit homebridge blynk add accessoiry

In order for Home to find the gateway, you must be connected to the same WiFi network.

 homekit homebridge blynk select bridge

Enter the PIN that appears in the Terminal

homekit homebridge blynk enter code

Pairing is in progress

It’s over !

Home then offers to add devices connected to Homebridge. Here we start with the humidity sensor.

homekit homebridge blynk add humidity sensor

Then, the temperature

homekit homebridge blynk add temperatureservice sensor

You can now enjoy your Blynk items within the Home app

Blynk objects are now also available from the locked screen

homekit homebridge blynk locked screen

Follow this tutorial to complete the Homebridge configuration and start it automatically at system startup.