Send a command to Tasker

Hi, Does anyone know of the best way that using a Notification from Home-Assistant that a command can be sent to an Android Device running Tasker.

I don’t want messages to rely on an external 3rd party service so things like AutoRemote and Join wouldn’t fit the bill.

I did find a MQTT Client for Android that has Tasker, but it needs Android 4.4. The device I am running is 4.2 and I’ve had problems trying to upgrade it in the past.

I also found a UDP Listener for Android that has Tasker, but I’am not sure what to use on Home Assistant other than the Command Line Notifier and write a script.

Any ideas?

Update

I spoke with the creator of the MQTT Client (Tasker Plugin) Android app and he has updated it so that it worsk with Jellybean 4.2.2. Just finished testing and I can now send a MQTT message to my Android tablet and get Tasker to act upon it.
e.g. I can send some text that Tasker then says it with Androids built in TTS

1 Like

I tried the Mqtt client service to switch on/off the webcam with Tasker and cloudmqtt but it worked only when the apps were just started. In standby it did not work properly. I am also interested I’m alternatives! :slight_smile:

I had a similar problem initially when getting the Light Sensor on Android to update a MQTT sensor on Home-Assistant. On Tasker, try setting the ‘Net/Cell Wake Screen’ setting as a work around.

I know this is an old thread but it would be really handy if you could share your configuration for HA, MQTT Client and Tasker I would like to do exactly the same thing.

1 Like

I am using a plugin called AutoRemote to send my alarmclock status and time to Tasker.
In the Plugin I created a new IFTTT device and instead of entering my IFTTT key I just typed hass as my secret key. And named the new device HomeAssistant.

You’ll get an URL that looks like:

https://autoremotejoaomgcd.appspot.com/sendmessage?key=API&sender=hass&message=MESSAGE_HERE

The API is an unique string from AutoRemote. I put the API string and the sender in my case hass in my secrets,yaml file.
Then I made an shell_command:

tasker_alarm: 'curl -X GET https://autoremotejoaomgcd.appspot.com/sendmessage?key={{ key }}&sender={{ sender }}&message=Alarm=:=Status={{ status }},Time={{ states.sensor.alarm_clock_time.state }}'

In my automations I use:

    - service: shell_command.tasker_alarm
      data:
        key: !secret tasker_key
        sender: !secret tasker_sender
        status: "ON"

to send the command to tasker. In Tasker I have an trigger that uses the AutoRemote plugin with an regex filter: Alarm=:=*

The part before =:= is used as a filter in tasker and the part after it is available in the task.

1 Like

This is good, I will use this to communicate with tasker (instead of using the notify.html5 component)

Do we need to add the tasker_key and sender_key to every automation / script? Is there a way to use !secret inside the configuration file instead?

tasker_alarm: 'curl -X GET https://autoremotejoaomgcd.appspot.com/sendmessage?key= !secret tasker_key &sender= !secret_tasker_sender &message= {{ arprr } =:= {{ arcomm }}'

- service: shell_command.tasker_alarm
  data:
    arprr: "test"
    arcomm: "test"