Home assistant apple homekit

Содержание
  1. HomeKit Controller
  2. Supported devices
  3. ‘Stateless’ switches and sensors
  4. Pairing with an insecure setup code
  5. Troubleshooting
  6. I don’t have a HomeKit PIN
  7. Home Assistant cannot discover my device
  8. HomeKit controller is finding devices on my network even though I don’t have any Apple devices
  9. I have a warning in my logs about HomeKit controller skipping updates
  10. I can’t see any events generated for “stateless” accessories
  11. Home Assistant can’t see my Homebridge device(s)
  12. HomeKit
  13. Configuration
  14. Manual configuration
  15. Configuration Variables
  16. Setup
  17. Move Home Assistant install
  18. Considerations
  19. Accessory ID
  20. Device Limit
  21. Multiple HomeKit instances
  22. Accessory mode
  23. Configure Filter
  24. Docker Network Isolation
  25. Firewall
  26. Supported Components
  27. Device Triggers
  28. iOS Remote Widget
  29. Troubleshooting
  30. All or some devices are intermittently unresponsive
  31. The below testing was conducted with Home Assistant 2021.6 (HAP-python 3.5.0) and iOS/tvOS 14.6
  32. Resetting when created via YAML
  33. Resetting when created via the Integrations screen
  34. Errors during pairing
  35. Minimal Configuration
  36. PIN doesn’t appear as persistent status
  37. Home Assistant Bridge doesn’t appear in the Home App (for pairing)
  38. Home Assistant Bridge doesn’t appear in the Home App (for pairing) — Docker
  39. Home Assistant Bridge doesn’t appear in the Home App (for pairing) — VirtualBox
  40. Pairing hangs — zeroconf error
  41. Pairing hangs — only works with debug configuration
  42. Pairing hangs — no error
  43. Issues during normal use
  44. My entity doesn’t show up
  45. HomeKit doesn’t work on second Home Assistant instance
  46. Specific entity doesn’t work
  47. Accessories are all listed as not responding
  48. Accessory not responding — after restart or update
  49. The linked battery sensor isn’t recognized
  50. My media player is not showing up as a television accessory
  51. Can’t control volume of your TV media player?
  52. Camera video is not streaming
  53. Camera streaming is unstable or slow
  54. Multiple camera streams
  55. Camera audio is not streaming
  56. Camera motion notifications
  57. Doorbell button notifications
  58. HomeKit stalls or devices respond slowly with many cameras
  59. Resetting accessories
  60. Unpairing and Re-pairing

HomeKit Controller

The HomeKit controller integration allows you to connect accessories with the “Works with HomeKit” logo to Home Assistant. This integration should not be confused with the HomeKit integration, which allows you to control Home Assistant devices via HomeKit.

The integration will automatically detect HomeKit compatible devices that are ready to pair if the zeroconf integration is enabled. This is enabled by default on new installations via the default_config component.

To see which devices have been discovered see the “Integrations” page in your Home Assistant dashboard. When you click on “Configure” you can enter your HomeKit PIN and the device should be added to your Home Assistant instance. If your device is currently paired with an Apple device via HomeKit, you will need to reset it in order to pair it with Home Assistant. Once Home Assistant is configured to work with the device, you can export it back to Siri and Apple Home with the HomeKit integration.

Supported devices

There is currently support for the following device types within Home Assistant:

  • Alarm Control Panel (HomeKit security system)
  • Climate (HomeKit thermostats and air conditioners)
  • Cover (HomeKit garage door openers, windows, or window coverings)
  • Light (HomeKit lights)
  • Lock (HomeKit lock)
  • Switch (HomeKit switches, outlets and valves)
  • Binary Sensor (HomeKit motion, contact, occupancy, carbon monoxide and smoke sensors)
  • Sensor (HomeKit humidity, temperature, co2 and light level sensors)
  • Fan
  • Air Quality
  • Humidifier (HomeKit humidifiers and dehumidifiers)
  • Automation Triggers (HomeKit ‘stateless’ accessories like buttons, remotes and doorbells)

If your device is not on this list then you may still be able to pair it, and it will be visible in the Device Registry. But Home Assistant may not create entities for it.

