[ALPHA] Mobile Controller - Get Your Mobile Device Status and Control Them

Mobile Controller (MC) brings your Android device into your home automation setup, allowing you to

  • Control the mobile device from your HE automations, including screen brightness, volume and media control
  • Send interactive notifications to the mobile device from your HE hub
  • Capture status information such as battery level and Wi-Fi connectivity
  • Detect events for triggering automations on your HE hub

Communication can be entirely local, with optional cloud communications for reporting status updates and events back to the HE hub.

Use MC to send notifications locally, dismiss upcoming alarms, adjust volume and brightness settings, detect Wi-Fi connectivity, report battery level, detect incoming calls and more. Below is a more comprehensive list of the MC features, followed by some example use cases.

Features

Mobile Controls

:bell: Notifications

  • Send Notifications
  • Cancel Notifications
  • Adjust Notification Setting - Mute, Vibrate, Sound

:speaker: Volume Adjustments

  • Media Mute / Unmute
  • Set Media Volume
  • Media Volume Up/Down
  • Set Ring Volume

:no_bell: Turn Do Not Disturb On/Off

:alarm_clock: Alarms

  • Dismiss Alarms

:high_brightness: Screen

  • Turn the screen On/Off
  • Set Screen Brightness

:musical_note: Media Control

  • Play / Pause / Stop
  • Next / Previous Track

Mobile Status Information and Events

:signal_strength: Wi-Fi Network Tracking

  • Track status of connection to two sets of Wi-Fi Networks, Home and an Alternate list

:telephone_receiver: Call Status Tracking and Events (Coming Soon...)

  • Track status of calls that are in progress
  • Track Status of missed calls
  • Events for Incoming Calls

:stethoscope: General Device Status Information

  • :low_battery: Battery Percentage and Status (Charging, Discharging, Idle)
  • :bell: Local alerts for low or high battery levels
  • :heart: Device Heartbeat

:repeat: Synchronising With Hubitat

  • Hubitat Mode - Synchronise the Hubitat Mode into a Tasker Variable on the mobile device

:gear: Setup Options:

  • Use Direct HTTP calls to Tasker or use AutoRemote commands
  • Local and/or Cloud Communication
    • Local communication is the default, but cloud communication can be used for reporting mobile status information

Here are some example use cases for how to get the most out of the features of Mobile Controller:

Notifications - TBA
Volumn Adjustments, Do Not Disturb and Notification Settings - TBA
Alarms - TBA
Screen Brightness - TBA
Media Control - TBA
Wi-Fi Connectivity - TBA
Call Status - TBA
Battery Levels - TBA
Hubitat Modes - TBA

Requirements

  • MC is designed for Android devices only
  • If using Hubitat Package Manager (HPM) to perform installation of the HE driver and App code, it is recommended to run the latest version of HPM, with a minimum version of 1.9.1
  • Tasker must be installed on the mobile device
    • For direct (HTTP) communication with Tasker, the beta version 6.2.12-rc of Tasker is required
    • If the public version of Tasker is installed, the AutoRemote App needs to be installed and configured for communicating with the mobile device
    • Note, some Tasker features used by MC require elevated permissions to be granted for the Tasker app on the mobile device. When attempting to use these features a notification will appear on the device prompting for these permissions to be assigned

Early Background Discussion About The Project

Mobile Controller GitHub Repository

7 Likes

Installation and Setup

Hubitat - Download App, Driver and Tasker Project

It is highly recommended to use Hubitat Package Manager (HPM) to manage the installation of this utility on your HE hub. If you would prefer to install manually, please contact me and I can guide you through the process.

  • Open the Administration web interface for your HE hub, accessing the Apps page
  • Open HPM and chose Install, using keyword search, entering "Mobile Controller"
  • Choose the Mobile Controller Package and install it. This will:
    • Install a Mobile Controller Bundle, shown in the Bundles section under Developer tools
    • Install the Mobile Device Driver, shown in the Drivers Code section under Developer tools
    • Install the Mobile Controller App Code, shown in the Apps Code section under Developer tools
    • Download the Mobile Controller Tasker project(s) to the local file storage on the HE hub, accessible from the File Manager under Settings
