Email app trigger not working

I am using the email app (by Adam Norén). The flow I am using is not working. The credentials are valid and from the gmail dashboard I can see that the app has last connected about half an hour ago. (It is a g-suite mail adress on my own domain).

When I test the flow with the subject of a recently received email, it just works. Also for an evening the flow has done its job, but when I woke up the next morning the flow wasn’t triggered anymore. It has not been working for days now… Restarting the app hasn’t worked, pulled the plug, also not fixed.

Could you please help me?




Did you try to disable 2 factor authentication? Only for test

Did you rtfm? (Sorry, a bit rude, but most people including myself don’t rtfm :sweat_smile::see_no_evil:)
I know you can logon, and it worked for a while, but:
Could this help you out? The Gmail account setting?

All of a sudden it seems to work now. Didn’t change a thing. Hope it keeps working.

The setting “use less secure apps” is not available when 2fa is on…

That’s funny. Finger’s crossed. And maybe the use of less words can help at Email subject contains
F.i. ‘trade hopper’

Thanks for the help Peter and Tolga! I’ll see what happens :wink:.

1 Like

Hi I’ve just migrated to a pro 2023 - the email app works.fine on my old 2016 homey - but on the new one it crashes every time an email arrives. Any ideas. Have tried reinstall - no luck

1 Like

same here. It crashes…

You can try to reach the dev Adam by info@adamnoren.se
(found it with one of his other apps)

Same here… doesn’t work. Looks like login works as the app is up and running. But as soon as I receive an email the app crashes.

Maybe an acceptable workaround when you need a trigger: I use the Whats-app App and send a Whats- app to my own account with a certain text to trigger a flow.

I have exactly the same problem.
I just installed the app on Homey Pro.
Connection test is OK, but the app crashes, when a mail is receiver.
Any hints?

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.