com.swttt.homekit icon indicating copy to clipboard operation
com.swttt.homekit copied to clipboard

Support Garage Door class

Open fishfisher opened this issue 4 years ago • 24 comments

Hi!

Now that athom has added support for the garage door class (Homey v6.0.0), would it be possible to add that to the list of virtual devices?

I could try to make a pull request if you want.

fishfisher avatar Jun 05 '21 10:06 fishfisher

Feel free to submit a PR :)

robertklep avatar Jun 07 '21 12:06 robertklep

Hi, Looking for this as well! Appears that Carplay will show you a shortcut for your garage door once you get close to home and I would really like to give it a try. Unfortunately, the class still doesn't seem to be supported though.. 😔

MrBlue90 avatar Nov 13 '22 22:11 MrBlue90

@MrBlue90 I've added support for the garagedoor class in the current test version of the app: https://homey.app/a/com.swttt.homekit/test/

I can't test this myself because the Virtual Devices app doesn't support this device class, so please let me know if it works or not.

robertklep avatar Nov 14 '22 11:11 robertklep

Awesome! The first test seems to be succesful! I created a virtual garage door with the Device Capabilities app. Still needs some tinkering, but at least it showed up on my Carplay dashboard. I'll let you know once I managed to get it to work completely!

MrBlue90 avatar Nov 14 '22 18:11 MrBlue90

@MrBlue90 I looked at the Device Capabilities app but I couldn't find how to add a capability (garagedoor_closed) to a device. How did you manage that?

robertklep avatar Nov 14 '22 18:11 robertklep

This is what I have now: image image

However, once I open/close the virtual garage door, I get the following error in Apple Home: image

I need to find a way to prevent this variable being set, maybe with a status?? https://developer.apple.com/documentation/homekit/hmcharacteristictypeobstructiondetected?language=swift

MrBlue90 avatar Nov 14 '22 18:11 MrBlue90

@MrBlue90 no, I just made a mistake 😅

Homey doesn't have a capability that correlates with the "obstruction detected" characteristic, so it should always return "false", but I mistakenly used the "is the door closed" capability instead. Will fix ASAP (and will try with the Device Capabilities app to create a similar virtual device so I can test it myself a bit better, too).

robertklep avatar Nov 15 '22 05:11 robertklep

@MrBlue90 try the latest test version, it should be fixed now.

robertklep avatar Nov 15 '22 06:11 robertklep

That worked! The virtual garage door is now opening/closing without the obstruction warning. Would you see a way where this functionality could actually be used? Maybe by checking a status or being set by a flow?

MrBlue90 avatar Nov 15 '22 07:11 MrBlue90

It can only work with a capability that would reflect the "obstructed" status, and because Homey doesn't have such a capability, it would need to be a custom capability too, which HomeyKit cannot handle.

So in short: it's not possible to use it 😕

robertklep avatar Nov 15 '22 07:11 robertklep

Hmm.. Maybe your original line of thought wasn't so bad after all then. If your code would check for a specific type of status (sensor/contact alarm) for the obstruction, it's a capability that can be added easily with Device Capabilities. Thoughts?

MrBlue90 avatar Nov 15 '22 07:11 MrBlue90

I could possibly add support for the alarm_generic capability, since that's actually the best matching one in the list of supported capabilities.

robertklep avatar Nov 15 '22 07:11 robertklep

Support for alarm_generic added in current test version.

robertklep avatar Nov 15 '22 07:11 robertklep

Thanks! I'll test over the next days!

MrBlue90 avatar Nov 15 '22 13:11 MrBlue90

Hi Robert, Quick update. I added the generic alarm capability to my virtual garage door, but because of that, the Homeykit app doesn't seem to recognize the device anymore. Any chance this is a unsupported combination in your code? Thanks! 5ABC0607-5ED0-48F5-A2B5-D8AD2C010111 3A91E7FD-6FEC-4CD4-8B88-3DA3E8F379AC 4AE428A3-6085-47FB-9249-FAC946277686

MrBlue90 avatar Nov 16 '22 11:11 MrBlue90

@MrBlue90 that looks very similar to what I've been testing with, and for me it's working fine.

Can you find the device on this page: https://tools.developer.homey.app/tools/devices

And then make a screenshot of the list of capabilities for the device. For me, they look like this: image

(the "button" and "text" capabilities aren't relevant)

robertklep avatar Nov 16 '22 12:11 robertklep

This was my original device: image

Not sure where that measure status capability is coming from, so just in case, I created a new one: image

Both don't show up in Homeykit.

MrBlue90 avatar Nov 16 '22 12:11 MrBlue90

That should work, not sure why it doesn't.

It's strange though that the Device Capabilities app adds a "sub capability" to mine (the .button1 and .boolean1 suffixes) and it doesn't for you.

robertklep avatar Nov 16 '22 12:11 robertklep

I agree! Could you make some screenshots of the device settings? Maybe I'm able to locate a difference.

PS: For what it's worth, I'm using Device Capabilities v2.8.10

MrBlue90 avatar Nov 16 '22 13:11 MrBlue90

I'm using the same version, let me check if I can create the same device as you.

robertklep avatar Nov 16 '22 13:11 robertklep

No, same subcapabilities: image

These are the device settings I use: image

image

It's appearing on iOS just fine: image

robertklep avatar Nov 16 '22 13:11 robertklep

So this is getting weird (and a bit frustrating..) I tried all different combinations and even reinstalled both applications, but for some reason, none of the garage door devices will show up in Homeykit. I even managed to get the exact same device as you: image

Help? 😅

MrBlue90 avatar Nov 18 '22 12:11 MrBlue90

Are you sure you're using the test version of the app?

robertklep avatar Nov 18 '22 12:11 robertklep

Okay, this is pretty awkward.. It seemed to reverted back to the production version instead. Please ignore my stupidity. I'll continue some testing for the next days.

MrBlue90 avatar Nov 18 '22 12:11 MrBlue90