HomeKit IP accessories for these device types may work with some caveats:

  • If the device is Wi-Fi based and has no physical controls or screen then you may need an Apple HomeKit device like an iPhone or iPad to get the accessory onto your Wi-Fi network. For example, for a Koogeek LS1 you must add the accessory to HomeKit on your iOS device, then remove it from the iOS device. This leaves the LS1 in an unpaired state but still on your Wi-Fi. Home Assistant can then find it and pair with it.
  • You need to know the HomeKit PIN. There is no way to recover this if you do not have it. In this case, you will need to contact the manufacturer to see what options you have.

HomeKit controller will poll your devices, but it will also automatically enable push updates for accessories that support it.

Home Assistant does not currently support HomeKit BLE.

‘Stateless’ switches and sensors

Some HomeKit devices (like buttons, remotes and doorbells) don’t have sensors that can be read like a normal HomeKit device — they only inform Home Assistant when something happens. This means Home Assistant can’t show an entity for them, as they have no state. But they are available for use as device automations.

For example, to add a new automation that is triggered by one of these devices go to the device registry UI and find the device you want to use as a trigger. Click on it to reveal the device registry entry for it. You will be able to see the devices model, manufacturer and firmware version. You might see related entities — like a battery sensor.

Click on the button to add an automation. A popup will show you a list of triggers that are available.

Clicking on one will drop you in to the automation editor with a trigger pre-filled in. If your device supports it you will be able to choose between types of event — like a short press or a long press.

When you have filled in the rest of the form to create your migration it will show up against that device in the device registry.

Pairing with an insecure setup code

Some device manufacturers do not follow the HomeKit spec and will use a fixed code or trivially guessable code such as 123-45-678 for pairing. HomeKit Controller will warn when pairing about the insecure nature of this configuration and require additional consent before pairing with the accessory. Consider finding a replacement device that implements code randomization.

Troubleshooting

I don’t have a HomeKit PIN

When you buy a certified HomeKit-enabled device, the PIN might be in the instructions or on a sticker on the accessory itself.

Devices with screens like thermostats may not have PIN codes in the packaging at all. Every time you click on “Configure” in the Home Assistant frontend, your accessory will generate a new pairing code and show it on the display.

If your device doesn’t have a display and received HomeKit support after it was released, you may not have a pairing code. Dealing with this is manufacturer specific. Some manufacturers allow you to see the pairing code in their iOS app. Others force you to use their app to configure HomeKit and don’t let you have the pairing pin — right now you won’t be able to use HomeKit Controller with those devices.

If you have lost your PIN code, then you may not be able to pair your accessory. You should contact the manufacturer to see if there is anything you can do.

Home Assistant cannot discover my device

For IP accessories, Home Assistant can only find devices that are already on the same network as your device. If an accessory is Wi-Fi based and has no user interface for joining it to your Wi-Fi network, you will need an Apple HomeKit controller device (an iPhone or iPad). You should pair it with the controller and then remove the pairing in the UI (but do not reset the accessory itself). This will leave the accessory on your Wi-Fi network but in an unpaired state, and then Home Assistant can find it.

Home Assistant can only find accessories that aren’t already paired. Even if you reset your Home Assistant configuration, the accessory will still think it is paired and you won’t be able to use it with Home Assistant. You should reset the accessory according to the manufacturer’s instructions. Some devices have a “Reset HomeKit” option, and some may require a full reset.

If your devices are on a different VLAN to Home Assistant you must have an mDNS reflector for discovery and pairing to work.

Check that your device is visible with an mDNS tool. If you are comfortable with the command line you can run netdisco from your Home Assistant installation:

netdisco is not used by Home Assistant to discover HomeKit devices, so if it can’t see your device the problem is more likely to be environmental than with Home Assistant itself.

Alternatively if you are less comfortable with the command line you could use Discovery for Mac or iOS, Android Service Browser or All My Lan. These are a less useful diagnostic as they aren’t running from the same point on your network as Home Assistant. Even if it is visible in this tool it might still be a networking issue. They can give sometimes give clues.

Where a discovery tool does give an IP, check it is what you expect (compare to DHCP leases in your router for example). Can you ping it? If not, you have a network problem.

Some users have reported that their network configuration has interfered with using HomeKit devices with Home Assistant. The symptoms vary but include discovery not working at all or being unstable (sometimes working, sometimes not). This is very specific not only to the hardware in use but how it is configured and unfortunately we can’t suggest appropriate settings. For example, we have seen IGMP Snooping be blamed as the cause of the problem and also suggested as the fix.

