Apple homekit logitech harmony

Homebridge для RaspberryPi: интегрируйте Xiaomi, Sonos, Logitech Harmony, Homematic и многие другие умные устройства в HomeKit

Платформа HomeKit от Apple набирает обороты — в последние месяцы на рынке появляется все больше устройств, которым доступна интеграция с «яблочной» платформой. Тенденция не может нас не радовать, но все же, количество устройств сильно ограничено и их стоимость высока. Все это неприятно сказывается на «строительство» своего умного дома. Что же нам делать? Как нам интегрировать «умные» устройства от производителей не прошедших сертификацию Apple в HomeKit? Решение есть — приложение Homebridge.

Homebridge устанавливается на RaspberryPi, а затем задействуют его как мост к устройствам, которые еще не поддерживают HomeKit. Таким образом, например, в HomeKit можно интегрировать AVM Fritz! Boxes, колонки Sonos, устройства HomeMatic и пульт дистанционного управления Logitech Harmony, а затем управляться ими с помощью приложения «Дом» и голосовых команд (Siri). Тем не менее, настройка Homebridge относительно трудоемка и требует от вас более активного взаимодействия с RaspberryPi. В наших пошаговых инструкциях мы попытались все разложить по полочкам. Обязательно ознакомитесь с инструкциями.

Raspberry Pi — одноплатный компьютер (миникомпьютер) размером с банковскую карту / Wiki

Если вам это не нравится, вы можете купить приложение «Homebridge for RaspberryPi», стоимость которого составляет 379 рублей (около 5,50 евро), и установить его на устройстве с iOS. Приложение выполняет большую работу: от установки ОС / установщика с открытым исходным кодом «NOOBS» на RaspberryPi до настройки и управления Homebridge.

Homebridge для RaspberryPi: приложение настраивает миникомпьютер для использования Homebridge.

В нашем тесте установка моста не сработала сразу, но со второй попытки мы смогли без проблем установить Homebridge. Также возможна установка плагинов, с помощью которых можно интегрировать устройства. Таким образом, мы cмогли легко подключить очиститель и увлажнитель от Xiaomi в HomeKit. Разумеется, вам нужно немного поработать над функциональностью Homebridge, но данное приложение — отличная помощь и поможет вам шаг за шагом в установке и последующей настройке, даже если интерфейс приложения выглядит несколько старомодным.

Любой, кто хочет интегрировать устройства через Homebridge в свою систему HomeKit, должен установить соответствующие плагины. Уже сейчас на npmjs.com доступны сотни плагинов для многочисленных производителей умных устройств, которые можно скачивать и использовать бесплатно.

Какое оборудование необходимо

Для наших тестов мы использовали Raspberry Pi 3. Вы также можете использовать RaspberryPi (1, 2, 3 и Zero). Экран или клавиатура для RaspberryPi не нужны, потому что настройка и последующее использование Homebridge могут быть выполнены полностью через приложение iOS «Homebridge for RaspberryPi».

Источник

Matt Cooper’s Weblog

A Blog with Technical Tips

Apple HomeKit for Nest, Logitech Harmony Hub, etc.

