I wrote Adam Noren about this and contacted Athom. While Mr Noren didn’t react in any way, Athom is just being Athom and gave me a standard mail response.
So I thought about how I can achieve this in other ways. I want to share my alternatives with you.
1. IFTTT
I used the IFTTT Mail integration and the IFTTT-Homey-App for a long time. It works. Not fast, not on every mail (paypal mails eg seems to be filtered out), but it works. But due to the lag and not every mail being delivired, it was not reliable enough for my purpose.
2. Webhooks
In my case I used the mails as a transmitting service for information. So I chose to do this with a complete other method: a webhook called by a PHP-script with curl and all the tags I want.
Here is the PHP-script:
$url = ‘https://webhook.homey.app/YOURWEBHOOKTOKEN/THEHOMEYTAG?tag=‘.rawurlencode($data1).’_’. rawurlencode($data2).‘_’.rawurlencode($data3);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “GET”);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
The “_” serves as seperator of tags I want to read out differently in homey. The $data-variables can be anything you want. Everything gets encoded in rawurl, therefore nothing gets lost. This must be reverted in Homey, so you have to split the string and decode it and write it in variables to use after in the flow. This is my script (Run Script with Input) in Homey, following the logic card “Webhook event [THEHOMEYTAG] has been received”:
// decode & split
let input = (args[0]);
input = decodeURI(input);
let array = input.split(“_”);
let one = array[0].trim();
let two = array[1].trim();
let three = array[2].trim();
// create Homey-Tags
await tag(‘TAG1’, one);
await tag(‘TAG2’, two);
await tag(‘TAG3’, three);
TAG1, TAG2 and TAG3 are the tags that can be used in flows from then on. You have to start the script once, to create the tags and then they will be available in the tag-list in other flow-cards.
I know, not every usecase of the mail-app can be replaced with the PHP-webhook-method, but maybe it will help some of you. There are also several ways on different systems to trigger a PHP-script, when a mail is received, but I haven’t dived deep in there yet.
3. Rebuilding another App for incoming Mails
I just have started to get into the app-building process for Homey. Once I’m able to get there, I will try to create another app for this purpose, called Mailtrigger or something like that. But please be patient as this is just a hobby and I have to use my limited free time for this.
Please feel free to ask any questions about this.