Trigger will not work - esp8266

Hi! I found a problem. I have configured my esp8266 card and everything works correctly. However, if you set the “trigger” with notification when the card goes online / off, the trigger will not work. Does not send sms to the set number! If instead I create a “triggering” signal when I turn on and turn off a light, the “trigger” works properly.
Help me. thank you

Hi @rosatigino93 and welcome to the Cayenne Community

Is your ESP8266 connected through our “Bring Your Own Thing” MQTT API? If so, this is a known issue with MQTT notifications being delayed or not arriving that we’re working to fix at the moment. If you have it connected ‘as an Arduino’ you should not see these delays as non-MQTT connected Raspberry Pi and Arduino devices use a different notification system that doesn’t have this issue.

If you already have your ESP8266 connected as an Arduino, then there may be a different root cause. I know some international users have had issues with SMS notifications as our system requires the number to be entered as if it was dialed from the USA. If this is the case, let me know what country you are in and I can show you the correct format to dial in.

First of all thank you for having responded! I am Italian and I use the following sketch for esp8266:

// This example shows how to connect to Cayenne using an ESP8266 and send/receive sample data.
// Make sure you install the ESP8266 Board Package via the Arduino IDE Board Manager and select the correct ESP8266 board before compiling. 

#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>

// WiFi network info.
char ssid[] = "ssid";
char wifiPassword[] = "wifiPassword";

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "MQTT_USERNAME";
char password[] = "MQTT_PASSWORD";
char clientID[] = "CLIENT_ID";

unsigned long lastMillis = 0;

void setup() {
	Cayenne.begin(username, password, clientID, ssid, wifiPassword);

void loop() {

	//Publish data every 10 seconds (10000 milliseconds). Change this value to publish at a different interval.
	if (millis() - lastMillis > 10000) {
		lastMillis = millis();
		//Write data to Cayenne here. This example just sends the current uptime in milliseconds.
		Cayenne.virtualWrite(0, lastMillis);
		//Some examples of other functions you can use to send data.
		//Cayenne.celsiusWrite(1, 22.0);
		//Cayenne.luxWrite(2, 700);
		//Cayenne.virtualWrite(3, 50, TYPE_PROXIMITY, UNIT_CENTIMETER);

//Default function for processing actuator commands from the Cayenne Dashboard.
//You can also use functions for specific channels, e.g CAYENNE_IN(1) for channel 1 commands.
	CAYENNE_LOG("CAYENNE_IN_DEFAULT(%u) - %s, %s",, getValue.getId(), getValue.asString());
	//Process message here. If there is an error set an error message using getValue.setError(), e.g getValue.setError("Error message");

I tried adding +39 in front of the phone number but it does not work.

I suspect you’re running into an ongoing issue we’re attempting to solve with MQTT triggers and notifications being delayed or not firing at all. On that end I’ll update as soon we believe the system to be stable.

I think your SMS number format looks OK for Italy. A good test to make sure it is the MQTT delays rather than the phone number would be to set an email notification too. If you are getting the email, then it could be an issue with the phone number format. If you are not getting the email OR the SMS, then it is likely an issue in our Alert & Triggers engines.

I tried, it does not even work with the email. More or less how much this bug will be fixed? I should install the cards on a farm. thank you.

After a heavy amount of testing and updates yesterday and into this morning, we now believe this system to be stable and working properly. Could you give your trigger another test (with both email and SMS notification) and see if it runs as expected?

I just tried. does not work. I just installed a Raspberry Pi3 and with him instead if I create the Online / Offline trigger works well.

good evening. There are updates?

Hi @rosatigino93,

We’ve done several updates now…how are the triggers working on your end?


I was very excited. I went to try but it does not work yet :frowning: :frowning:

It appears we have an issue specific to MQTT device Online/Offline triggers not firing. For the rest of your triggers (if there are anymore) these are firing OK?

As for the other triggers, I never had any problems. But I’m interested in that trigger … I’m waiting. Please fix everything otherwise I will have to change system. good day

Hi guys, I just tried triggers with MQTT-based devices. And yes, as of this time, it does not work. Here are the following devices I have:

  1. Arduino UNO - connected via SerialConnection
  2. NodeMCU - MQTT-based
  3. Wemos D1 Mini - MQTT-based.

Now, I have a trigger that turns on the switch on my Arduino Uno when NodeMCU is online. Nothing happens when the device is online. Same goes with Wemos D1.

Has this been resolved already? Will do more testings, and write an article about Triggers.


Thanks for the update @ebtenorio! We have not had time to fix yet, I will update everyone when we are able to push out a fix!


Hello @bestes, is this issue fixed? I also have a Wemos D1 using MQTT and Offline/Online trigger does not work…

Thank you very much.

1 Like

hi guys, i have a same problem , my dashboard cayenne not can add widget and then trigger not work.
here are the following devices i have

  1. Nodemcu esp8266
    2.gas sensor Mq6