Homey Community Forum

[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!

9 Likes