Allumer son ordinateur avec son smartphone iOS et Android + Intégration HomeKit (via HomeBridge)

4 min read 4 hours ago
Published on Oct 23, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

In this tutorial, you will learn how to wake your computer using your iOS or Android smartphone. We will cover the steps necessary to set up Wake On LAN (WoL) for Windows, macOS, or Linux systems. Additionally, we will integrate this functionality with Apple's HomeKit using HomeBridge, allowing you to control your computer via Siri. By the end of this guide, you'll be able to power on your computer remotely and enhance your smart home setup.

Step 1: Enable Wake On LAN on Your Computer

To start, you need to enable the Wake On LAN feature on your computer. This setting may vary slightly depending on your operating system.

For Windows

  1. Open the Control Panel.
  2. Navigate to Hardware and Sound, then select Device Manager.
  3. Locate your network adapter under "Network adapters."
  4. Right-click on the network adapter and select Properties.
  5. Go to the Power Management tab.
  6. Check the boxes for:
    • Allow this device to wake the computer
    • Only allow a magic packet to wake the computer
  7. Click OK to save changes.

For macOS

  1. Open System Preferences.
  2. Select Energy Saver.
  3. Check the option "Wake for network access."

For Linux

  1. Open your terminal.
  2. Run the following command to enable Wake On LAN:
    sudo ethtool -s [interface] wol g
    
    Replace [interface] with your network interface name, which you can find by running ifconfig.

Step 2: Install the Fing App on Your Smartphone

Fing is a network scanning app that allows you to identify devices on your network, making it easier to wake your computer.

For iOS

  1. Go to the App Store.
  2. Search for "Fing" and download the app.

For Android

  1. Visit the Google Play Store.
  2. Search for "Fing" and install the app.

Step 3: Find Your Computer's MAC Address

To use the Wake On LAN feature, you will need your computer's MAC address.

On Windows

  1. Open Command Prompt.
  2. Type ipconfig /all and press Enter.
  3. Locate the "Physical Address" of your network adapter.

On macOS

  1. Open Terminal.
  2. Type ifconfig and press Enter.
  3. Find the line that starts with ether, which shows your MAC address.

On Linux

  1. Run the command ifconfig in the terminal.
  2. Look for the HWaddr or ether line to find your MAC address.

Step 4: Set Up Wake On LAN in the Fing App

  1. Open the Fing app on your smartphone.
  2. Tap on "Scan for devices" to identify devices on your network.
  3. Locate your computer from the list and tap on it.
  4. Select the option to add it as a favorite for easier access.
  5. Ensure you note the MAC address for Wake On LAN.

Step 5: Integrate with HomeKit Using HomeBridge

To control your computer with Siri, you will need to set up HomeBridge.

Installation

  1. Install Node.js on your computer (check the official website for instructions).
  2. Open your terminal or command prompt and run:
    npm install -g homebridge
    
  3. Install the HomeBridge Wake On LAN plugin:
    npm install -g homebridge-wol
    

Configuration

  1. Create a configuration file config.json in the .homebridge directory.
  2. Add the following configuration, replacing the placeholder values:
    {
      "platforms": [
        {
          "platform": "wol",
          "name": "Wake On LAN",
          "devices": [
            {
              "name": "Your Computer Name",
              "ip": "Your Computer IP",
              "mac": "Your Computer MAC"
            }
          ]
        }
      ]
    }
    

Conclusion

You have successfully set up Wake On LAN for your computer and integrated it with HomeKit using HomeBridge. Now you can wake your computer using your smartphone or with a simple Siri command. This setup enhances your smart home experience by allowing seamless control over your devices.

Next steps include exploring additional HomeBridge plugins to further extend your smart home capabilities, or experimenting with other automation features available through HomeKit.