- Sometimes homekit will go unresponsive because a pairing for a specific
device is missing. To avoid deleting the config entry and recreating
it, which can be a painful process if there are many bridged entities,
the homekit.unpair service allows forceful removal of the pairings so
the accessory can be paired again.
We previously used a value in the linux default ephemerial port range
which meant that if something else happened to use that port HomeKit
would not start up. We now use a value below 32768 to ensure that
the port is not randomly unavailable
When we set up HomeKit, we asked users if they wanted
to create an entry in bridge or accessory mode.
This approach required the user to understand how HomeKit works and
choose which type to create.
When the user includes the media player or camera domains,
we exclude them from the bridge and create the additional entries
for each entity in accessory mode.
* Add support for HomeKit doorbell
* Update homeassistant/components/homekit/type_cameras.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/homekit/type_cameras.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* add speaker service for doorbells
* fixed test as doorbell char requires null value
* removed null value for doorbell presses. and removed broken override of default values
Co-authored-by: J. Nick Koston <nick@koston.org>
* Support multiple camera stream in HomeKit
* Update homeassistant/components/homekit/type_cameras.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Revert "Update homeassistant/components/homekit/type_cameras.py"
This reverts commit d7624c5bff.
* Update homeassistant/components/homekit/type_cameras.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/homekit/type_cameras.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* black
* bump pyhap
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Add humidifier support to homekit
* spell
* dependencies
* lint
* add linked humidity sensor for humidifiers
* Apply suggestions from code review
Co-authored-by: J. Nick Koston <nick@koston.org>
* apply suggestions from code review
* pylint
* Fix tests
* Update homeassistant/components/homekit/type_humidifiers.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update tests/components/homekit/test_homekit.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Apply suggestions from code review
Co-authored-by: J. Nick Koston <nick@koston.org>
* apply suggestions from code review
* lint
* pylint
* push
* test for unavailable linker sensor
* black
* valid values key case
* black
* Update homeassistant/components/homekit/type_humidifiers.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* black
* coverage
* Set current humidity to 0 if linked sensor removed or unavailable
* use last known humidity instead
Co-authored-by: J. Nick Koston <nick@koston.org>
* Remove zeroconf options from homekit
homekit uses the system shared zeroconf instance which
made the interface choice option controlled by the
zeroconf integration setting.
* change to cv.deprecated
* adj
* fix remaining tests from original merge conflict
* remove invalidation_version
* Fire events on homekit TV remote key press
* Changes from code review
* black
* isort
* flake8
* Update tests/components/homekit/test_type_media_players.py
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Ensure camera stream can be restarted after failure
* If ffmpeg failed to start, was killed, or the iOS device
closed the stream right away, the stream could never
be started until the HomeKit bridge was restarted.
* watch ffmpeg instead of checking only once
* handle forceful shutdowns gracefully
* Increase coverage
* Homekit cameras - Add codecs support
* Add valid_codecs + move audio application parameter
* Increase video bufsize
* Increase audio bufsize
* Update config flow to be aware of the copy option
* Add tests for copy video and audio codec
* remove unused from test
* remove unused from test
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add homekit camera support
* Cleanup pyhapcamera inheritance
* Add camera to homekit manifest
* Use upstream pyhap server handler in homekit
* Remove unused homekit constants
* Fix lint errors in homekit camera
* Update homekit camera log messages
* Black after conflict fixes
* More conflict fixes
* missing srtp
* Allow streaming retry when ffmpeg fails to connect
* Fix inherit of camera config, force kill ffmpeg on failure
* Fix audio (Home Assistant only comes with OPUS)
* Fix audio (Home Assistant only comes with OPUS)
* Add camera to the list of supported domains.
* add a test for camera creation
* Add a basic test (still needs more as its only at 44% cover)
* let super handle reconfigure_stream
* Remove scaling as it does not appear to be needed and causes artifacts
* Some more basic tests
* make sure no exceptions when finding the source from the entity
* make sure the bridge forwards get_snapshot
* restore full coverage to accessories.py
* revert usage of super for start/stop stream
* one more test
* more mocking
* Remove -tune zerolatency, disable reconfigure_stream
* Restore -tune zerolatency
Co-authored-by: John Carr <john.carr@unrouted.co.uk>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Config flow for homekit
Allows multiple homekit bridges to run
HAP-python state is now stored at .storage/homekit.{entry_id}.state
aids is now stored at .storage/homekit.{entry_id}.aids
Overcomes 150 device limit by supporting
multiple bridges.
Name and port are now automatically allocated
to avoid conflicts which was one of the main
reasons pairing failed.
YAML configuration remains available in order to offer entity
specific configuration.
Entries created by config flow can add and remove
included domains and entities without having to restart
* Fix services as there are multiple now
* migrate in executor
* drop title from strings
* Update homeassistant/components/homekit/strings.json
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Make auto_start advanced mode only, add coverage
* put back title
* more references
* delete port since manual config is no longer needed
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Display a QR code for homekit pairing
This will reduce the failure rate with HomeKit
pairing because there is less chance of entry
error.
* Add coverage
* Test that the qr code is created
* I cannot spell
* Update homeassistant/components/homekit/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/homekit/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* HomeKit: Store generated aid against unique_id where possible
* Fix conflict
* Fix max accessories check
* homekit counts the bridge as an accessory
* Add coverage for aidmanager
* prepare for merge
Co-authored-by: J. Nick Koston <nick@koston.org>
* Set homekit alarm/sensor/switch state as soon as possible
This change is part of a multi-part effort to fix the
HomeKit event storms on startup.
Previously we would set the states after HomeKit
had started up which meant that when the controller
client connected it would request the states and get
a list of default states so all the initial states
would always be wrong. The defaults states generally went
unnoticed because we set the state of each HomeKit device
soon after which would result in an event storm in the log
that looked like the following for every client and every
device:
Sending event to client: ('192.168.x.x', 58410)
Sending event to client: ('192.168.x.x', 53399)
Sending event to client: ('192.168.x.x', 53399)
To solve this, we now set the state right away when we
create the entity in HomeKit, so it is correct on
initial sync, which avoids the event storm. Additionally,
we now check all states values before sending an update
to HomeKit to ensure we do not send events when nothing
has changed.
* pylint
* Fix event storm in covers as well
* fix refactoring error in security system
* cover positions, now with constants
* Fix reversed door closing/opening states in HomeKit
When we closed the door we would set state 2 which
is "Opening" it should have been 3 which is
"Closing"
When we opened the door we would set state 3 which
is "Closing" it should have been 2 which is
"Opening"
Add constants to make this easier to catch
in the future.
* Remove debug
* Add note about target door state
* Add homekit configuration option to bind to default interface
Homekit can fail to be discoverable because the
zeroconf default is to bind to all interfaces
(InterfaceChoice.All). This does not work
on some systems and (InterfaceChoice.Default) which
binds to 0.0.0.0 is needed for homekit to zeroconf
to function.
A new option is available for homekit
zeroconf_default_interface: true
* Update tests
* Update homeassistant/components/homekit/__init__.py
Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>
* Update homeassistant/components/homekit/__init__.py
Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>
* Review items
* has a default
* Revert "has a default"
This reverts commit 24ecf0920f.
Breaks the tests
Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
* Add HomeKit support for slat tilting
* Reset tilt-specific attribute, not position attribute
Co-Authored-By: J. Nick Koston <nick@koston.org>
* Add explanation why we fix HomeKit's targets
We have to assume that the device has worse precision than HomeKit. If it
reports back a state that is only _close_ to HK's requested state, we'll
"fix" what HomeKit requested so that it won't appear out of sync.
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add options to specify advertised IP and MAC for HomeKit Bridge
This makes use of HAP-python's new feature in version 2.6.0
that allows to specify the mDNS advertised IP and MAC address.
This is a requirement for the following use cases:
- Running Home Assistant behind a NAT, e.g. inside Docker.
- Running it on a system with multiple interfaces there
the default IP address, DNS entry and hostname diverge.
The forwarding of the required mDNS packets can be done with
an avahi-daemon based gateway, e.g. by using enable-reflector=yes.
Specifying the MAC address makes it possible to identify an
accessory in case HA is run inside a ephemeral docker container.
Whitespace changes were performed due to black and flake8.
* Update tests for HomeKit Bridge due to IP and MAC advertising
Whitespace changes were performed due to black and flake8.
* Remove the possibility to set the MAC address of the HomeKit Bridge
Since the MAC address is a random device ID, there is no need
for the user to be able to set a custom MAC address value for it.
Whitespace changes were performed due to black and flake8.