Help with Alexa+Node Red+Blynk

In my sketch, im using a 15sec writing to V0 in void loop. I use the Blynk API cause its the only one with input and output. I could use alexa to trigger but i discovered that the answer was not the trigered output but the previous one stored in the cloud device.
I dunno if im being cleared.

You donā€™t need a node with one input and one output.
Go back to my original example, and replace the pink MQTT node labelled ā€œSpain/Living_Room/Temperatureā€ with a Blynk Write node connected to V0.
Provided your sketch is writing temperature data to V0 on a regular basis I think this should be received by the Blynk Write node.
If it isnā€™t then a Bridge node should do the trick.

Pete.

I did but it only outputs one time

Show me what your flow looks like, and also post your sketch.

Pete.

Flow working is like above. Similar at yours but with Blynk node instead of your mqqt also in above posts

Sketch:

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <DHT.h>
#include <ArduinoOTA.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "x";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "x";
char pass[] = "x";

WiFiClient client;

//Initialize DHT Sensor
#define DHTPIN 2 // digital pin connected
// Uncomment type you're using
#define DHTTYPE DHT11 // DHT 11
//#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
//#define DHTTYPE DHT21 // DHT 21 (AM2301)
DHT dht(DHTPIN, DHTTYPE);


void setup()
{
// Debug console
Serial.begin(115200);

// Connect to Wi-Fi network with SSID and password
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");

while (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("Connection Failed!");
}
// Print local IP address
Serial.println("");
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
  
Blynk.config(auth, IPAddress(192,168,1,x), 8080);
}

//Debug Purpose
//pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output

Serial.println();
Serial.println("Created by Deltamike");
Serial.print("Sketch: "); Serial.println(__FILE__);
Serial.print("Uploaded: "); Serial.println(__DATE__);
Serial.println(" ");
Serial.println("Temperature and Humidity using Sensor DHT11");

// DHT11 Test
Serial.println("Initializing DHT11...");
dht.begin();

// Port defaults to 8266
// ArduinoOTA.setPort(8266);

// Hostname defaults to esp8266-[ChipID]
//ArduinoOTA.setHostname("VITRINE");

// No authentication by default
// ArduinoOTA.setPassword((const char *)"123");
  
ArduinoOTA.onStart([]() {
Serial.println("Start");
});
ArduinoOTA.onEnd([]() {
Serial.println("\nEnd");
});
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
});
ArduinoOTA.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
else if (error == OTA_END_ERROR) Serial.println("End Failed");
});

ArduinoOTA.begin();
Serial.println("Ready");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());

//Debug Purpose
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
}

void loop()
{
ArduinoOTA.handle();
Blynk.run();
delay(14000);

float temperature = dht.readTemperature();
float humidity = dht.readHumidity();

// Check if any reads failed and exit early (to try again).
if (isnan(humidity) || isnan(temperature)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index in Celsius (isFahreheit = false)
float hic = dht.computeHeatIndex(temperature, humidity, false);

Blynk.virtualWrite(V0, temperature);
Blynk.virtualWrite(V1, humidity);
Serial.print("Temperatura: ");
Serial.print(temperature);
Serial.print("C ");
Serial.print("Humidade: ");
Serial.print(humidity);
Serial.println("%");

//Blynk PUSH NOTIFICATIONS Setup
//if(temperature > 30)
//Blynk.email("xxx@gmail.com", "xxx", "xxx over X!");
//Blynk.notify("Alerta - Temperatura acima de 30ĀŗC!");

//if(humidity > 20)
//Blynk.email("xxx@gmail.com", "xxxt", "xxx over X!");
//Blynk.notify("Alerta - Humidade acima de 20%!");

delay(1000);
}

Note: Im not a programmer, code is working but maybe it should be better applied

@Deltamike please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

Iā€™m surprised that your code is working at all. Your 14 second delay in the void loop would normally cause a Blynk disconnection, as the default timeout is 10 seconds.

You really need to use a Blynk Timer to call the code that takes DHT readings and uploads them to Blynk.

The sketch builder example here is a ready made sketch that will work much betterā€¦

To understand why your sketch breaks the Blynk rules you should read this:

http://help.blynk.cc/getting-started-library-auth-token-code-examples/blynk-basics/keep-your-void-loop-clean

So is that still using the Blynk API contrib?

Pete.

To work, yes. I will re-work code with timer and this way use the websocket version

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <DHT.h>
#include <ArduinoOTA.h>

// Blynk Auth Token.
// Go to the Project Settings (nut icon)in Blynk App.
char auth[] = "x";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "x";
char pass[] = "gx";

//Initialize DHT Sensor
#define DHTPIN 2 // digital pin connected

// Uncomment type you're using
#define DHTTYPE DHT11 // DHT 11
//#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
//#define DHTTYPE DHT21 // DHT 21 (AM2301)

DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;
WiFiClient client;

void sendSensor()
{
float temperature = dht.readTemperature();
float humidity = dht.readHumidity();

// Check if any reads failed and exit early (to try again).
if (isnan(humidity) || isnan(temperature)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index in Celsius (isFahreheit = false)
float hic = dht.computeHeatIndex(temperature, humidity, false);

Blynk.virtualWrite(V0, temperature);
Blynk.virtualWrite(V1, humidity);
delay(1000);

Serial.print("Temperatura: ");
Serial.print(temperature);
Serial.print("C ");
Serial.print("Humidade: ");
Serial.print(humidity);
Serial.println("%");
}

void setup()
{
// Debug console
Serial.begin(115200);

// Connect to Wi-Fi network with SSID and password
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("Connection Failed!");
}

// Print local IP address
Serial.println("");
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
  
Blynk.config(auth, IPAddress(192,168,x,x), 8080);

//Debug Purpose
//pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output

Serial.println();
Serial.println("Created by x");
Serial.print("Sketch: "); Serial.println(__FILE__);
Serial.print("Uploaded: "); Serial.println(__DATE__);
Serial.println(" ");
Serial.println("Temperature and Humidity using Sensor DHT11");

// DHT11 Test
Serial.println("Initializing DHT11...");
dht.begin();

// Setup a function to be called every second
timer.setInterval(5000L, sendSensor);

// OTA Settings
// Port defaults to 8266
// ArduinoOTA.setPort(8266);

// Hostname defaults to esp8266-[ChipID]
//ArduinoOTA.setHostname("VITRINE");

// No authentication by default
// ArduinoOTA.setPassword((const char *)"123");
  
ArduinoOTA.onStart([]() {
Serial.println("Start");
});
ArduinoOTA.onEnd([]() {
Serial.println("\nEnd");
});
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
});
ArduinoOTA.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
else if (error == OTA_END_ERROR) Serial.println("End Failed");
});
ArduinoOTA.begin();

//Debug Purpose
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
}

void loop()
{
ArduinoOTA.handle();
Blynk.run();
timer.run();
}
```

Well, reworked the code, its working well, but flow dont work. Needs to be trigered like i used on my flow posted before. Dunno what im missing. Maybe using your solution with Blynk node instead of MQTT is the problem. I have no experience on this subject

Try adding an an inject node that has a one second repeating timer and feed the output into a Blynk WS Sync node that is configured to synchronise V0.
It doesnā€™t matter matter what the inject node outputs, so the default time stamp is fine.

Pete.