iPhone iOS charging trigger

So I know some people use Tasker on Android to have ā€œwhen the phone is chargingā€ as a trigger. iOS does not have tasker, but in Shortcuts ā€œis chargingā€ can be a trigger for an automation.

But Iā€™m not sure if thereā€™s a way to get the trigger out to Hubitat. I searched for a way to turn on a virtual switch via Alexa or the Hubitat app but there donā€™t appear to be any hooks into those systems to get the trigger out of Shortcuts and then into RM.

Anyone have any creative ideas?

You can have the shortcut make a Hubitat Maker API http call to update a virtual device.

Another option is to use HomeBridge to integrate Hubitat devices into HomeKit. This does require a Raspberry Pi or a similar always on device to run HomeBridge.

2 Likes

Thanks. How does the first option work?

You can set a shortcut to run a URL in a browser, so use that to run a HE rule. Set an endpoint trigger on the rule you want it to run and them have your IOS shortcut execute that URL.

4 Likes

The first option would require the following steps:

  1. Create a Virtual Switch on your Hubitat hub
  2. Add an instance of the built-in Hubitat Maker API app, and add the Virtual Switch you created in step one as a valid device
  3. Take note of the URL in the Maker API app that you can use to change the status of the virtual switch to 'on' and 'off'
  4. Use the URLs from step 3 in your iOS Shortcuts

I also like @terminal3's idea to simply create a RM Rule that can be triggered by a URL. This might be simpler than using the Maker API method above.

1 Like

You may find this older post useful. iOS Widgets - How To Guide for anyone, especially Wink refugees
although I wouldn't use IFTTT as it was free when this was posted.

3 Likes