HomeKit controller is finding devices on my network even though I don’t have any Apple devices

This is completely normal. Unlike many other commercial IoT offerings, the HomeKit protocol is a local and offline protocol that does not rely on the Apple ecosystem to function. You do not need an Apple online account to use a “Works with HomeKit” device. Some Wi-Fi devices may need an iOS device briefly to get them onto your WiFi, but other than that you do not need any Apple hardware on your network.

Читайте также:  Хорошие аркады для айфона

Many IoT devices are getting a post-launch HomeKit upgrade. This might mean your device starts showing in Home Assistant as a homekit_controller device even though when you bought it without HomeKit support. This might be a better choice for you than a native integration. For example, many climate devices have an online-only API and a HomeKit API. The HomeKit one might not expose all of the settings and controls you are used to, but it also won’t break if your Internet connection goes down or the cloud service goes away.

I have a warning in my logs about HomeKit controller skipping updates

You may say a log entry that looks like this:

In these cases it’s unlikely that HomeKit controller itself is directly responsible. This is a safety feature to avoid overloading your Home Assistant instance. It means that Home Assistant tried to poll your accessory but the previous poll was still happening. This means it is taking over 1 minute to poll your accessory. This could be caused by a number of things:

  • You have too many blocking synchronous integrations for your Home Assistant instance. All synchronous integrations share a thread pool, and if there are lots of tasks to run on it they will queued, which will cause delays. In the worst cases this queue can build up faster than it can be emptied. Faster hardware may help, but you may need to disable some integrations.
  • Your network connection to an accessory is poor and HomeKit Controller is unable to reach the accessory reliably. This will likely require a change to your network setup to improve Wi-Fi coverage or replace damaged cabling.
  • There is a problem with the accessory itself which is causing intermittent network issues.

In these cases, HomeKit Controller will skip polling to avoid a buildup of back pressure in your instance.

I can’t see any events generated for “stateless” accessories

This is expected. The only way to use stateless accessories like some doorbells, buttons or remotes with Home Assistant is through device automations. Home Assistant doesn’t create duplicate events for device automation triggers, so for example you won’t be able to watch them with the events developer tools.

Home Assistant can’t see my Homebridge device(s)

In your Homebridge settings/config, make sure you are using ciao and not Bonjour-HAP . Bonjour-HAP is no longer recommended by homebridge and is considered broken/unsupported.

Источник

HomeKit

The HomeKit integration allows you to make your Home Assistant entities available in Apple HomeKit, so they can be controlled from Apple’s Home app and Siri; even if those devices do not natively support HomeKit.

Please make sure that you have read the considerations listed below to save you some trouble later. However, if you do encounter issues, check out the troubleshooting section.

If you want to control HomeKit-only devices with Home Assistant, check out the HomeKit controller integration, which provides the possibility to pull HomeKit-enabled devices into Home Assistant.

Configuration

Adding HomeKit to your Home Assistant instance can be done via the user interface, by using this My button:

HomeKit can be auto-discovered by Home Assistant. If an instance was found, it will be shown as “Discovered”, which you can select to set it up right away.

If there wasn’t any discovered automatically, don’t worry! You can set up a manual integration entry:

  • Browse to your Home Assistant instance.
  • In the sidebar click on Configuration.
  • From the configuration menu select: Integrations.
  • In the bottom right, click on the Add Integration button.
  • From the list, search and select “HomeKit”.
  • Follow the instruction on screen to complete the set up.

Manual configuration

If you want make specific changes to the way entities are published to HomeKit, override the IP address the HomeKit integration uses to communicate with your network or change the IP address the HomeKit uses to advertise itself to the network, then you will need to configure the HomeKit integration using an entry in your configuration.yaml file.

This is an example entry of how that would look:

Configuration Variables

Port for the HomeKit extension. If you are adding more than one instance they need to have different values for port.

Needs to be unique for each instance of Home Assistant using the integration on the same local network. Between 3 and 25 characters. Alphanumeric and spaces allowed.

Home Assistant Bridge

The local network IP address. Only necessary if the default from Home Assistant does not work.

