> For the complete documentation index, see [llms.txt](https://docs.blynk.io/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blynk.io/en/blynk.console/templates/datastreams/datastreams-common-settings/wait-for-confirmation-from-device.md).

# Wait for confirmation from device

For some critical actions it is very important to know that hardware actually received the command and applied the received value from the user input.

For such use cases Datastream has confirmation property. It allows you to setup the interval during which user can wait for the response from the device, while the widget used to send the value will be disabled.

For example, let's assume you have a garage door and which you can open by sending the `1` value via the button that is assigned to the Virtual Datastream on `V1` and you have set the `Wait for confirmation` period for 5 seconds.

When you click on the button - it sends `1` value to the hardware. In case hardware is online and accepts the value - it can send back the applied value (telling us that door was successfully opened). If hardware wasn't online or haven't send any confirmation sue to error or non acceptable value - Datastream value will be reverted to the previous value.

![](/files/-MSgxdhzrZ8e821HENFc)

Here is a simplest code example that shows how you can make it work:

```
BLYNK_WRITE(V1)
{   
  int value = param.asInt();
  if (value == 1) {
     if (openDoor()) {
       Blynk.virtualWrite(V1, "1"); // confirm the value, ui will enable the button
     } else {
       Blynk.virtualWrite(V1, "0"); // you can send back any other value, 
                                    // saying that change was unsuccessful
                                    // ui will enable the button
     }
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.blynk.io/en/blynk.console/templates/datastreams/datastreams-common-settings/wait-for-confirmation-from-device.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