Mobile Device - Tasker

See the notes under the Requirements for Mobile Controller regarding the version of Tasker being used and use of AutoRemote

  • Install and configure Tasker and optionally AutoRemote on the mobile device, use of AutoApps to install AutoRemote is also supported
  • Import the Mobile Controller Tasker Project into Tasker, located in File Manager on the HE hub
Hubitat - Mobile Controller App and Device Setup
  • On the HE Apps page choose Install User App and select Mobile Controller

  • Select the Configure New Mobile Device option

    • Give the new device a name and enter the IP address of the mobile device
    • Click Next to create the HE virtual device
  • On the Mobile Controller main page, expand the Existing Mobile Devices section and click on the new device to open the Device Details page

Releases

09-Jan-2024 - Added Do Not Disturb commands to Mobile Device driver
08-Jan-2024 - Improvements to device setup process and code tidy-up, media controls (Play, Pause, Next/Prev Track, etc), notification setting (Vibrate, Sound, Mute)
23-Dec-2023 - Initial ALPHA release

ALPHA RELEASE

If I didn't release it soon, I'd never do it.... :slight_smile: It's by no means ready, but for those that are keen, and happy to take the plunge with low expectations and limited instruction, come aboard :grin:

NOTE - The assumption is that you have Tasker installed and functioning. There are two methods for the MC App on your HE hub to communicate with your mobile device, using the AutoRemote plugin using a local HTTP request, or the new Tasker (beta) built-in HTTP Request feature, requiring you to be on the Tasker beta program and running the beta version that includes this feature.

Check the IP Address of your mobile device - probably a good point to locate the IP Address of the mobile / tablet you are wanting to integrate. Get this on the device via the network settings screens, or via your router configuration.

Mobile Controller (MC) is available in HPM. Installing MC should download the App / driver bundle and two Tasker project files to the local HE storage, one for the AutoRemote plugin another for the AutoRemoteLite version (see below).

Import Tasker Profile - Get the necessary Tasker profile from your HE hub onto your phone. It may be useful to add it into your Google Drive if you are using G Drive, to make it easier to transfer. Use the import option in Tasker to import the project on your mobile device.

