Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action proposal: HomeKit Actions #66

Closed
bradennapier opened this issue Oct 8, 2022 · 12 comments
Closed

Action proposal: HomeKit Actions #66

bradennapier opened this issue Oct 8, 2022 · 12 comments

Comments

@bradennapier
Copy link

bradennapier commented Oct 8, 2022

Description

I am an engineer and honestly was going to add this myself for my own use… but it probably makes more sense to just make it public for everyone since it will be very useful.

Currently the capabilities for HomeKit are sorely lacking. However, HomeKits potential is next level exciting. I have installed and programmed many hundred thousand + dollar home automation systems from Crestron to Control4 to URC and HomeKit can accomplish much of what they can with some extra tools.

  1. It’s impossible to query rooms, zones, scenes, devices, etc to use in shortcuts
  2. No ability to control groups of values or query using parameters and execute actions on the resulting items
  3. HomeBot does much of this but it is much out dated and can’t do much past lights and room queries

I would propose providing an updated method of doing this similar to HomeBot get items and set items.

For example:

Say I want a shortcut that can allow me to quickly set my home devices and such.

EB4D3859-08EA-4ACC-A96C-C9FDD6EEB3ED

it’s going to display a menu

59B45A4B-B126-4677-8E2B-BC067E2A2627

now when I select “televisions” - say I want a menu drop-down to do the following:

  1. Allow me to select from menu to turn on or off any televisions in my home
  2. If the tv is currently on - menu item will says “____ Television Off” and selecting it will turn it off and opposite if tv was off.

We would need to be able to query for all television types and each item would hold data such as current state, input, etc.

I could then create menu items and use that information to populate the menus as needed.

Additionally — the goal would be that we could then easily let user select from the menu which televisions were selected and with single item control those devices.

—-

Other queries that should be possible:

  1. Get all devices of given type that are in a given state
  2. Get all devices in a room
  3. Get all devices with a specific characteristic
  4. Get zones / rooms
  5. Get rooms in zone
  6. Set all devices which match a filter and have a specific characteristic - set characteristic value or device state

—-

Most of these things should be possible in a couple actions, but I would imagine more could be considered.

@bradennapier
Copy link
Author

It’s possible HomeKit could be such a broad api that it does warrant its own app with many different shortcut options.

As for the Mac OS not having HomeKit that surprises me since there’s so many HomeKit apps for things like menu toolbar?

@jsiegenthaler
Copy link

jsiegenthaler commented Oct 8, 2022 via email

@bradennapier
Copy link
Author

? I am not sure what you are trying to say?

Of course I can open home app and control tvs manually. That's not the point at all.

This is for writing more powerful shortcuts that are definitely not possible at the moment -- I mean you could manually list tvs and control them but this is about using logic to automate so adding a new tv for example would automatically be represented without changes.

@jsiegenthaler
Copy link

jsiegenthaler commented Oct 8, 2022 via email

@bradennapier
Copy link
Author

No it's not possible with hue either I'm not sure you're understanding g at all what is trying to be done?

@jsiegenthaler
Copy link

jsiegenthaler commented Oct 8, 2022 via email

@bradennapier
Copy link
Author

bradennapier commented Oct 8, 2022

Of course - but those apis are not available to shortcuts without a ton of custom work that isn't easy to maintain

@jsiegenthaler
Copy link

jsiegenthaler commented Oct 8, 2022 via email

@sindresorhus
Copy link
Owner

It’s possible HomeKit could be such a broad api that it does warrant its own app with many different shortcut options.

Because of the limitation of not being able to support macOS HomeKit actions in this app, it's starting to sound like a separate app would be a better solution.

@bradennapier
Copy link
Author

bradennapier commented Oct 19, 2022

Coming along nicely! Will ofc credit and link your way when it makes it to a release!

Will obvi change the icon and such.

Going to need to re implement a bunch of actions so that they can take in home entities and return them for operations like filtering and such since the entities are highly nested to allow users to filter down to only what they want to control or see. :)

image

image

image

image

image

@galdo320
Copy link

