Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
10BC0 GitHub - DenizOner/MiPower: A Bluetooth switch for turning on the Mi Box S without a remote controller in Home Assistant
Nothing Special   »   [go: up one dir, main page]

Skip to content

A Bluetooth switch for turning on the Mi Box S without a remote controller in Home Assistant

License

Notifications You must be signed in to change notification settings

DenizOner/MiPower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiPower — Home Assistant custom integration

HACS Custom Repo GitHub Release License Issues GitHub Sponsors


MiPower is a Home Assistant integration that allows you to control the power state of media players that do not support traditional Wake-on-LAN (WOL) but can be "woken up" by a Bluetooth pairing request. It was specifically designed for devices like the Xiaomi Mi Box, but may work with other similar Android TV boxes.

This integration creates a switch entity in Home Assistant.

  • Turning ON the switch sends a series of Bluetooth commands via bluetoothctl to wake the device up.
  • Turning OFF the switch calls the media_player.turn_off service for the linked device.
  • The state of the switch is automatically synchronized with the state of the linked media player entity.

🤝 Support

The MiPower project is developed with the vision of adding value to the open source community. Your support is vital to maintaining the continuity and development speed of this project.

If you appreciate my effort, you can support me via GitHub Sponsors or the following platforms. Thank you in advance!

Alternatively, you can see all funding options by clicking the Sponsor button (❤️) in the top right corner of the repository.

Prerequisites

  • Home Assistant OS / Supervised / Container: This integration requires a Linux-based Home Assistant installation where the bluetoothctl command-line tool is available and accessible. It will not work on a Home Assistant Core installation on Windows.

Installation via HACS (Recomended)

This integration is available as a custom repository in HACS.

  1. Navigate to your HACS dashboard.
  2. Click on Integrations.
  3. Click the three-dots menu in the top-right corner and select "Custom repositories".
  4. In the dialog box, enter the following information:
    • Repository: https://github.com/DenizOner/MiPower
    • Category: Integration
  5. Click "Add".
  6. The "MiPower" integration will now appear in your HACS list. Click on it.
  7. Click the "Download" button and then "Download" again in the next window.
  8. After the download is complete, you must restart Home Assistant for the integration to be loaded.

Manual Installation

While HACS is the recommended method, you can also install the integration manually.

  1. Go to the Releases page of the repository and download the mipower.zip file from the latest release.
  2. Unzip the downloaded file.
  3. Inside the unzipped folder, you will find a custom_components directory. Copy the mipower folder from within it.
  4. Paste the copied mipower folder into the custom_components folder in your Home Assistant configuration directory. If the custom_components folder does not exist, you need to create it.
    • The final path should look like: .../config/custom_components/mipower/
  5. Restart Home Assistant.

Configuration

After restarting, you can add and configure the MiPower switch.

  1. Go to Settings > Devices & Services.
  2. Click the "+ Add Integration" button in the bottom-right corner.
  3. Search for "MiPower" and click on it.

Easy Setup (Recommended)

This is the simplest way to configure the integration.

  1. When prompted, choose "Easy Setup".
  2. The integration will automatically discover Bluetooth-enabled media players on your system.
  3. Select your target device (e.g., "Xiaomi Mi Box 4") from the dropdown list.
  4. Click "Submit".

That's it! The integration will create a switch linked to your media player.

Advanced Setup

Use this method if the Easy Setup does not find your device or if you need to configure advanced timing settings from the start.

  1. Step 1: Device Selection
    • Choose "Advanced Setup".
    • Select your target media player from the list of all media players in your Home Assistant.
  2. Step 2: MAC Address
    • The integration will try to find the Bluetooth MAC address of the selected device.
    • If found, it will be pre-filled. Verify that it is correct.
    • If not found, you must enter the Bluetooth MAC address of your device manually.
  3. Step 3: Timing Settings
    • You can configure various timeouts and delays for the Bluetooth commands. For most users, the default values are sufficient.
  4. Click "Submit" to complete the setup.

Options

After you have configured your MiPower switch, you can adjust the timing settings at any time.

  1. Go to Settings > Devices & Services.
  2. Find the MiPower integration and click "Configure".
  3. Adjust the sliders for debounce, timeouts, and delays as needed.

Timing Settings Explained

In the configuration or options menu, you can fine-tune the timing of the Bluetooth commands. For most users, the default values work well.

  • Turn-On Debounce: The minimum time (in seconds) that must pass before the 'turn on' command can be executed again. This prevents spamming the device with wake-up signals if the switch is toggled rapidly.

  • Turn-Off Debounce: The minimum time (in seconds) that must pass before the 'turn off' command can be executed again.

  • Delay Between Commands: A very short delay (in seconds) between sending consecutive commands to the bluetoothctl utility. On some systems, adding a small pause can improve reliability.

  • Process Spawn Timeout: The maximum time (in seconds) to wait for the bluetoothctl process to start. If it fails to start within this time, the turn-on attempt will fail.

  • Pairing Timeout: In the simplified turn-on logic, this is the amount of time to wait after sending the pair command before assuming success. It gives the device time to process the wake-up signal.

  • Bluetooth Scan Duration: The duration (in seconds) that the integration will scan for Bluetooth devices before attempting to send the pair command. A longer scan can help find devices that are slow to advertise their presence.

Read in your own language


0