Page 1 of 1

Automation trigger endless notifications (Android)

Posted: Wed Aug 09, 2023 3:48 pm
by hasan_
Hi,

Just wanted to point out the when an Automation condition is satisfied, it just continually does the action (which is fine) but also constantly keeps sending push notifications that the automation is triggered (every second).

Ideally, it should be: trigger_once_while_true
or, an option to trigger once or repeatedly.

Either of those can solve this problem. Please look into this!

Thank you,
Hasan

Re: Automation trigger endless notifications (Android)

Posted: Wed Aug 09, 2023 3:51 pm
by ESP_Piyush
Thanks for reporting the issue. Can you also specify the automation trigger and action you had set so that we will have sufficient info to reproduce and debug?

Re: Automation trigger endless notifications (Android)

Posted: Fri Aug 11, 2023 10:41 am
by hasan_
Thank you Piyush,

I can confirm the problem exists in general. (Tried multiple combinations of conditions/actions with temperature, switches, custom etc)

The App sends Push notifications each time it updates while the Automation condition is 'true'. (If updateAndReport() occurs every 5 second, it would send Notifications every 5 seconds). However, one notification is sufficient as long as the condition remains true.

For the developers: Please add a trigger_once_while_true logic into Automation. i.e. send notification only at the instance where the Automation condition turns from (previously) false to (now) true.

Thanks!
Hasan

Re: Automation trigger endless notifications (Android)

Posted: Fri Aug 11, 2023 11:17 am
by ESP_Piyush
Thanks for providing the details. From the original message, it wasn't clear that the device is explicitly generating the same event multiple times. We will check how this can be handled.

Re: Automation trigger endless notifications (Android)

Posted: Wed Aug 30, 2023 11:51 am
by hasan_
Thanks Piyush,

Still facing repeated trigger notifications, quite annoying. I hope this is being addressed and hopefully be fixed soon? Thanks

Re: Automation trigger endless notifications (Android)

Posted: Sun Sep 03, 2023 4:33 am
by cloudmiracle
Perhaps this can help, example code that triggers notification only once when physical input1 is enabled:-

In order to set your code to send notification only once when the event occurs and not continuously, add the following code to the sketch so that the event occurs ----sends notification-----resets event.

bool current_state1 = LOW;
bool previous_state1 = LOW;

void setup()
pinMode(input1, INPUT_PULLUP);


void loop();
current_state1 = digitalRead(input1);
if (current_state1 != previous_state1) {
if (current_state1 == HIGH) {
delay (100);
bot.sendMessage(CHAT_ID, "Unit1 is OFF", "");}
if (current_state1 == LOW){
delay (100);
bot.sendMessage(CHAT_ID, "Unit1 is ON", "");}
previous_state1 = current_state1;
}

In this manner the sketch will send notification (in this case TelegramApp) only once when input1 becomes HIGH. It will only send notification next time when the input1 goes LOW and then HIGH again.