Cant add generic digital device


#1

Hi.
I cant add a Generic Digital Output Actuator. The add Actuator button is disabled. Any ideas?


#2

Hi @Georgedlake,

For MQTT, you need to use Custom Widgets.

Select Button Controller Widget, and fill out the rest.

You will need a CAYENNE_IN function in your sketch for each one you add.

For example, if you put 1 in the channel field:

CAYENNE_IN(V1)
{   
    int currentValue = getValue.asInt();
  
    if (currentValue == 0) 
    {
       digitalWrite(RELAY_PIN, HIGH);
    }
    else
    {
       digitalWrite(RELAY_PIN, LOW);
    }
}

Cheers,

Craig


#3

Hi community
I have the same problem too, "Step 2: Add Widget " button is disabled and when i click the “Step 1: Sketch file” button, in that code already exist CAYENNE_IN function. I am new in Cayenne, please help…


#4

@jadzamen the step 2 is enabled once you fill all the details.


#5

Thank you a lot, i made it, but i still have only virtual to choise (in the field connectivity) and if i want to just on/off the led i must have digital output pin in that field?


#6

in new cayenne MQTT version, there is only virtual channel which act as communication between cayenne and your device. so next you write a code for whatever you want to the do with your device.


#7

It works… Thank you very much :slight_smile: