Trigger does not work with temperature

Trigger does not work
it should turn on the light switch if the temperature was higher than 23 C
But nothing happens. I have already tried several possibilities

is your trigger counter incrementing? have you hit the trigger limit?


what do you mean with “incrementing” ?

Yes, trigger limit is done

in trigger tag below the trigger, there is counter which shows the number of times the trigger has run.

the trigger tag shows “0”

that either means that you have not used the correct data type or has made some error while adding the trigger. can you share the code you are using.

How can I send a screenshot ?
In the arduino code I haven’t done anything

you can copy and paste the code here.

which code ?

the code which you uploaded on Arduino.

I will copy it some hours later.
If I turned on the light switch manually, it would work.
The correct temperature is also shown on the site.
Does the trigger really depend on the arduino code?

it depends on the data type.

Which data type do I have to use ?

here is the code:

#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include <OneWire.h>
#include <DallasTemperature.h>
#include <CayenneMQTTEthernet.h>


#define SENSOR_PIN 2 // Do not use digital pins 0 or 1 since those conflict with the use of Serial.
#define ACTUATOR_PIN 4 // Do not use digital pins 0 or 1 since those conflict with the use of Serial.
#define SENSOR_PIN2 7 // Do not use digital pins 0 or 1 since those conflict with the use of Serial.
OneWire oneWire(SENSOR_PIN);
DallasTemperature sensors(&oneWire);

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


void loop()

// This function is called at intervals to send sensor data to Cayenne.
  // Send the command to get temperatures.
  // This command writes the temperature in Celsius to the Virtual Channel.
  Cayenne.celsiusWrite(VIRTUAL_CHANNEL, sensors.getTempCByIndex(0));
  // To send the temperature in Fahrenheit use the corresponding code below.
  //Cayenne.fahrenheitWrite(VIRTUAL_CHANNEL, sensors.getTempFByIndex(0));
  int value = getValue.asInt();
  CAYENNE_LOG("Channel %d, pin %d, value %d", VIRTUAL_CHANNEL, ACTUATOR_PIN, value);
  // Write the value received to the digital pin.
  digitalWrite(ACTUATOR_PIN, value);
  // Write value to turn the relay switch on or off. This code assumes you wire your relay as normally open.
  if (getValue.asInt() == 1) {
    digitalWrite(ACTUATOR_PIN, HIGH);
  else {
    digitalWrite(ACTUATOR_PIN, LOW);
  Cayenne.virtualWrite(VIRTUAL_CHANNEL2, digitalRead(SENSOR_PIN2));

can you PM me your email_id. when did you add this device? Have you set the trigger for VIRTUAL_CHANNEL2 ?


the email id is:

see screenshot

can you PM me you emai_id?

do you mean the password ?

i do not see your email_id in any of your posts.