Install the Mobile Controller App on HE - Once installed, setup a new mobile device (this bit is not working like it should, you may need to do it twice.... I'll fix it eventually). Enter the device details as prompted.

Check out the mobile device for updates and issue commands - Open the Devices page on the HE hub and locate the new mobile device created by the app. You should eventually see battery readings and heartbeat date/time values come through. Adjust the communication method from AutorRemote to HTTP Request in the Preference Settings as needed. You should also be able to send notifications and issue other commands. You can also configure your local Wifi Network(s) and alternate Wifi Network(s) to track those on the device, separated by a "/" (the alternate one isn't finished yet).

Enjoy....!!..

2 Likes

I must be going crazy. Got the project imported into Tasker just fine and used HPM to install the HE MC app, seemingly fine. But I can't add the MC user app. It doesn't appear in my list of Add User App.

I used to know what I'm doing, but I'm a bit rusty. Please tell me what I have missed!

I installed it successfully on my other development hub. I:

  • Opened HPM and chose Install, using keyword search, entering Mobile Controller
  • Chose the Mobile Controller Package and installed it
  • Back on the HE Apps page chose Install User App and chose Mobile Controller

Could it be you needed to refresh your Apps page? I was able to see that behaviour where an Apps page I had open prior to installing the package in HPM would not display Mobile Controller as a User App for install after I had installed the package in HPM, but a freshly opened one (or just the tab I used for the HPM install) would provide MC as an option.

If, when you get back to this, you wouldn't mind re-installing the package and the Tasker project, I have released various changes to the HE App, driver and Tasker project.

Hi, Simon. Thanks for this project and for helping me get it going. It's still very perplexing. I've restarted the hub and refreshed the web page and tried different browsers but the app does not appear in the user app list. Neither do I see the app code or drivers in the code lists.

But HPM thinks it was installed:

And the Tasker xml is in the HE File manager. I believe that is working because it shows in my project list. (To "upgrade" to today's profiles, I deleted the project and re-imported it. Is that the best way?)

So, I'm still be befuddled about how to get the Mobile Controller app to install in HE. Ideas, please?

I'm a bit stumped myself...

Are you running the latest he platform and latest hpm version?

And yes, for now removing and re-importung the tasker project is what I would suggest in your situation. I need to do a little more work on this eventually to make sure it handles future updates to an existing setup.

HE is 2.3.7.145, HPM is 1.8.3

Mobile Controller came up as an update available (which, because of your last post, I expected) so I updated:

That was encouraging, but still no appearance of Mobile Controller in the Add User App or in the Apps Code.

I suppose I can go back to the old fashioned way of cutting and pasting the code.

UPDATE: My bad. I see that HPM was not current. I've updated it to 1.9.1 and repaired Mobile Controller. I think this has met going. But in the morning...

1 Like

Glad you (hopefully) worked it out @CAL.hub . Let me know how it goes and I'll add a note in the requirements for the App if it does require the later version of HPM.

1 Like

I've got basic functionality working over http. It would seem all the profiles and tasks labeled AR do not apply, correct?

I'm trying to send a DO NOT DISTURB but I don't see an HE command. How would I do this?

Thanks again. I'm looking forward to understanding this better.

1 Like

Excellent to hear you got it working.

Yes, if you haven't got AutoRemote installed the AR profiles will display a warning, but it won't affect anything. I realised yesterday that I forgot to include the tasker project in the HPM package that can be used when AutoRemote has been installed using the AutoApps.

And thanks for reminding me about DND, I should be able to put the. command in relatively easily today. I'll let you know when it's released.

1 Like

Out of interest, are you on the beta version of Tasker? I haven't followed up on whether the HTTP Request feature has been formally released yet.

I'm not certain if it's Beta. It shows as Version: 6.2.12-rc and it doesn't say anything about beta. But the Play Store says I am enrolled for Beta.

1 Like

Yep, that's the same as me. I'll eventually follow up to find out when it's likely to get released.

I have now added Do Not Disturb commands to the Mobile Device driver and released this to HPM as version 0.2.1. This should only require an update via HPM, there is no change in the Tasker project.

There is a Do Not Disturb On command and a Do Not Disturb Off command now available on a Mobile Device in HE. The on command takes a "setting" parameter, which needs to be one of "noInt", "priority" or "alarms", relating to what level of interruption is allowed, if any.

For those looking at the tasker project, the off HE command simply sends the equivalent of an "allowAll" setting to the same profile in Tasker. I will look at whether I can make the on command use a list of valid options, rather than free-text.

Note - When running the off command, this still leaves notifications as muted. For now you will need to run the appropriate notification command to set this to either vibrate or a sound, if you want notifications to make a noise. I will look at capturing the notification setting in HE and/or Tasker to allow this to be put back to it's previous setting when turning off Do Not Disturb.

1 Like

After a little experimenting, I have a couple of questions.

Sync HE Mode? Turn on to send HE mode updates to the mobile device

I have this on, in the hope that Tasker can use this to be informed of HE modes. I'd like for a task to be able to query HE for its current mode. Is this possible?

These two tasks seem to have permission issues. Can you give me a point on how to resolve?

Once again, many thanks!

(BTW, I thought it was particularly clever to use the HE File Manager to bundle the Tasker project.)

1 Like

Yes and no... :slight_smile: Well, mostly yes... The HE mode should get send to a project variable in the MC project in Tasker. That's the extent of what happens now... I need to work on how best to make this available for you to use outside of the MC project. The idea I want to look at is the ability to nominate a Tasker variable you want the mode recorded in, to use in your own profiles / tasks, but I need to do more work on this. So still a WIP at this stage...

Hmmm. strange you get permission issues on those, not sure I've seen those before... I'll see what I can work out...

I know the screen on or off tasks and one or two others require permissions to be turned on.... But haven't seen these before.