Tasker & Long Lived Access Tokens

Someone can give simple example of the usage including all parameters…

i could not get this to work…

@poratnir This can be also done with webhooks and without tasker plugin “RESTask”. Pictures are from RESTask. For testing and running from RESTask own play button, replace the “%HA_token” with your actual token.

I have found that webooks are, by far, the easiest to use in most scenarios.

This post by @masterkenobi is what helped me get it working.

I have also attached some Tasker examples. You will need to create two variables and for my examples to work,%HASSIO_SERVER and %WEBHOOK_ID
where:
%HASSIO_SERVER = https://yourdomain.duckdns.org
and
%WEBHOOK_ID = same_string_as_“webhook_id:”_in_the_automation

Pro tip 1: webhooks don’t require authentication so use a very hard to guess string for webhook_id (mine are 100 character randomly generated strings)
Pro tip 2: don’t use # or % in the webhook_id (Home Assistant doesn’t like # and Tasker doesn’t like %)

Obviously, you will also need to change the entries in the examples to reference items that exist in your Home Assistant environment. Hope these help. :grin:

Webhook_Automation.tsk.xml (1.7 KB)
Webhook_Command.tsk.xml (2.2 KB)
Webhook_Scene.tsk.xml (1.6 KB)
Webhook_Script.tsk.xml (1.6 KB)

Hey
thanks for assisting …tasker is just plug in …
how to activate it?

Not sure i fully understand how to use it … editing is easy…
how to run it?

I need the token for HADASHBOARD

Sorry, I don’t use HADashboard so I don’t know how to help with that. If you just need to generate token, you can do so from your account profile page.

So i log into the profile and create token with token name…
how to link the token to the service?

Solid. :+1:

3 Likes

Hey man! Nice to see you around! Welcome back!

1 Like

I see the Beauty in there! Done Well!
Unfortunately I was a Idiot and put in https://url.com/ instead of https://url.com - Took me an hour :sweat_smile:
Thanks a lot! And It should defenetly go in the cookbook!
When you give me the permision Ill do it for you (even after I cant code at all)

Please feel free to add it to the cookbook.

haha, thanks! Sorry to ghost! Pumped to be back at it.

son any inputs regard HADashboard?

Question: Is it possible to use webhooks to update an http sensor? I’m trying to use Tasker to fire when my phone disconnects from my car and i’d like to do a sensor instead of an input_boolean or something like that. I also don’t want to keep using the api and want to go token…is my only option the RESTask plugin?

I’ve been struggling a bit with this problem, and had some issues with the RESTask Plug-in.

I have finally found a method that suits me, so I wrote a quick tutorial which works without any Tasker Plug-in, if anyone is interested

2 Likes

Thanks @bokub! That seems to work great! Had to put a 1 second wait between calls (i have multiple sensors updating from a single task), but otherwise awesome (and yay 1 less app/thing that can break).

Hi. Are you gonna update your Tasker tutorials any time soon? Your vids are what helped me set things up way back when. Thanks for all you do.

ok guy this is a really simple question but im getting hard time to get it to work if im doing this http sensor

http://IP_ADDRESS:8123/api/states/sensor.Tabletbatt?api_password=mytwomileslongpassword
where shoud i place the token

You first need to ditch the ?api_password= portion if you’re trying to use a token. Second, I would give bokub’s post a read as that’s a fairly easy solution to get Tasker to work with tokens. Tutorial: Using the new Auth system with tasker