HomeKit can expose an entity via a bridge, or a single entity as an accessory which is needed for Television Media Players. (Accessory mode)

If you need to override the IP address used for mDNS advertisement. (For example, using network isolation in Docker and together with an mDNS forwarder like avahi-daemon in reflector mode)

Filters for entities to be included/excluded from HomeKit. (Configure Filter)

Domains to be included.

Include all entities matching a listed pattern (e.g., binary_sensor.*_motion ).

Entities to be included.

Domains to be excluded.

Exclude all entities matching a listed pattern (e.g., sensor.*_motion ).

Entities to be excluded.

Configuration for specific entities. All subordinate keys are the corresponding entity ids of the domains, e.g., alarm_control_panel.alarm .

Additional options for specific entities.

Name of the entity to show in HomeKit. HomeKit will cache the name on the first run so the accessory must be reset for any change to take effect.

The entity_id of a sensor entity to use as the battery of the accessory. HomeKit will cache an accessory’s feature set on the first run so a device must be reset for any change to take effect.

The entity_id of a binary_sensor entity to use as the doorbell sensor of the camera accessory to enable doorbell notifications. HomeKit will cache an accessory’s feature set on the first run so a device must be reset for any change to take effect.

The entity_id of a sensor entity to use as the humidity sensor of the humidifier/dehumidifier accessory. HomeKit will cache an accessory’s feature set on the first run so a device must be reset for any change to take effect.

The entity_id of a binary_sensor entity to use as the motion sensor of the camera accessory to enable motion notifications. HomeKit will cache an accessory’s feature set on the first run so a device must be reset for any change to take effect.

The entity_id of a binary_sensor entity to use as the obstruction sensor of the garage door (cover) accessory to enable obstruction state tracking. HomeKit will cache an accessory’s feature set on the first run so a device must be reset for any change to take effect.

Minimum battery level before the accessory starts reporting a low battery.

Code to arm / disarm an alarm or lock / unlock a lock. Only applicable for alarm_control_panel or lock entities.

Only for media_player entities. List of feature dictionaries to add for a given entity. Comparable to the platform schema.

Name of the feature to add to the entity representation. Valid features are on_off , play_pause , play_stop and toggle_mute . The media_player entity must support the feature to be valid.

Only for switch entities. Type of accessory to be created within HomeKit. Valid types are faucet , outlet , shower , sprinkler , switch and valve . HomeKit will cache the type on the first run so a device must be reset for any change to take effect.

Only for camera entities. The number of simultaneous streams the camera can support.

Only for camera entities. The source IP address to use when streaming to RTP clients. If your Home Assistant host has multiple interfaces, selecting a specific IP may be necessary.

local IP from Home Assistant

Only for camera entities. A URL, file or other valid FFmpeg input string to use as the stream source, rather than the default camera source. Required for camera entities that do not natively support streaming (MJPEG). If -i is not found in the stream source, it is prepended to construct the FFmpeg input.

stream source from camera entity

Only for camera entities. Whether the camera supports audio. Audio is disabled unless this flag is set to True .

Only for camera entities. Maximum width supported by camera. Used when generating advertised video resolutions.

Only for camera entities. Maximum height supported by camera. Used when generating advertised video resolutions.

Only for camera entities. Maximum FPS (frames per second) supported by camera. Used when generating advertised video resolutions.

Only for camera entities. FFmpeg stream selection mapping for the audio-only stream. Selects the first audio stream in the input stream by default. If your input stream has multiple audio streams, this may need to be adjusted.

Only for camera entities. FFmpeg stream selection mapping for the video-only stream. Selects the first video stream in the input stream by default. If your input stream has multiple video streams, this may need to be adjusted.

Only for camera entities. RTP packet size used for streaming audio to HomeKit clients.

Only for camera entities. RTP packet size used for streaming video to HomeKit clients.

Only for camera entities. FFmpeg video codec for transcoding. copy option reduces CPU load when video source already encoded with H264 (MPEG4). h264_omx option is only available with custom FFmpeg builds and enables GPU Hardware acceleration on Raspberry Pi.

Only for camera entities. FFmpeg audio codec for transcoding. copy option reduces CPU load when audio source already encoded with libopus .

Читайте также:  Можно ли разряжать айфон до выключения

Include device triggers for all matching device ids. Configuration in the UI via Options is recommended instead.

