Communicate with, configure, and control home automation accessories using HomeKit.

HomeKit Documentation

Posts under HomeKit tag

78 Posts
Sort by:
Post not yet marked as solved
2 Replies
447 Views
Good day,I am just learnning Swift and from the beginning i want everything to work otherwise it's not going to work on biger projects.but I do understand what is going on I just can't get the X-Code to get unstuck from where it is.the outlet is not being reconized to make the conection to the code and I did my research and even put the code in-place ,before, making the conection yet, it did not work.it would be in the section on "Create Outlets for UI Elements", 'Outlets'Then on Step (#6) it shows to add a line of code below the class line ;// MARK: Propertiesthen you are to add the conection wiht a control+drag on the ViewController.swift. sheet .Also you can add a line of code under the //MARK Properities and it looks like this; @IBOutlet weak var nameTextField: UITextField! So as, you see I do understand what need to happen I just must be missing a step.Thank-you for any help,BrianI am using the Apple website for instructions so it has all the data layed out very good.https://developer.apple.com/library/ios/referencelibrary/GettingStarted/DevelopiOSAppsSwift/Lesson3.html#//apple_ref/doc/uid/TP40015214-CH22-SW1Thankyou,Brian Helip
Posted
by
Post not yet marked as solved
6 Replies
1.6k Views
Hello.I updated by Apple TV to OS 10. I am using the release version of Xcode 8 to build for TV OS 10.I am able to create an HMHomeManager object. But, it does not return any Homes. The array of Homes is empty. I have the Apple TV signed in to the correct iCloud account and have Home Sharing turned on. I am able to use this Apple TV as a device to manage my HomeKit devices using a phone not on the WiFi network. I used the same code to make an iOS 10 app that successfully returns homes.Are there issues with HomeKit on the Apple TV? Has anyone else experienced this?
Posted
by
Post not yet marked as solved
4 Replies
4.2k Views
Hello,I have a question about having two apple Tvs acting as homekit hubs. One of them is showing status as 'connected' and the other one is in Standby. I assume that the one on styandby can still be used by HomeKit Bluetooth devices to signal correct? if so, and both appleTvs are un range, how does the system decide what hyb processes the signal? additionally, what exactly is the differnece between connected and standby? I would like to understand better the standby status. What is what the hub can and cannot do while on standby.Thanks in advance!!
Posted
by
Post not yet marked as solved
3 Replies
2.5k Views
Hi guys,I've been working on getting some accessories working nicely with the Home App. When dealing with Window Coverings I came across some observations that don't seem to make sense to me and I'd be very thankful if someone would either confirm those observations or tell me, where I am going wrong.Summary: The Home App does not seem to properly use/display the available characteristics for the "Window Covering" serviceThe accessory uses a "Window Covering" service with the default characteristics (Current Position, Target Position, Position State) as well as two optional ones (Target Horizontal Tilt Angle & Current Horizontal Tilt Angle) and has been setup in the HomeKit Accessory Simulator.After adding the accessory to the Home App on my iPad (iOS11.1.2) it properly shows up and I can interact with it while observing the changes in real time in the Simulator.Now for my observations:1. The Home App does NOT show the value of "Current Position" anywhere - the only thing that is displayed is "Target Position"2. The Home App does NOT show the value of "Position State" anywhere - it derives the current state from the delta of "Current Position" and "Target Position". If "Current Position" > "Target Position" it displays "Closing", if "Current Position" < "Opening" and if they are the same, it displays the current value as %.Is this how it is supposed to work? Am I missing something?I intend to connect a real accessory via Home Kit Protocol that can be controlled in two ways:a) by changing the moving direction (up, down, stop)b) setting a desired target positionWith the above observations this leads to the following questions:1. If I set a target position on the accessory, the accessory will a) broadcast the change to "Target Position" and b) broadcast a series of changes to "Current Position" until it has reached the desired target position. This is properly reflected in the Home App when viewing the control in its small form (Showing "Opening" or "Closed"). Is there any way to make this process visible in the Home App when the the control is opened in full screen as well? As far as I could see it will jump right to the "Target Position" in the slider and not show anything regarding the updates to "Current Position" - even when opening the "Details" dialog.2. If I change the accessory by using directional controls, the accessory will a) broadcast the change to "Position State" and b) broadcast a series of changes to "Current Position" until it is stopped again. It will NOT broadcast a change to "Target Position", since it is not known when just using directional interaction. This leads to a problem in the Home App. Since the App does NOT check the "Position State", but calculates the value by itself, it ends up with inverted directions when "Current Position" starts changing without changes to "Target Position".Example: Blind is fully closed ("Current Position" and "Target Position" both being 0). Now the accessory is changed by using directional controls to open. This leads i.e. to "Current Position" to change to 5. Now the Home App does it's math (now "Current Position" > "Target Position") and displays "Closing", which is wrong.Is there a way to get the Home App to properly display the direction by examining the "PositionState" characteristic?Please let me know, if you need any additional information - I'll be happy to provide it.Thanks in advance,Kind regards,Michael.
Posted
by
Post not yet marked as solved
4 Replies
2.5k Views
I have an electric "garage door", but it's not an "overhead" door that opens upwards, as seems to be common in the US. This is a motorized sliding gate. It can be told to open fully for a car to cross, or stopped anywhere in the middle, for example for a person to go out.I want to make a HomeKit bridge for it, and looking at the non-commercial HAP spec, I'm struggling to see how it fits into the predefined HomeKit services.The "Garage Door Opener" service has a "Current door state" characteristic, which can report the door is open, closed, opening, closing, or stopped while not fully open or closed. This seems great for my use case. However, the "Target door state" characteristic can only be used to "open" or "close". This is more problematic; I don't see a way to tell it to stop it while it's moving, before it reached the end state.In the "Door" service, there is a "Hold Position" optional characteristic, which "causes the service such as door or window covering to stop at its current position". That, too, sounds great for me. However, the Door service has required "Current Position" and "Target Position" characteristics, but I can't know what's the exact position of the gate, and I can't tell the gate to move from its current position to another exact one, I can only tell it to "open" or "close". So it seems the "Door" service is unsuitable for this kind of electric gate.What's the appropriate configuration for this? Can I use the Hold Position characteristic in the Garage Door Opener service? Does the Home app support it? Or should I use the Door service?
Posted
by
Post not yet marked as solved
6 Replies
2.2k Views
Hello,I have a class CLightBulb and it is defined as a accessory delegate:class CLightBulb: NSObject, HMAccessoryDelegateIn the “init?()” I set self as the delegate:m_lightBulb.delegate = selfAnd I override the “didUpdateValueFor” method as follows, but it is never invoked when I turn a lightbulb on or off from the Homekit app on another device (other than the one I am testing on) //_______________________________ // AccessoryDelegate: Update Characteristic Value // // //_____ func accessory(_ accessory: HMAccessory, service: HMService, didUpdateValueFor characteristic: HMCharacteristic) { var results: CResults print("******------> CLightBulb AccessoryDelegate: Update Characteristic View") results = CResults() if ((accessory == m_lightBulb) && (service == m_lightBulbService)) { switch characteristic.characteristicType { case HMCharacteristicTypePowerState: results = GetThePowerStateFromTheLightBulb(workComplete: { () in let delegate = self.m_delegate if (results.GetResultCode() != CResults.code.success) { // NOTE: The attribute value is incorrect for Philips HUE bulbs so we have to check the error description // to see if the reason for the error is that its unreachable. It's not really an error if its unreachable if (self.m_isReachable == false) { delegate?.lightBulbReachablilityChanged!(device: self, newState: self.m_isReachable) } else { delegate?.lightBulbEncounteredError(device: self, opResults: results) } } else { delegate?.lightBulbPowerStateChanged!(device: self, newState: self.m_powerState) } }) default: print("CLightBulb: Encountered unexpected service type in accessory characteristic update.") } } }But when I test my app on my phone, it doesn’t get called when I, say, turn the light bulb off from the Homekit app on my iPad. Do you know what I’m missing?
Posted
by
Post not yet marked as solved
2 Replies
856 Views
I am implementing a garage door opener. Apple documentation defines 5 states: open, closed, opening, closing and stopped.Like with many garage doors, if I click the RF remote while the door is moving, it stops.However, I am so far unable to use the 'stopped' status; there is no change in the Home app icon indicating this status.Any suggestions or is this intended behaviour?Regards, André Hartman, Belgium
Posted
by
Post not yet marked as solved
3 Replies
3.3k Views
Hi,I want to make a HomeKit device for controlling my driveway gates. For this project I want to use the ESP32 and a RFM69HW 868Mhz transceiver. The Idea is to:Open and close gates from my phone using HomeKitGet the temperature from the ESP32Receive data from the remote control so that I can track the state of the gate (are they open or closed)Get it to work over WiFiProgram the ESP32 based on the gate remote signalStuff I ordered (It'll probably take like 32-60 days before I get it):ESP32RDM69HW (chosen this one due to my remotes frequency being 868Mhz)My problem is that I'm a total beginner and don't know where to start in terms of coding. How do I start? How to read the HAP specification? How to implement it in ESP32? Any other suggestions? Thanks for any help in this field.Link to reddit: https://www.reddit.com/r/esp32/comments/e1gy1o/esp32_homekit_remote_gate_control_project/?utm_source=share&utm_medium=web2x
Posted
by
Post not yet marked as solved
9 Replies
7.7k Views
I would love to see more integration between HomeKit and Siri Shortcuts - a common request I get for my app, Home Flash for HomeKit, is to flash a light when motion is detected, or a button is pressed, but it's not possible today. I could envision this being implemented in one of two ways: Allow a scene to execute a Siri Intent, so an 'Intruder' scene could turn on my porch light, and trigger a Siri Intent either on my phone or Apple TV to flash my bedroom or office light. This is my preferred way, since as a 3rd party developer, I have the ability to create Scene's for my users. Add more flexibility to HomeKit Automations that are Converted to Shortcuts, so that I could direct my users in how to do this
Posted
by
Post not yet marked as solved
3 Replies
770 Views
How can I create a HomeKit action set owned by a trigger, so that it does not appear in the "favorites" section in the Home app? The action set type HMActionSetTypeTriggerOwned - https://developer.apple.com/documentation/homekit/hmactionsettypetriggerowned is the one that is needed for that, but there seems to be no API to create an action set with the type HMActionSetTypeTriggerOwned. The Home app by Apple is clearly able to create those trigger owned action sets. How can a I do the same?
Posted
by
Post marked as solved
9 Replies
3.0k Views
I'm attempting to send an HTTP request when a motion sensor detects movement. I've setup the trigger in the Home app, and chose "Convert to Shortcut", now I'm trying to get the "Get contents of URL" shortcut action to work. I'm running the target web server (a little Node.js app) on my local network. I originally tried to use a simple http server, but was getting the error: An SSL error has occurred and a secure connection to the server cannot be made. Assuming that HomeKit was converting my http URL to https automatically I moved my service to a domain where I have LetsEncrypt setup, added support for simple token based auth via headers, and tried again. This time I got the error: A server with the specified hostname could not be found I triple checked my spelling, verified that the request worked from my Mac and iOS Safari, then concluded that the HomePod (my current home hub) doesn't do domain name resolution like I expect and I need to use an IP address instead. Since I can't get a LetsEncrypt cert for a local IP address I generated a self-signed certificate with the instructions outlined here: https://stackoverflow.com/a/24749608 I additionally installed the root CA on all my HomePods and my phone using a "DER format crt" also described in that post. Now I'm getting another error: The certificate for this server is invalid. You might be connecting to a server that is pretending to be "192.168.7.77" which could put your confidential information at risk. Installing root certs into my HomePods feels a little reckless, so I'm going to go reset them to factory settings and hope that someone here has some guidance as to what I need to do to make my service eligible for the "Get Contents of URL" shortcut. Thank you! A note for anyone trying to reproduce this: the errors I'm quoting are shown when you click the play button at the bottom of the shortcut editing/creation screen ("Home" app > "Automations" tab > "+" button > setup any trigger > "Convert To Shortcut" at the bottom of the action selector > "▶️" button). Clicking "Test automation" after creating the automation, or using the actual Shortcuts app will give misleading results.
Posted
by
Post not yet marked as solved
3 Replies
617 Views
hi there, i've just started digging into developing for HomeKit, so it's quite possible i'm missing something (or this is expected?), but calling addAndSetupAccessories always fails instantly (no UI appears) when running in the simulator. the error is: addAndSetupAccessories got error Optional(Error Domain=HMErrorDomain Code=79 "Failed to add the accessory." UserInfo={NSLocalizedDescription=Failed to add the accessory.}) i'm running the HomeKit simulator with a home created + one standard lightbulb accessory added. if i run on device it works as expected (using my real homekit accessories) xcode: Version 12.0 beta 4 (12A8179i) homekit accessory simulator: Version 4.0 (135.3)
Posted
by
Post not yet marked as solved
9 Replies
1.6k Views
Hello everybody, since iOS 14.0 the Home App on the iPhone XR is freezing when I edit a scene. So the App does not save my changes. Also the problem appears with iOS 14.2. Does anyone also have the problem?
Posted
by
Post not yet marked as solved
3 Replies
1.1k Views
Hey folks, I am unable to get HomeKit to work on any of my devices - when I start the Home app (on any platform), I see "Loading Accessories and Scenes" and then nothing happens. This screen never goes away. Google tells me this is not uncommon and I have a couple of options: Sign out of iCloud on all devices then sign back in, reboot etc. Try enabling/disabling iCloud Keychain a couple of times. Simply wait 20-30 mins and a "reset" option should appear I have tried all of these (literally waiting hours for the last option) with no luck. Further googling tells me that I likely have a corrupt iCloud HomeKit database and I need to either : a) get Apple to reset my Account or b) Apple can send me a custom configuration profile that will enable the reset button in the Home app. Can anyone from Apple help me here - or direct me to the appropriate support channel? Cheers, D.
Posted
by
Post not yet marked as solved
1 Replies
602 Views
If I say "Hey Siri, turn down the temperature" Siri will switch the thermostat from Heat Only to Auto and try to cool the house to the new temperature. It's currently -17 outside so I don't want it to do this, just lower the thermostat setting, nothing else. There must be a way to prevent Homekit from arbitrarily changing the thermostat's mode, especially without confirming it somehow.
Posted
by
Post not yet marked as solved
2 Replies
986 Views
Hi colleagues, I am developing a water level sensor, which is quite simple and already working. The problem arises when I try to connect it to the Homekit. I attempted to find an appropriate service/characteristic to report the water level to the homekit and cannot find any yet. Found this https://developer.apple.com/documentation/homekit/hmcharacteristictypewaterlevel but as I see from the examples and description, it works with humidity services only. The question is, what is appropriate way to integrate water tank level sensor to the homekit? Which service/characteristic shall I use? This is my first experience with homekit, so any advices are greatly appreciated. Thank you!
Posted
by
Post not yet marked as solved
2 Replies
582 Views
The problem keeps on manifesting randomly. Every kind of Automation/ actions I set up keeps on failing at random intervals, could be 3 times a day like 1 per month. The problem is evident in Homekit settings that depends heavily on automations and actions to work, like when a Stateless Programmable Switch is used to control smart lights. I've already tried different methods ( logout/login from icloud, reinstall everithing ecc) but the problem keeps on manifesting randomly. When the automation/ action doesn't fire I can check on Home app that the message is processed by homekit but the domestic hub seems not able to run the connected action/automation, and i can control manually every device in the automation to verify that is connected. after 5 to 10 minutes everything starts acting normal again. The problem is present not only with an ATV running the latest firmware but also using an iPad. Is this a well know bug or there's some workaround?
Posted
by
Post not yet marked as solved
10 Replies
8.3k Views
Our HomePod minis are stuck downloading 14.5 yet the software version number shows 14.5. Any suggestions how to stop the download / update
Posted
by
Post not yet marked as solved
1 Replies
936 Views
Hi, We were trying to setup communication with the apple MFi server, according to "Software Token Authentication Server Specification R2. pdf ", we completed the certificate request, and then did the following things in order(Tested http request with Postman): downloaded .pem file from MFi Dashboard In Postman settings, added the .pem file as CA certificate and added .pfx file (which is an non-EV SSL certificate we alyeady have) as client certificate. correctly entered the request URL , header and body and then pressed the "send” button got the error returned by Apple Server: "title401 Authorization Required title" we have tried many times, but always got this error, our status of Product Plan now is "testing" . Can our Licensee server use an ordinary SSL certificate(instead of DigiCert EV SSL certificate)during testing period? And what caused the above error ?thanks in advance.
Posted
by