Control Homekit devices from scripts #156
rob0101
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Attached is a screenshot of an Apple shortcut I use to control a smartplug that's part of an Apple Homekit system.
From a script I can get the status of the device or turn it on or off..
echo "status" | shortcuts run "control pool pump" | cat
echo "on" | shortcuts run "control pool pump" | cat
echo "off" | shortcuts run "control pool pump" | cat
The first time it is run you're asked to allow shortcuts to perform certain actions, but from then on it doesn't require interaction.
For reasons I've yet to find (might be the beta OS I'm running), the shortcuts command sometimes returns Yes/No and at others 1/0 for the on off state.
Beta Was this translation helpful? Give feedback.
All reactions