Setup

To enable the HomeKit integration in Home Assistant, add the following to your configuration file:

After Home Assistant has started, the entities (depending on the filter) are exposed to HomeKit if they are supported. To add them:

  1. Open the Home Assistant frontend. A new card will display the pairing QR code and the pin code as seen in the example below. Note: If pin code is not displayed, check “Notifications” (the bell icon) in the lower-left of the Home Assistant UI.
  2. Open the Apple Home app.
  3. Click Add Accessory , then scan the QR code or select Don’t Have a Code or Can’t Scan? and choose the Home Assistant Bridge .
  4. Confirm that you are adding an Uncertified Accessory by clicking on Add Anyway .
  5. Enter the PIN code (skip this step if you scanned the QR code).
  6. Follow the setup by clicking on Next and lastly Done in the top right-hand corner.
  7. The Home Assistant Bridge and the Accessories should now be listed in the Home app.

After the setup is completed, you should be able to control your Home Assistant integrations through Apple’s Home and Siri.

Move Home Assistant install

If you would like to retain your HomeKit pairing when moving to a new Home Assistant device or installation, besides copying the configuration files you also need to copy the .storage/homekit.* file inside your configuration directory. Keep in mind that the folder is usually hidden by default, depending on your operating system.

Before you copy it, make sure to stop the old and new Home Assistant instances first entirely, otherwise it won’t work.

Considerations

Accessory ID

Currently, this integration uses the entity_id to generate a unique accessory id (aid) for HomeKit . The aid is used to identify a device and save all configurations made for it. This, however, means that if you decide to change an entity_id that does not have a unique_id , all configurations for this accessory made in the Home app will be lost.

Device Limit

The HomeKit Accessory Protocol Specification only allows a maximum of 150 unique accessories ( aid ) per bridge. Be mindful of this when configuring the filter(s). If you plan on exceeding the 150 devices limit, it is possible to create multiple bridges. If you need specific configuration for some entities via entity_config be sure to add them to a bridge configured via YAML .

Multiple HomeKit instances

If you create a HomeKit integration via the UI (i.e., Configuration >> Integrations), it must be configured via the UI only. While the UI only offers limited configuration options at the moment, any attempt to configure a HomeKit instance created in the UI via the configuration.yaml file will result in another instance of HomeKit running on a different port.

It is recommended to only edit a HomeKit instance in the UI that was created in the UI, and likewise, only edit a HomeKit instance in YAML that was created in YAML.

Accessory mode

When exposing a Camera, Activity based remote (a remote that supports activities), Lock, or Television media player (a media_player with device class tv ) to HomeKit, mode must be set to accessory , and the relevant include filter should be setup to only include a single entity.

To quickly add all accessory mode entities in the UI:

  1. Create a new bridge via the UI (i.e., Configuration >> Integrations).
  2. Select media_player , remote , lock , and camera domains.
  3. Complete the flow as normal.
  4. Additional HomeKit entries for each entity that must operate in accessory mode will be created for each entity that does not already have one.
  5. If you have already created another HomeKit bridge for the non-accessory mode entities, the new bridge can safely be removed.
  6. Pair each bridge or accessory.

To add a single entity in accessory mode:

  1. Create a new bridge via the UI (i.e., Configuration >> Integrations)
  2. Before pairing the bridge, access the options for the bridge.
  3. Change the mode to accessory
  4. Select the entity.
  5. Complete the options flow
  6. Pair the accessory.

Configure Filter

By default, no entity will be excluded. To limit which entities are being exposed to HomeKit , you can use the filter parameter. Keep in mind only supported components can be added.