galdo320 commented Nov 1, 2022

Description

I am an engineer and honestly was going to add this myself for my own use… but it probably makes more sense to just make it public for everyone since it will be very useful.

Currently the capabilities for HomeKit are sorely lacking. However, HomeKits potential is next level exciting. I have installed and programmed many hundred thousand + dollar home automation systems from Crestron to Control4 to URC and HomeKit can accomplish much of what they can with some extra tools.

  1. It’s impossible to query rooms, zones, scenes, devices, etc to use in shortcuts
  2. No ability to control groups of values or query using parameters and execute actions on the resulting items
  3. HomeBot does much of this but it is much out dated and can’t do much past lights and room queries

I would propose providing an updated method of doing this similar to HomeBot get items and set items.

For example:

Say I want a shortcut that can allow me to quickly set my home devices and such.

EB4D3859-08EA-4ACC-A96C-C9FDD6EEB3ED

it’s going to display a menu

59B45A4B-B126-4677-8E2B-BC067E2A2627

now when I select “televisions” - say I want a menu drop-down to do the following:

  1. Allow me to select from menu to turn on or off any televisions in my home
  2. If the tv is currently on - menu item will says “____ Television Off” and selecting it will turn it off and opposite if tv was off.

We would need to be able to query for all television types and each item would hold data such as current state, input, etc.

I could then create menu items and use that information to populate the menus as needed.

Additionally — the goal would be that we could then easily let user select from the menu which televisions were selected and with single item control those devices.

—-

Other queries that should be possible:

  1. Get all devices of given type that are in a given state
  2. Get all devices in a room
  3. Get all devices with a specific characteristic
  4. Get zones / rooms
  5. Get rooms in zone
  6. Set all devices which match a filter and have a specific characteristic - set characteristic value or device state

—-

Most of these things should be possible in a couple actions, but I would imagine more could be considered.

Do you know if there’s a way to verify is a device is not responding and to trigger another device?

@bradennapier
Copy link
Author

bradennapier commented Nov 3, 2022

Yes you can check accessory.isReachable and accessory.isBlocked to understand if an accessory is blocked and forward if needed.

I'm not sure what your specific need would be but that would only happen within your own HomeKit app logic and not the home app itself.

If you wanted to implement a proxy-style handler that is automated and works with all HomeKit apps you would need homebridge or similar.

As it happens my HomeKit version of actions will have a RPC implementation to my homebridge plugin that would allow things like that fairly easily-- but ofc relying on the homebridge in the middle is an extra moving part that needs to exist always.

I personally run multiple homebridge servers... one for resource intensive instsnces using a micro pc I bought and one using raspberry pi for simple automation style implementations.

This gives you complete freedom on unprecedented level... for example

image

Here i have a custom switch which I can program automations for when flipped ... if I set the timeout duration, when I turn it on it will begin a countdown seen in the UX that I can interrupt (reset to the timeout seconds again) with the "STOP" button, or even change the timeout as it's running and it will adjust dynamically

If I set that timeout to 0 it will change to just being a normal switch.

We can create these switches, sensors, etc from shortcuts or from the homebridge config as-needed.

The possibilities are literally endless as this is actually implanting the HAP protocol same as a bridge like say Hue or Eve accessories would implement.

In Homecuts app I am working on you can set all characteristics from shortcuts and control the states - so you can fully control this.

In addition, not requiring homebridge at all, in the already implemented features of the Homecuts I am actually returning whether or not a given accessory is responding and you can filter on that.

image

Here if you don't do a query that filters out "isAvailable" (which is just "accessory.isReachable && !accessory.isBlocked" you will get accessories that are not responding which will also be indicated in the item.

You could then custom report on those values using the entity results from the "Find Home Lighting" query:

image

I used to work for a high end home automation manufacturer and I haven't found anything I can't implement in HomeKit that I used teach (I was a teacher for the most advanced home automation features for the platform(. thus far.

My HomeKit setup I would have charged $100-150k for only a few years ago and I spent about $3,500 so far...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants