AndroidのAutomateItで自動で省電力設定etc.

Androidアプリ AutomateItは、電源や無線LANの接続/切断や位置を移動したなど、様々な条件を満たした時に指定したときに指定したアクション(マナーモードにするとかWi-Fiをon/offするとか)を実行できる自動化アプリです。しかも無料。複雑な条件が指定できる有料のPro版もあります。


無料板の方でも、がんばって複雑な条件指定をすれば、それなりに高度な自動オペレーションが可能です。
というわけで自分で普段使ってる設定のメモ。省電力のためにマメにWi-Fi設定などを弄るのが面倒なので、充電などをトリガにほぼ完全に自動化しています。
ちなみに表はCSVエクスポート機能で出力した内容です。全部の設定をimportするためのファイルはこちらに。

充電スタンドに立てた際にマナーモード解除/外すと自動でマナーモードに

まずはシンプルなところから。

ルール名 Trigger(条件) Action(実行内容)
マナー解除 [Power Connected Trigger]: External power is connected to the device [Set Sound Mode Action]: Set device' sound mode to Normal (No vibrate)
マナー設定 [Power Disconnected Trigger]: External power is disconnected from device [Set Sound Mode Action]: Set device' sound mode to Vibrate

電源接続中は30分バックライトを消さない/外したら30秒で消灯するように

ルール名 Trigger(条件) Action(実行内容)
スクリーン30分後off [Power Connected Trigger]: External power is connected to the device [Set Screen Timeout Action]: Set screen timeout to 30 minutes
スクリーン30秒後off [Power Disconnected Trigger]: External power is disconnected from device [Set Screen Timeout Action]: Set screen timeout to 30 seconds

ついでに音も鳴らしてみる。

MEDIAS WPですが、スタンドの接触が甘いらしく、立てたつもりがまれに充電されていなかったり、ふいに外れたりするので音を鳴らして確認。

ルール名 Trigger(条件) Action(実行内容)
電源接続音 [Power Connected Trigger]: External power is connected to the device [Play Sound Action]: Play a sound (Missed It)
電源解除音 [Power Disconnected Trigger]: External power is disconnected from device [Play Sound Action]: Play a sound (Highwire)

Wi-Fi on/offを自動化

複雑な設定の例。家ではWi-Fiを使いたいけど、外に出る時は省電力のためにWi-Fiはoffにしておきたい。けどスタンドから外したら勝手にoffにされると不便だし、GPSを使った位置条件指定も可能ですがそれ自体が電池を食いそう。
というわけで、電源を接続→Wi-Fi on / 電源切断かつWi-Fiアクセスポイント(AP)非接続はWi-Fiをoff、という設定に。
これで家で充電開始した時に勝手にAPにつながり、家を出てAP圏外に出れば勝手にWi-Fiがoffになってくれます。
電源切断/Wi-Fi切断の順序を任意にするために、ルールをenable/disableするなどやや複雑な設定になってます。

ルール名 Trigger(条件) Action(実行内容)
Wi-Fi on [Power Connected Trigger]: External power is connected to the device [Set Wifi State Action]: Set Wi-Fi adapter status to Wi-Fi Enabled
Wi-Fi off<電源切断> [Power Disconnected Trigger]: External power is disconnected from device [Set Wifi State Action]: Set Wi-Fi adapter status to Wi-Fi Disabled
Wi-Fi off [Wifi Network Connection State Trigger]: Network [] is Disconnected [Set Wifi State Action]: Set Wi-Fi adapter status to Wi-Fi Disabled
電源接続→AP切断時Wi-Fi off無効 [Power Connected Trigger]: External power is connected to the device [Enable/Disable Rule Action]: Disable rule (Wi-Fi Off)
電源切断→AP切断時Wi-Fi off有効 [Power Disconnected Trigger]: External power is disconnected from device [Enable/Disable Rule Action]: Enable rule (Wi-Fi Off)
AP接続→電源切断時Wi-Fi off無効 [Wifi Network Connection State Trigger]: Network [] is Connected [Enable/Disable Rule Action]: Disable rule (Wi-Fi off<電源切断>)
AP切断→電源切断時Wi-Fi off有効 [Wifi Network Connection State Trigger]: Network [] is Disconnected [Enable/Disable Rule Action]: Enable rule (Wi-Fi off<電源切断>)

Wi-Fi on/off設定にBluetoothも連動してon/off

これはBluetoothイヤホンをたまに使う時があるので、Bluetooth offにしわすれないよう何となく。

ルール名 Trigger(条件) Action(実行内容)
Bluetooth on [Wifi State Trigger]: Wifi adapter status set to Wi-Fi Enabling [Set Bluetooth State Action]: Set Bluetooth adapter status to Bluetooth ON
Bluetooth off [Wifi State Trigger]: Wifi adapter status set to Wi-Fi Disabling [Set Bluetooth State Action]: Set Bluetooth adapter status to Bluetooth OFF