⚙️ Using Tasker with Home Assistant (V2)

Could you share your version, cause I would also really like the HA set-state?

hi! forgive me digging up such an old thread, but I just [day ago] found that, while looking for Tasker<>Home Assistant connectivity, and I’d like to say: great job! that’s exactly what I planned to do, but I AM SO GLAD that somebody did that before me - I think I just saved a lot of time :wink:

but I have a “small” [I hope] problem, so maybe you @bokub could help me out :slight_smile:

I use an old android phone [android 6.x, device hard to root/flash custom so it is what it is] as the car gps system, and also as mobile router for my also android based head unit, but it’s irrelevant. I made a two tasks that depend on the chargin status. when ignition is on and phone is charging, task “hotspot on” is started. it turns on mobile data, turns on wifi tethering and with a big help of your tasks - it sends information to my Home Assistant instance [it sends phone battery level and turns on “car active” input_boolean, the rest is done by my HA, but it’s not important now]. when ignition is turned off and phone charging stops, task “hotspot off” is started and it sends info to HA [battery level & turns off “car active” input_boolean], then it turns off tethering and turns off mobile data - so the battery is saved and phone is in “standby” mode [I can change it any time by sending a text message to turn the data on, I can ask for location and get it via text etc. all done with Tasker too].
the problem is, HA not always gets the info from tasker. I thought it is some kind of ping/lag issue, so I’ve added a “wait 20s” commands before and after running your tasks, to be sure they won’t be interrupted by mobile data off command etc. I’ve even cloned the “perform task” command, so now I’m running your tasks twice, to be sure that the info goes out of the phone.
still - it doesn’t work every time. on the other hand, when I run the task by hand - it reports correctly, and status of my car is changed in HA.
I thought that maybe it’s because when task is [or should be] started automatically - screen is off and therefore battery optimization kills tasker or sth, and while I do it by hand - screen is on; but that’s not the case - I made sure tasker is not optimized for battery usage, and also the rest of the task [mobile data/tethering] turns on and off correctly.
I didn’t saw any errors displayed so I’m kinda stuck with no ideas.

can I somehow debug what’s happening with the information sent from your task - and if it is sent correctly?

1 Like

Dears,

When I execute the task, I recieve the following message in the notification bar:

With HA_ADDR set to “https://xxx.duckdns.org:8123

Error: 400
400: Bad request

With HA_ADDR set to “https://xxx.duckdns.org:8123/

Error: 404
404: Not Found

Any idea about how to solve?,

Thanks in advance.

Jose

As said in the tutorial, no trailing slash in HA_ADDR.

Have you checked that your JSON payload is valid ?

Thanks a lot for your tutorial. I don’t want to be spammer but I cannot find solution anywhere. I need a new task in TASKER to trigger my ‘Google Home Mini’ (of course integrated in HA) and let it say (maybe I shoul write ‘play’) audio file placed in HA ‘media’ folder. I’ve only found JSON script example: {“entity_id”: “media_player.studio_speaker”, “message”: “Hello World!”} but It’s for TTS (in addition doesn’t work).
Thanks a lot for any ideas.
Jard

Thanks to bokub I was able to create this widget.

This is a widget I built in KWGT that allows me to toggle devices and get the states of those devices. Using Tasker, AutoRemote and KWGT.

What you need for this widget:

Android OS phone Tasker (paid app) KWGT (paid app) AutoRemote Lite (paid or free) Home Assistant

1 Like

I’m trying to setup tasker to communicate with home assistant and have tried to follow the tutorial… Seems I have done something wrong as I am getting a error from tasker and have already managed to block my IP once lol… I am using duckdns. Any help would be much appreciated ! :slightly_smiling_face::+1:t2:

Hello,
I found this thread very interesting and decided to give a try to this solution to let tasker communicate with HA.
I made a task, and it works ok if I execute it directly, but I get an error 400 bad request when I use it in a profile that runs every 5 minutes.
I’m getting the battery status from my smartwatch (via autowear) and I would like to send it to HA.
The JSON for my task is the following:

{“entity_id”:“input_number.watchbattery”,“value”:“%awmessage”}

Again, if I execute the task it works perfectly, and the values in HA are set accordingly, the bad request only happens when I use a profile “every 5 minutes”.

Can you help with this?
Thanks in advance!

OK, it seams it was a problem with my phone that hibernated autowear, and so the plug-in didn’t work when the screen was off.
So it didn’t pass any parameter to the following step.

Thanks anyway.

Is anyone having a problem with this? I am getting an Error 60 when I try and run this shell command. It was previously working fine

I am getting this exact same issue. Did you manage to get it fixed?

I’m no longer using Tasker>HASS. Tasker was crashing on the old Galaxy S3 I had it installed on with the original Android. To get it working, I updated the OS to a newer Android 7 build found on xdadevelopers.com I suggest that you do the same - research what newer XDA Android builds will work on your old phone.

If you must stick with the same Android 4.4x OS, then try contacting the Tasker developer for advice on possible older version of Tasker or some other configuration to get past the error.

Maybe someone here can help me. I’m searching for a solution to interact with the reolink app via Tasker and home Assistant. What I want is that when alarmo is triggered Tasker opens the reolink app and starts recording. It’s a battery powered camera and don’t have a rtsp stream. Neolink doesn’t work because with neolink the battery is empty after a few hours.

Is this possible with Tasker or someone has got a better idea?

So I want to realize this project:
https://notenoughtech.com/tasker/how-to-sync-android-alarm-with-nodered/

For starters I wanted to send a message from Tasker to Node Red.
Pretty simple one would think, especialy as he explained that pretty well here:
https://notenoughtech.com/tasker/integrating-nodered-and-tasker/

As I want to have this function working only within my own house anyway
I decided to do this without any dyndns. Only within my own network.
Therefore my first attempt was to send a http message from Tasker to NodeRed.
But whatever I tried I didn’t succed.
Anybody an idea?
Do I need to enter my credentials for the mqtt server anywhere?
That’s the only thing I could think of.

Grateful for any hint.

Cheers
Enrico

Hi, I receive the same error. Did you manage to fix that?

Thanks it works …but cant we control phone from home assistant ?
Say from home assistant call service to turn phone volume like that ?

Trying to use a input_select.select_option but not sure how to format the second JSON, which as per the converter should be:

{
“data”: {
“option”: “Noche”
},
“target”: {
“entity_id”: “input_select.fase_del_dia”
}
}

Any clues?

Just curious why I can’t this to work. The first picture is running from HA webpage and works perfectly. The second is my tasker plugin. What do I have formatted wrong in Tasker plugin? I get Eroorn400? I appreciate any help you guys can give, I have a feeling it’s something quite simple.

Second picture

Wow, I knew it was simple. Didn’t put seconds in the times!