Ever want to use Siri or the iOS Home app to control your Nest thermostat (https://nest.com/thermostat/) or Logitech Harmony Hub (http://www.logitech.com/en-us/product/harmony-hub)?

At the time of writing, those products do not come with built-in HomeKit support but they do have APIs for 3rd party developers.

Until those products get updated to work with HomeKit directly, there’s a 3rd party solution out there called Homebridge (https://github.com/nfarina/homebridge) where you set up an Apple HomeKit bridge and then install plug-ins for those HomeKit-incompatible devices:

The Nest plug-in can:

  • Set the target temperature
  • Read the target temperature (what the temperature will eventually become)
  • Read the current temperature (what the temperature is right now)
  • Read the current humidity

The Harmony Hub plug-in can:

  • Turn on an activity (hubs have activities that act like toggle switch accessories so if a hub as 2 activities and you are currently on one activity, turning on another activity will simply switch to that other activity)
  • Turn off an activity (exactly the same pressing the Off button on the remote regardless of whether that activity is the current activity)
Читайте также:  Как менять экран айфон 7

Setting up Homebridge involves a financial commitment (you need hardware to run it like an always-on computer, a Docker-compatible NAS, or other device) and there’s no guarantees that Homebridge will work for your exact home devices or whether it will keep working for you in the future (the software is free after all) so consider this may just be a toy. I chose the NAS-based approach because I had other reasons to buy that hardware. For a long term solution, you should ask the companies that make your favorite HomeKit-incompatible devices to add support for HomeKit or simply stop buying the incompatible products and instead support companies making products that do support HomeKit.

Initial Setup

Get a device that can run Docker. For example, some Synology NAS (network attached storage) models are capable of running Docker. Go to https://www.synology.com/en-us/dsm/app_packages/Docker to see a list of compatible devices, e.g. the DS216+II ($300) and be sure to get disks to put into the NAS too (2x$231 for WD Red 6TB NAS-grade disks). Homebridge takes up hardly any space at all so 6TB disks might be overkill for you unless you are using this for other NAS purposes like backups.

Connect to your Synology NAS DSM (DiskStation manager) using your browser (refer to your Synology setup instructions for how to do this, e.g. a QuickConnect URL).

Open the DSM Control Panel – Hardware & Power – HDD Hibernation and turn off any hibernation. I was experiencing Docker mysteriously deleting my Homebridge containers without any explanation (no log messages) until I cam across someone online suggesting to disable hibernation. Once disabling it, I no longer experienced this daily mystery.

Open the DSM Package Center.

Search for Docker and install it. If Docker is not found, then this Synology doesn’t support running Docker.

Open the DSM Control PanelShared Folders.

Create a shared folder named docker.

From the DSM Main Menu, open Docker.

From Docker’s Registry tab, search for the image marcoraddatz-synology-homebridge, select it, and click Download.

Using your computer, mount the docker shared folder, e.g. using the macOS Finder – Go – Connect to Server and then specify afp://yoursynologyname.local and then select the docker share.

Create a folder named homebridge in the docker share.

In this new homebridge folder, create a text file named install.sh (a shell script) using a pure text editor such as TextWrangler (you cannot use a rich text editor like TextEdit).

The contents of install.sh should be like the following (this is where you identify which Homebridge plug-ins you want to use):

In that same homebridge folder of the docker share, create another text file named config.json (JSON has a specific syntax so you need to be careful about commas, braces, etc.–you may find a JSON validator to help you catch syntax errors).

The contents of config.json should be something like the following (don’t worry about changing the contents of it just yet, we will edit that later and leave it like this for now):

Go back to your web browser where you have loaded your Synology DSM. In the Docker app, click on the Image tab. Select the Homebridge row and click Launch to create a container. Click Advanced Settings. Go to the Volume tab – Add Folder and select docker – homebridge. This will prompt you for a Mount path which should be set to /root/.homebridge (essentially an otherwise hidden folder alias). Go to the Network tab and check the Use the same network as Docker host option. Click OK on the Advanced Settings dialog then Next then Apply.

Читайте также:  Как скинуть блокировку активации айфона

Go to the Docker Container tab to see the container we launched. This is where you can start, stop, or restart your Homebridge. You can also see a log of activity (in case of errors) by selecting the container’s row and then clicking on DetailsLog (it doesn’t auto-update so you may need to click the reload icon in the bottom-right corner if you are expecting more text to be logged).

If the Homebridge container is currently running, either click the toggle switch to turn off or select the container row and then click ActionStop.

Let’s go back to your config.json file in the docker share to finalize the settings:

Notice the platforms array has a series of comma-separated objects indicated with <and >. If you are not using a particular Homebridge plug-in, delete the corresponding platform entry (remember to make sure your JSON is still valid).

The Harmony Hub platform is pretty much automatic so no tweaking necessary.

If you are going to use the Nest plug-in, there is a bit of a process you need to complete to make sure that configuration is correct for your specific Nest thermostat (these steps were adapted from the plug-in’s own setup instructions), e.g.:

  1. Go to https://developer.nest.com
  2. Choose Sign In
  3. Use your normal Nest account to sign in
  4. Fill in you info in ‘Step 1’
  5. In ‘Step 2’ set:
    • Company Name: HomeBridge-Nest
    • Company URL: https://github.com/kraigm/homebridge-nest
    • Country: [Your Country]
    • Size of Company: Individual
    • Then read and agree to the terms and submit
  6. Go to Products and create a new product
  7. Fill in:
    • Product Name: HomeBridge
    • Description: Open source project to provide HomeKit integration
    • Categories: HomeAutomation
    • Support URL: https://github.com/kraigm/homebridge-nest
    • Redirect URL: [LEAVE BLANK]
    • Permissions (minimum):
      • Enable Thermostat with read/write v6
      • Enable Away with read/write v2
      • Enable Smoke+CO alarm with read v4 (if you ever might want Nest Protect)
      • Enable Camera with read v2 (if you ever might want Nest Cam, motion detection only)
  8. Now you should have a product. Now locate the Keys section on the right of your product’s page
  9. Copy the Product ID to your Homebridge config.json as the clientId in the Nest config
  10. Copy the Product Secret to your Homebridge config.json as the clientSecret in the Nest config
  11. Navigate to the Authorization URL
  12. Accept the terms and copy the Pin Code to your Homebridge config.json as the code in the Nest config
  13. Run Homebridge once (do not include the token in the config at this time; leave it blank) and you should find a log message (Docker – Container – Homebridge – Details – Log) that says something like “CODE IS ONLY VALID ONCE! Update config to use <‘token’:’c.5ABsTpo88k5yfNIxZlh…’>instead.” Copy that exact token value to your Homebridge config.json as the token in the Nest config. If you do not do this then the container will periodically crash even though you might otherwise think your Nest is working properly.
  14. Restart Homebridge and it should succeed with the new token.
    After that you will be done with the Nest config. If the token is working correctly, you no longer need the other three configs (clientId, clientSecret, and code) nor the original username and password from the legacy system (but you can keep them around if you wish, they will be ignored).

Connect Homebridge to HomeKit

Using your iOS device, open the built-in Home app.

Tap on the Rooms tab, swipe to the Default Room, tap the + button, and tap Add Accessory.

If Docker is successfully set up for Homebridge, a button named Homebridge will appear. Tap on it.

You may get a dialog asking you to Add Anyway then tap on Enter Code Manually.

Type in the bridge pin from the config.json file to confirm the pairing.

You will then see a series of Accessory confirmations. Since you might have multiple Harmony Hubs, it can be difficult to identify which switch corresponds to which Hub so for now, you can just keep tapping on Next to have them all added into the Default Room or an assumed room. If you don’t already have rooms set up, now is a good time to create a room for every room where your devices are located (e.g. Living Room, Family Room, Bedroom, etc.).

For each accessory, long-press the accessory icon to interact with it or change Details.

For the Nest Thermostat, be careful not to accidentally turn on the Air Conditioner mode in the winter time (keep it on Heat otherwise you might damage your AC equipment). In the details screen, I renamed mine to be just Nest and changed its location to be my Living Room. Examples of things you can say to Siri:

  • What is the temperature in the living room?
  • Set the living room temperature to 70 degrees
  • What is the setting for the living room Nest?
  • Set the Nest to 72 degrees
  • What is the humidity in the Living Room?
  • Turn down the temperature
  • Turn up the temperature by 2 degrees

Note that asking What is the temperature? is regarding the outside temperature via The Weather Channel, not your Nest’s temperature.

For the Harmony Hub activities, I move them to the appropriate room (try toggling them to confirm locations) and then instead of having accessory names like Watch TV, name them as the device name considering you will eventually be using Siri to Turn on/off the [Room Name] [Device Name].

If you want to create HomeKit scenes that change multiple devices at the same time, you may need to use a 3rd party iOS app like Home (https://itunes.apple.com/us/app/home-smart-home-automation/id995994352?mt=8). With Siri you can then say Set Theater or Good morning. Most scenes need to be triggered by saying Set [Scene Name] but there are 4 special scene names that don’t require the Set prefix:

  • Good morning
  • Good night
  • I’m home
  • I’m leaving

Siri struggles with some scene names so you may need to play with the names. Some names I frequently use are Normal (standard light setting), Master night light (a dim setting for the bathroom in the evening), Couch off (Turn off the lights above the couch), Movie lights (really dim and some lights off to prevent screen glare), Intermission (brightness between Normal and Movie lights–not too dark and not too jarringly bright for getting up during a movie).

Examples of scenes that I’ve set up to work with my Harmony Hubs include:

  • Theater – sets the same lights as my Movie lights scene but also turns on the Apple TV Harmony Hub activity. It would be awesome to have this lower a blackout window shade too.
  • Good Morning – sets the master bath lights to normal brightness and turns on the bedroom TV (I haven’t yet set up a special Harmony Hub activity yet that will also change the channel to my favorite morning news but in theory Harmony’s activity setup allows such a macro).

Источник

Читайте также:  Как открывать уведомления с отпечатком айфон
Оцените статью