Blynk 2.0 how to create EVENTS for Virtual Pin?

2. Create Event

  • Click Add New Event.
  • Name the first event with the name Hello.
  • Click Create (the event will appear in the Events tab list)
  • Repeat the previous step for the second event with the name Error.
  • Click Save to save and apply the changes made (select Update active device this time)

By default, we will have 2 events online and offline.
But I want to add other events for Virtual Pins to track usage history.
So, can you explain to me, when we use Blynk.virtualWrite(V,value); What is Blynk 2.0 to record Events on the system with COde?
Thank you

I went through the Datastreams function, and created a Chart for the Battery to see the usage data.

And I also read this API function
https://docs.blynk.io/en/blynk.cloud/get-device-report
However, its code really creates complexity every time I need to use it.

However, I want to see these data in Timeline, so I have to create an Event to write data to it.

I don’t really understand what it is that you are trying to achieve.

You seem to be saying that you want battery readings to be displayed in the events timeline, as well as in your Superchart? If so, then this isn’t how events are designed to be used.

Pete.

1 Like

@PeteKnight

I am very sorry that my question was confusing to you.

As you know, Events Online and Offline use Event Code which is online and offline, it is similar to Event notify to replace Blynk.email and blynk.notify.

That said, when using Blynk.virtualWrite(V,value), there will probably also be an Event code for this function.
I need it, in order to be able to function Event to view the Timeline for the Virtual pin.

The Chart function was there and I used it, but it didn’t work for me.
The Get Device History Data function is a bit complicated.
The Automation function can be used to send emails and notifications.

Simply put, I want to see in the Timeline section.

Thank you for your interest.

No, Blynk.virtualWrite(vPin, value) writes a value to the virtual pin. It does not create an event.

This is done in SuperChart, by placing your finger on the chart you will see the date/time and value.

That’s not how Blynk is designed to be used.

Pete.

I think, there will be a code like online and offline, to write data to the server. I hope we figure it out.

I have used and understood it, but this function is a bit inconvenient to use. If I can use the Event code for Virtual Pins, I can conveniently view the Notifications section on the App.

I hope the publisher will pay attention to this need to install accordingly.

Thank you, Pete.

I hope not!

Pete.

@nlqt2021 here you go - Log Events - Blynk Documentation

I apologize if my question is unreasonable.

I understand that I can create a new Event, with the event code maybe “Blynkwrite” and put it in the device like this:

[Unformatted code removed by moderator]

My question is, can the event code “Blynkwrite” be a code you designed in the library with a different name and what is its name?

If so, similar to the online and offline event code, I would use the Event function without having to put the Blynk.logEvent code in the device’s firmware.

Thanks.

If you would like to use notification without using any code then I think you should use automation.

No.

1 Like

Hi please I want to know if I can use the same template, device ID and token on different esp32 board but different Virtual pin

Example: first esp32 will take V1-V7 then second esp32 will take V8-V9 and all these board will use the same template and device ID

Because different device with the same template shows the widgets of the first device widgets and is not nice

Using Automation can’t help me see BlynkWrite usage history in Notifications, on the App.
Thanks.

Sorry, I haven’t tried that yet.

Automation works without any code, so you don’t have to put any blynk.logevent in the device firmware as you mentioned.

@nlqt2021 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.

1 Like

Each device should have its own unique Auth token.

Pete.

@Bright_Adinkra you can use Automation to control multiple devices, for example you can use template 1 button to control template 2 light.

Sorry, that was my mistake, I’m a new member. :smiley:
I will try to fix it.