[How To] Setup two-way communication between Homey and Android smartphone

Quite often I like to use my Android smartphone to directly start a Homey flow, operate a Homey device or to put data into Homey flows without using the Homey app. If you would like to do the same, then this tutorial is for you.

What will be addressed in this tutorial:

  • Install Tasker on your Android smartphone
  • Install Join on your Android smartphone
  • Find device ID and generate Join API key
  • Create Join URL
  • Configure Tasker and Join to react to a received message
  • Setup the webhook in a Homey flow
  • Test communication from Homey to your smartphone
  • Copy Homey Cloud ID
  • Create Homey webhook URL
  • Setup Tasker to communicate with Homey
  • Setup a Homey flow to receive the webhook from Tasker and to react to it
  • Test two-way communication between Homey and your Android smartphone
  • Usage examples

The way Homey and your Android smartphone will communicate is via webhooks. We will start with your Android smartphone because there are a few apps you’ll need to install.

Install apps

First, you’ll need to download and install the app Tasker.

With Tasker you can automate everything on your smartphone. When you install the Tasker plugin Join, you can use external triggers like Homey flows, to run tasks in Tasker.

Find device ID and API key

Before the webhooks that Homey sends can reach your smartphone you’ll need to get a Join API key and find out your device id to create a Join URL.

Go to this site to learn more about Join and click on the link ‘API key available here’ to see your device ID and generate an API key for your smartphone.

https://joaoapps.com/join/api/

Create Join URL

Copy the device ID and API key and paste them into this URL:

https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?title=HomeyExample&apikey=YourAPI&deviceId=YourDeviceID&text=HomeyInput

The ‘Title’ and ‘Text’ part of the URL can be customized to contain the message you want to send to your smartphone.

Be aware: anyone who knows this URL can send data to your Join app, so keep it safe!

Configure Tasker and Join

With Tasker and Join installed on your phone you’ll need to configure a profile and a task with actions so Tasker will react properly when the message is received.

  1. Open Tasker on your smartphone


2. Create a new Profile with the ‘+ button’
3. Choose ‘Event’
4. Select Event Category ‘Plugin’ and select ´Join´, click ‘Received Push’
5. Click ‘configuration’
6. Click ‘text’
7. Define a text filter. Type ‘HomeyInput’ and click OK

  1. Select ‘Exact’
  2. Go back, save, and go back even more
  3. You’ll be prompted to choose or create a task: create a new task and name it ‘Homey User Input’
  4. Create a new action with the ‘+ button’
  5. Select Action Category ‘Alert’ and select ‘Flash’
  6. In the field ‘Text’ type: %joinmessage (this is the variable which contains the message from the webhook’)
  7. Go back
  8. Go back
  9. Save and exit Tasker

Tasker is now configured to receive a webhook from Homey and when this message is exactly ‘HomeyInput’, then Tasker will flash the message in a toast notification on your smartphone.

Set up the Join URL in a Homey flow

  1. Create a new flow
  2. WHEN: This flow is started
  3. THEN: Sent an http Get Request. Choose the ‘Logic card’ or a ‘Better Logic Card’. Use the Join URL you made earlier and make sure ‘Text=HomeyInput’ and ‘title=HomeyExample’
  4. Name your flow ‘User Input 1’ and save

Test communication from Homey to your smartphone

Everything is set up so it is time to test.

Start the Homey flow ‘User Input 1’ and look at your smartphone. If all goes well you’ll see the toast notification briefly with the text from your Homey webhook: ‘HomeyInput’. If you didn’t see it, try again because the toast disappears rather quickly.

If it didn’t work: check all the previous steps.

If it does work: congrats, we now have one-way communication between Homey and your smartphone. But we want two-way communication.

Copy Homey Cloud ID

For the other way we need the Homey Cloud ID.

  1. Open the Homey app on your smartphone
  2. Select Settings, General
  3. Tap on the cloud ID to copy it

Create Homey webhook URL

  1. Paste your CloudID into this URL:
    https://YourCloudID.connect.athom.com/api/manager/logic/webhook/HomeyExample?tag=%joinmessage
  2. Make sure you set the tag to ‘%joinmessage’ (this variable contains the message we send to Homey)

Setup Tasker to communicate with Homey

  1. Open Tasker on your Android smartphone
  2. Open the task ‘Homey User Input’

  1. Click the + button to append a new action
  2. Select Action Category and select ‘Net’
  3. Select HTTP Request
  4. Select ‘GET’ method
  5. Paste the above URL with the Homey Cloud ID in it into the field ‘URL’

  1. Go back
  2. Go back
  3. Save and exit tasker

Setup a Homey flow to receive the webhook from Tasker and to react to it

  1. Open the Homey app
  2. Create a new flow
  3. WHEN: Logic- Event is received
  4. Event: HomeyExample
  5. THEN: Google TTS (text: The input given is [TAG])
  6. Name the flow ‘User input 2’
  7. Save the flow

Test two-way communication between Homey and your Android smartphone

Now start the Homey flow ‘User Input 1’ and listen to your Google speaker. If all went well your Google speaker was saying ‘HomeyInput’.

‘HomeyInput’ was the text in the webhook which was sent to your smartphone in the flow ‘User Input 1’. The Tasker app reacted to this message by flashing ‘HomeyInput’ in the toast notification and by sending this same message back to Homey.

Homey reacted to receiving this message by letting Google TTS saying ‘The input given was HomeyInput’ out loud.

Congrats, you now have established two-way communication between Homey and your smartphone.

See these little video’s I made:

