[HOW TO] Using Tasker to send battery level from phone to homey

Tasker is a payed app which you can install on your Android phone to send information to homey using a webhook. In this example I explaine how to send a webhook so homey knows the battery level of your phone.

First install tasker.
Open tasker on your phone.

Tasker works with profiles (In this case with an event) and tasks to complete with the profile.

So we first create a profile:

It will be an event:

Choose Power:

The event is Power Changed:

Go Back:

Click on New Task:

You can give the task a name but itś not necessary. You can just press

Click on a new action:

The task is a NET task.

Choose HTTP REQUEST

Make sure the method is set to GET

Now we must create the URL. First find out the id of your homey
go to the homey app. Find settings and in general you can find yout homey-ID

The URL to put in tasker is

https://webhook.homey.app/(youthomey-id)/batterij-level?tag=%BATT

%BATT is the variable that tasker uses for the batterylevel of your phone.

Press back in tasker.

Now your phone will send the batterylevel to homey everytime it changes. But it will send it as text.

Now In homey make a number variable where you can put the data form Tasker in. For instance batterij telefoon Paul

The flow to get the data → convert it to a nember and put it in the variable id one with logic.

Happy programming.

PS the issues below are solved in this tutorial

TIP: Use tasker State ->Power to make a flow based on this action to find out if your phine is hooked up.
Or Event → Phone ringing → Sonos says whoś calling and pauses Netflix
etc etc

6 Likes

:netherlands: Nederlands :
Bedankt voor de tutorial met afbeeldingen
maar ik heb een vraag
ik heb alles gedaan zoals beschreven en uitgelegd maar batterij is 44% maar homey geeft nogsteeds aan 0% ?
wat kan er fout zijn ?

:uk: English :
thank you very much for this tutorial with images
but i have a question
i have done every thing from this tutorial but battery level is 44% but homey still tells me its 0 ?
what can i have done wrong ?



Try attaching some timeline or log cards to all 3 flow cards.
That way you can see whether there’s a webhook received, or not.

:netherlands: Nederlands:
daar was ik nu mee bezig maar krijg nu op mijn chromebook deze melding

:uk: English:
is was adding timeline logcard but then got this message

Have you set up http method GET?

.

OWH!
There appears to be a whitespace in your webhook!:x:

.
Ah, I see the cause already. The example URL also has a whitespace at that position :see_no_evil:

@Paul_van_Ulft would you mind removing the whitespace from the sample URL?

1 Like

:netherlands: Nederlands:
je heb gelijk super bedankt het was de spatie
op mijn chromebook zie je die spatie bijna niet zo smal dit werk nu bedankt :smiley:
:uk: English:
Your right thanks in advance it was a white space
on chromebook you cant almost not see the white space it works thanks

1 Like

:netherlands: Nederlands:
alles werkt weer nu zonder life360 super bedankt !!! @Paul_van_Ulft en @Peter_Kawa
voor de tutorial en fix

:uk: English:
Everything is working now without life360 thanks in advance !!! @Paul_van_Ulft and @Peter_Kawa
for the tutorial and fix
image

Removed space from link :+1:

2 Likes

The app Tasker is not available for iPhone, just a info.

2 Likes

Posts translated.
Yeah it’s my bad, I started babbling in Dutch appearantly :face_with_peeking_eye: :face_with_open_eyes_and_hand_over_mouth:

1 Like

:netherlands: Nederlands : Sorry heb het aangepast

:uk: English: Sorry i have edited it

1 Like

Thanks for a very good tutorial! Is is possible to go the other way? i.e. from Homey to tasker?

Regards from Sweden
//Peter

Hej Peter,

With Macrodroid it’s quite simple, it can read notifications. I guess Tasker could read notifications as well.

Example
I send a push notif to myself with ‘homey-naar-android’ (homey-to-android)

This macro listens, and acts if the phrase AND the app name Homey matches on new notifications:


Many thanks, Peter. I will give it a try.
//Peter

1 Like

nevermind

Does anyone got that working with macrodroid?

Where do you get stuck?

I don’t receive the info in my homey. So i think it’s the webhook itself. I use the same method like shown above.

The last posts were about a push message from Homey to your phone, which gets read by Macrodroid.
You seem to be busy to send a webhook from your phone to Homey, as mentioned earlier in this topic.
OK, when you open this URL below in a browser, it should return two letters: "ok"
https://webhook.homey.app/(your_homey-id)/my_event?tag=my_tag

When it does, the webhook is okay and received by Homey, the problem is somewhere in your flow.
BTW You know where to find your homey ID? It’s in the web app URL, right after …/homeys/

The link shown OK
Yes i know where to find the homey ID


this is the flow where i store it in my variable, but still showing 0
the first part batterij-level is just the name from the url you made in macrodroid, right?

https://webhook.homey.app/****homey ID****/batterij-level?tag=%BATT