Filters are applied as follows:

  1. No includes or excludes — pass all entities
  2. Includes, no excludes — only include specified entities
  3. Excludes, no includes — only exclude specified entities
  4. Both includes and excludes:
    • Include domain and/or glob patterns specified
      • If domain is included, and entity not excluded or match exclude glob pattern, pass
      • If entity matches include glob pattern, and entity does not match any exclude criteria (domain, glob pattern or listed), pass
      • If domain is not included, glob pattern does not match, and entity not included, fail
    • Exclude domain and/or glob patterns specified and include does not list domains or glob patterns
      • If domain is excluded and entity not included, fail
      • If entity matches exclude glob pattern and entity not included, fail
      • If entity does not match any exclude criteria (domain, glob pattern or listed), pass
    • Neither include or exclude specifies domains or glob patterns
      • If entity is included, pass (as #2 above)
      • If entity include and exclude, the entity exclude is ignored

Docker Network Isolation

The advertise_ip option can be used to run this integration even inside an ephemeral Docker container with network isolation enabled, e.g., not using the host network.

You may need to set the default network interfaces Home Assistant uses, in its network configuration.

To use advertise_ip , add the option to your homekit configuration:

Restart your Home Assistant instance. This feature requires running an mDNS forwarder on your Docker host, e.g., avahi-daemon in reflector mode.

Firewall

If you have a firewall configured on your Home Assistant system, make sure you open the following ports:

  • UDP: 5353
  • TCP: 21063 (or the configured/used port in the integration settings).

Supported Components

The following integrations are currently supported:

Component Type Name Description
alarm_control_panel SecuritySystem All security systems.
automation / input_boolean / remote / scene / script / vacuum Switch All represented as switches.
input_select / select Switch Represented as a power strip with buttons for each option.
binary_sensor Sensor Support for co2 , door , garage_door , gas , moisture , motion , occupancy , opening , smoke and window device classes. Defaults to the occupancy device class for everything else.
camera Camera All camera devices. HomeKit Secure Video is not supported at this time.
climate Thermostat All climate devices.
cover GarageDoorOpener All covers that support open and close and have garage or gate as their device_class .
cover WindowCovering All covers that support set_cover_position .
cover WindowCovering All covers that support open_cover and close_cover through value mapping. ( open -> >=50 ; close -> )
cover WindowCovering All covers that support open_cover , stop_cover and close_cover through value mapping. ( open -> >70 ; close -> ; stop -> every value in between)
device_tracker / person Sensor Support for occupancy device class.
fan Fan Support for on / off , direction and oscillating .
fan Fan All fans that support speed and speed_list through value mapping: speed_list is assumed to contain values in ascending order. The numeric ranges of HomeKit map to a corresponding entry of speed_list . The first entry of speed_list should be equivalent to off to match HomeKit’s concept of fan speeds. (Example: speed_list = [ off , low , high ]; off -> ; low -> between 33 and 66 ; high -> > 66 )
humidifier HumidifierDehumidifier Humidifier and Dehumidifier devices.
light Light Support for on / off , brightness and rgb_color .
lock DoorLock Support for lock / unlock .
media_player MediaPlayer Represented as a series of switches which control on / off , play / pause , play / stop , or mute depending on supported_features of entity and the mode list specified in entity_config .
media_player TelevisionMediaPlayer All media players that have tv as their device_class . Represented as Television and Remote accessories in HomeKit to control on / off , play / pause , select source , or volume increase / decrease , depending on supported_features of entity. Requires iOS 12.2/macOS 10.14.4 or later.
sensor TemperatureSensor All sensors that have Celsius or Fahrenheit as their unit_of_measurement or temperature as their device_class .
sensor HumiditySensor All sensors that have % as their unit_of_measurement and humidity as their device_class .
sensor AirQualitySensor All sensors that have pm25 as part of their entity_id or pm25 as their device_class
sensor CarbonMonoxideSensor All sensors that have co as their device_class
sensor CarbonDioxideSensor All sensors that have co2 as part of their entity_id or co2 as their device_class
sensor LightSensor All sensors that have lm or lx as their unit_of_measurement or illuminance as their device_class
switch Switch Represented as a switch by default but can be changed by using type within entity_config .
water_heater WaterHeater All water_heater devices.
device_automation DeviceTriggerAccessory All devices that support triggers.

Device Triggers

Devices that support triggers can be added to the bridge by accessing options for the bridge in Configuration >> Integrations.

Bridged device triggers are represented as a single press button on stateless programmable switches. This allows a HomeKit automation to run when a device trigger fires. Because the Apple Home app currently only shows the number of the button and not the name, users may find it easier to identify the name of the button in the Eve for HomeKit app.

iOS Remote Widget

Entities exposed as TelevisionMediaPlayer are controllable within the Apple Remote widget in Control Center. Play, pause, volume up and volume down should work out of the box depending on the supported_features of the entity. However, if your television can be controlled in other ways outside of the media_player entity, (e.g., service calls to an IR blaster), it is possible to build an automation to take advantage of these events.

When a key is pressed within the Control Center Remote widget, the event homekit_tv_remote_key_pressed will be fired. The key name will be available in the event data in the key_name field. Example:

Troubleshooting

All or some devices are intermittently unresponsive

HomeKit relies heavily on your home hub to keep track of Bluetooth devices. Additionally, each home hub has to keep track of every HomeKit accessory that you bridge. If you have many accessories, notably cameras or Bluetooth devices, consider disabling HomeKit on older home hubs.

The below testing was conducted with Home Assistant 2021.6 (HAP-python 3.5.0) and iOS/tvOS 14.6

The following home hubs showed strong results when testing with 400 accessories:

  • HomePod
  • HomePod Mini
  • Apple TV 4k Gen 2 (best results when using Ethernet instead of Wi-Fi)

The following home hubs showed strong results when testing with 300 accessories:

  • Apple TV 4k Gen 1 (best results when using ethernet instead of Wi-Fi)

The following home hubs have been reported to have trouble with a large number of accessories:

  • Apple TV HD
  • Various iPad models

Resetting when created via YAML

  1. Delete the HomeKit integration in the Integrations screen.
  2. Restart Home Assistant.
  3. The configuration will be automatically reimported from YAML.
  4. Pair the bridge or accessory.

Resetting when created via the Integrations screen

  1. Delete the HomeKit integration in the Integrations screen.
  2. Recreate the HomeKit integration in the Integrations screen.
  3. Pair the bridge or accessory.

Errors during pairing

If you encounter any issues during pairing, make sure to add the following to your configuration.yaml to try and identify the issue(s).

Follow the above instructions for resetting.

Minimal Configuration

If pairing still fails after trying the steps in (Errors during pairing), it may be caused by a specific entity. Try resetting with a minimal configuration like:

PIN doesn’t appear as persistent status

You might have paired the Home Assistant Bridge already. If not, follow the above instructions for resetting.

Home Assistant Bridge doesn’t appear in the Home App (for pairing)

This is often setup and network related. Make sure to check the other issues below as well, but things that might work include:

  • Check your router configuration
  • Try with Wi-Fi and LAN
  • Change the default port

Remember that the iOS device needs to be in the same local network as the Home Assistant device for pairing.

Home Assistant Bridge doesn’t appear in the Home App (for pairing) — Docker

Set network_mode: host in your docker-compose.yaml . If you have further problems this issue might help.

You can also try to use avahi-daemon in reflector mode together with the option advertise_ip , see above.

Home Assistant Bridge doesn’t appear in the Home App (for pairing) — VirtualBox

Configure the network mode as networkbridge . Otherwise the Home Assistant Bridge won’t be exposed to the network.

Pairing hangs — zeroconf error

Pairing eventually fails, you might see the error message, NonUniqueNameException , you likely need to enable default_interface: true in the zeroconf integration configuration and set a unique name such as name: MyHASS42 .

If you had previously paired (even unsuccessfully), you may need to delete your .homekit.state file in order to able to successfully pair again. See Errors during pairing.

Pairing hangs — only works with debug configuration

Pairing works fine when the filter is set to only include demo.demo , but fails with normal configuration. See specific entity doesn’t work

Pairing hangs — no error

  1. Make sure that you don’t try to add more than 150 accessories, see device limit. In rare cases, one of your entities doesn’t work with the HomeKit component. Use the filter to find out which one. Feel free to open a new issue in the home-assistant repository, so we can resolve it.
  2. Check logs, and search for Starting accessory Home Assistant Bridge on address . Make sure Home Assistant Bridge connected to a correct interface. If it did not, explicitly set homekit.ip_address configuration variable.

Issues during normal use

My entity doesn’t show up

Check if the domain of your entity is supported. If it is, check your filter settings. Make sure the spelling is correct, especially if you use include_entities .

HomeKit doesn’t work on second Home Assistant instance

To use the HomeKit integration with multiple different Home Assistant instances on the same local network, you need to set a custom name for at least one of them. config/name

Specific entity doesn’t work

Although we try our best, some entities don’t work with the HomeKit integration yet. The result will be that either pairing fails completely or all Home Assistant accessories will stop working. Use the filter to identify which entity is causing the issue. It’s best to try pairing and step by step including more entities. If it works, unpair and repeat until you find the one that is causing the issues. To help others and the developers, please open a new issue here: home-assistant/issues/new

If you have any iOS 12.x devices signed into your iCloud account, media player entities with device_class: tv may trigger this condition. Filtering the entity or signing the iOS 12.x device out of iCloud should resolve the issue after restarting other devices.

Accessories are all listed as not responding

There were reports where the IGMP settings in a router were causing issues with HomeKit. This resulted in a situation where all of the Home Assistant HomeKit accessories stopped responding a few minutes after Home Assistant (re)started. Double check your router’s IGMP settings if you experience this issue. The default IGMP settings typically work best.

Accessory not responding — after restart or update

The linked battery sensor isn’t recognized

Try removing the entity from HomeKit and then adding it again. If you are adding this configuration option to an existing entity in HomeKit, any changes you make to this entity’s configuration options won’t appear until the accessory is removed from HomeKit and then re-added. See resetting accessories.

My media player is not showing up as a television accessory

Media Player entities with device_class: tv will show up as Television accessories on devices running iOS 12.2/macOS 10.14.4 or later. If needed, try removing the entity from HomeKit and then adding it again, especially if the media_player was previously exposed as a series of switches. Any changes, including changed supported features, made to an existing accessory won’t appear until the accessory is removed from HomeKit and then re-added. See resetting accessories.

The Universal Media Player has an example of how it can be used to wrap existing entities to enable them to be used as a Television accessory in HomeKit.

Can’t control volume of your TV media player?

The volume and play/pause controls will show up on the Remote app or Control Center. If your TV supports volume control through Home Assistant, you will be able to control the volume using the side volume buttons on the device while having the remote selected on screen.

Camera video is not streaming

Ensure that the ffmpeg integration is configured correctly. Verify that your stream is directly playable with ffplay or VLC Media Player. If you have changed your camera’s entity configuration, you may need to reset the accessory.

Camera streaming is unstable or slow

If your camera supports native H.264 streams, Home Assistant can avoid converting the video stream, which is an expensive operation. To enable native H.264 streaming when configured via YAML, change the video_codec to copy . To allow native H.264 streaming when setting up HomeKit via the UI, go to Configuration >> Integrations in the UI, click Options for your HomeKit Bridge, and check the box for your camera on the Cameras that support native H.264 streams screen.

Multiple camera streams

Multiple streams can be configured with the stream_count configuration option. If you alter the number of streams, you must reset the accessory.

Camera audio is not streaming

Make sure support_audio is True in the camera’s entity configuration.

Camera motion notifications

A motion sensor can be linked via the linked_motion_sensor configuration setting to enable motion notifications.

Doorbell button notifications

A doorbell sensor can be linked via the linked_doorbell_sensor configuration setting to enable motion notifications.

HomeKit stalls or devices respond slowly with many cameras

HomeKit camera snapshots tie up the HomeKit connection during snapshots. To avoid this problem, create a separate HomeKit instance in Accessory Mode for each camera.

Resetting accessories

You may use the service homekit.reset_accessory with one or more entity IDs to reset accessories whose configuration may have changed. This can be useful when changing a media player’s device class to tv , linking a battery, or whenever Home Assistant adds support for new HomeKit features to existing entities.

On earlier versions of Home Assistant, you can reset accessories by removing the entity from HomeKit (via filter) and then re-adding the accessory.

With either strategy, the accessory will behave as if it’s the first time the accessory has been set up, so you will need to restore the name, group, room, scene, and/or automation settings.

Unpairing and Re-pairing

The HomeKit integration remembers a public key for each paired device. Occasionally the public key for a device pairing will be missing because of pairing failures. Suppose one or more devices show the accessory as unavailable. In that case, it may be necessary to unpair and re-pair the device to ensure the integration has the public key for each paired client. The homekit.unpair service will forcefully remove all pairings and allow re-pairing with the accessory. When setting up HomeKit from the UI, this avoids the sometimes time-consuming process of deleting and create a new instance.

The accessory will behave as if it’s the first time the accessory has been set up, so you will need to restore the name, group, room, scene, and/or automation settings.

Источник

Читайте также:  Как понять что apple pencil разрядился
Оцените статью