Cayenne_in input not available/working (ESP8266/nodemcu)


I have a problem getting an acutator to work. I tried to switch the builtin LED of my ESP8266 nodemcu with cayenne_in. I used the example provided here

And modified it to the nodeMCU pinout. I can access the LED during setup() and also in the loop(), but it is not available in online dashboard. The virtualwrite of the time in cayenne_out works.
I am quite confused what is wrong. In the dashboard I cannot add a widget to switch the LED, the option to select my device is greyed out.

This is my code:

#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
#define ACTUATOR_PIN 2 // Do not use digital pins 0 or 1 since those conflict with the use of Serial.

unsigned long lastMillis = 0;

void setup() {
Serial.print(“Setup start”);
Cayenne.begin(username, password, clientID, ssid, wifiPassword);

// Blink LED if setup finished
for (int i = 0; i < 5; i++)
digitalWrite(ACTUATOR_PIN, 0);
digitalWrite(ACTUATOR_PIN, 1);

void loop() {


Cayenne.virtualWrite(0, millis() / 1000);
Serial.println(“cayenne out”);

int value = getValue.asInt();
CAYENNE_LOG(“Channel %d, pin %d, value %d”, VIRTUAL_CHANNEL, ACTUATOR_PIN, value);
digitalWrite(ACTUATOR_PIN, value);

This is the serial output:

[1077] Connected to WiFi
[1077] IP:
[1078] Connecting to
[1405] Connected
[1538] Publish: topic 4, channel 65534, value NodeMCU, subkey , key 
[1539] Publish: topic 6, channel 65534, value Xtensa32, subkey , key 
[1553] Publish: topic 7, channel 65534, value 80000000, subkey , key 
[1627] Publish: topic 5, channel 65534, value v1, subkey , key 
[4700] Publish: topic 1, channel 0, value 4, subkey , key 
cayenne out
[13771] Connection ok
[19912] Publish: topic 1, channel 0, value 19, subkey , key 
cayenne out
[23995] Connection ok

I tried resetting the dashboard and readded the device without any luck.

I would be glad, if you could help me with this.

Kind regards,

you might have added a BYOT device to your dashboard. You can add a custom button widget to control the led. To add go to :- add new ---> devices/widgets ---> custom widget ----.> button fill in all the details and add the button widget.

1 Like

thank you very much! That did worked!
I did not try to add a BYOT device, but I tried several of those preset actuators above and none of them showed up to be available…
I am sorry for asking that stupid question… but I must have missed that point in all those descriptions and tutorials somehow…

Thank you again for your answer!

Best regards,

1 Like