Great, but what can I do with this?

Well, since you are now able to send whatever data you want from Homey to your smartphone and the other way around, you can do pretty much everything.

  • You can start a flow with an Android widget on the home screen of your smartphone.

  • You can flip a variable in Homey by tapping an Android widget on the home screen of your smartphone and this way control whether the Homey flow should start or not.

  • You can let Homey ask for user input on your smartphone before a flow runs
    I have a flow which rolls my window shutters down based on the expected weather conditions and temperature. Before it rolls them down Homey asks me if I want them down or not. If I don’t answer in 10 minutes they’re lowered anyway.

  • You can let Homey run a flow based on an event on your smartphone
    I have several Home Connect appliances, but the Home Connect app on Homey doesn’t have all the options the Android app from Home Connect has. So, when the Android Home Connect app has a message from one of my appliances, I’ll intercept this message and let Homey announce this message on my Google speakers.

  • You can start events on your smartphone based on data in Homey
    Every night at midnight I get a notification on my smartphone with the gas and electricity usage of that day including prices. I append this data in a HTML file on my smartphone with the energy data from the last two weeks, so I can easily compare the data with one button.

  • And much more. Also because there are a lot more plugins to Tasker which you can use.

Have fun!

15 Likes

Hi, is this also possible for iPhone ?

Not as for as I know, but I could be wrong. I’m not a big Apple user.

Just tried the direction from tasker to homey in order to start a flow based on certain application notifications. Works like a charm. :v:

Meanwhile I additionally tested the other way (from homey to tasker). And in works as well. Had some more issues shit the setup, but this is mainly due to my limited knowledge about join etc.

But now I have my battery level of my solar panels displayed as nice widget on Android. No need anymore to open homey or any other app. Fantastic :heart_eyes:

1 Like

I must be missing a minor detail, but I cannot get the whole chain to work. May be someone can help?

So, what is working?
Sending the Join URL from my Homey Flow results in Join-notifications on my phone.

The flow:

And the result on my phone:

But unfortunately I do not get the Toast message.

If I run the two tasks in Homey User Input in Tasker, I DO get the toast message and it seems that the second task is also executed (green dot flashes). But I do not get a message on my Homey Timeline (which I use for testing)

Tasker animation

For some reason, Tasker does not seem to pick up the URL, even though it is reaching my phone

When I paste the URL of the second task in the browser on my phone, the second flow on my Homey is started, and I receive the test-message on my timeline.

The flow:

And the resulting notification on my phone:

I already spent some hours, starting over again twice, bit it still does not work. What am I missing?

Did you setup the profile correctly in Tasker? See: “Configure Tasker and Join”.

The profile receives the webhook from Homey (via Join) in Tasker and triggers the task ‘Homey input’ to flash the message and to post back to Homey.

If the profile isn’t setup correct then it will not trigger the task.

I thought I did (tried a few times), but just to be sure I completely deinstalled Tasker and Join and restarted with a fresh config. Followed all the steps in your manual carefully, but for some reason, sending the URL does not result in the toast message.

Here’s my config in Tasker:
1

As you can see at the end, when I run the task the Toast message appears.

But this is what happens when I run the flow in Homey:
2

I do get a dropdown from Join (so the URL must be right, I would guess), but the Task in Tasker does not run, hence no Toast message.

I have no idea what I could be overlooking here.

Thanks again for you help!

Hmm… have you checked that Tasker is allowed to run in the background? Battery optimization for Tasker and Join should be turned off.

Yes, I am pretty sure that both apps are configured to run in background and are excluded from battery optimisation.

However, for my use case this issue may not be a big problem: I am mostly interested in activating flows when something happens on my phone.

So for example:

  • Security cam in backyard notices a person
  • Cam sends a notification on my phone
  • Tasker picks up this notification
  • Tasker sends URL to Homey
  • Homey executes a flow (turn on light in backyard)

I believe with what I have now, this should be possible. I just need to figure out how to do this in Tasker. :slight_smile:

Have you validated that Tasker is working with other profiles and tasks? If not, maybe you can look for help on Tasker related fora.

With the use case you’ve described you don’t even need Join. You can use the Tasker plugin AutoNotification. With this plugin you can intercept any notification on your device in Tasker.

Although I did not get it to work via Join, thanks to your [How To] I did find a solution that fits my needs even better.
I installed ‘Autonotification’ and ‘AutoInput’ from the Tasker Autoapps plugin library and now I can indeed intercept and parse any notification and send variables (app, notification title, notificationn text etc.) back to Homey to use in a flow.
Although I do not need it, it’s also possible to use notifications from Homey, which would make the communication via Join redundant anyway. And it’s probably more secure, too. :slight_smile:
Thanks for your help!

2 Likes

@Joenoo Thanks for this write-up! I’m pretty new to both Tasker and Homey, so I never would have figured all this out on my own!

One thing I noticed is that I needed you use a different Homey webhook URL. Not sure if it’s an update since this post was written, or just because I have the Pro 2023.

In Tasker, I had to use this URL structure: https://webhook.homey.app/YourCloudID/HomeyExample?tag=%joinmessage

In my Homey flow, the Logic-Event is now called Logic-Webhook event

Hopes this helps others!

2 Likes

Thanks to @tomdrake and @Joenoo for this tutorial. With this I reached my goal: To have instant update of the preformance of my solar panels on my watch. I am sooooo Happy!!

All the best.
//Peter

1 Like

super nice solution. for even more ease of use between different smart home apps. I did throw it off my phone. Because it uses a lot of power, even when it is turned off.