Blynk Custom HTML Dashboards: Build the Whole Device Page in Code

Blynk.Console templates now have a Custom HTML dashboard layout. One HTML file you write replaces the device header, tabs and widget grid, running on the same BlynkBridge API as the HTML Widget.

Published

Author

Blynk.Console templates now have a second dashboard layout, Custom HTML. The whole device page is one HTML file you write, with your own header, layout and navigation, running on the same BlynkBridge API as the HTML Widget.

‍

Read on to see how to switch a template to it, when to use it instead of an HTML Widget, and an example page for a farm sensor.

What’s new on the device page

Every template on a paid plan now has a Dashboard Layout setting with two options. Default is the device page you know: the device header, tabs and widgets. Custom HTML is a full page built in code. To switch, open the Dashboard section of the template, pick Custom HTML from the Layout dropdown next to the dashboard title, and save. On an empty dashboard there’s also a Switch to Custom HTML button.

‍

The canvas then shows No HTML code yet and an Add HTML Code button. You can start from scratch with a starter document that already creates the BlynkBridge connection, or from a preset. The editor is the same one the HTML Widget uses, with a live preview, a light/dark toggle, a console and a Testing tab against a real device. The page is saved as a file in Assets › Widget Library › My Widgets.

‍

Once a page is in place, the canvas shows it with Edit, Replace File and Clear buttons. Edit opens the dashboard settings, where you also choose which datastreams the page can use: Specific datastreams, or All datastreams of the template. With all of them, your code references each datastream by name or ID, for example bridge.getValue({ id: 40 }) or bridge.sendValue({ name: 'Temperature' }, '23.5').

‍

In this layout your code owns the page, so the header settings are hidden and the dashboard tabs aren’t shown. Anything users need from them, like the device name and status or a way to move between views, goes into your page. Device actions are still there: the device actions toolbox moves to the left side menu, next to the selected device in the device list.

‍

Switching keeps both layouts. Nothing is deleted. Switching back to Default restores your Widgets and tabs.

‍

Default, HTML Widget or Custom HTML

Your situation Use
The standard widgets cover what you need Default layout with the low-code widget set
You need one thing the gallery doesn’t have, like a branded gauge or a panel that combines several readings An HTML Widget inside the Default layout
The whole device page should look and behave like your product, including the header and navigation Custom HTML layout

‍

With Custom HTML you build the header and navigation yourself, so it fits best when the device page is part of what you sell.

What the page can use

A Custom HTML page runs on the same BlynkBridge API as the HTML Widget, and the bridge has grown a fair bit since the widget launched. From the page you can:

  • read and write datastream values, and get live updates as new data arrives
  • fetch historical data and map data
  • read device info, the device image and tags, and read and update device metadata
  • list and upload device files, and read assets
  • list events, add comments and notes, and resolve or archive events
  • run Data Engine queries
  • check the current user’s permissions
  • open native screens like device info, events and automations
  • pick up the theme colors and fonts, including light/dark switches and your organization’s branding

The developer guide has the full reference.

‍

Custom HTML is a layout for the Blynk web console. In the Blynk app, the closest equivalent is an HTML Widget, with the header elements you don’t need hidden in Header Design. The page runs in a sandboxed iframe that can’t call outside servers, so all data comes through the bridge.

‍

Example: a device page for a smart lamp

We built an example page for a smart lamp with power, brightness and color temperature controls. The device behind it could be an ESP32 board driving a dimmable LED.

‍

‍

The top of the page replaces the standard header. It shows the device name, online status and last report from getDeviceInfo(), and an Ambience card with a short summary such as "Lights on · Neutral white at 69%". The Device info, Timeline and Automations buttons are part of the page, since the console doesn't show its own header in this layout.

‍

The page has a card each for power, brightness and color temperature, and a History section underneath with the last month from getHistoricalData. The Scenes row sets brightness and color temperature in one tap, with sendValue:

‍

const bridge = new BlynkBridge();

const scenes = {
  candle:   { kelvin: 2200, brightness: 15 },
  cosy:     { kelvin: 2700, brightness: 40 },
  reading:  { kelvin: 4000, brightness: 80 },
  daylight: { kelvin: 6000, brightness: 100 },
};

function setScene(key) {
  const scene = scenes[key];
  try {
    bridge.sendValue({ name: 'Color Temperature' }, String(scene.kelvin));
    bridge.sendValue({ name: 'Brightness' }, String(scene.brightness));
  } catch (e) {
    // a name didn't match any datastream; it's already reported through onError
  }
}

‍

There’s no delivery confirmation, so the page shows the new state straight away and the next update from the device confirms it.

Let AI build the page for you

You don't have to write a page like this by hand. Our blynk-html-widget Agent Skill for AI coding tools, available from the HTML Widget Developer Guide, includes the BlynkBridge reference and Blynk's visual style, and can build anything from a single tile to a whole page. Paste the result into the Custom HTML editor and check it on the Testing tab against a real device.

‍

Try it on your own template

If you have a template you use for testing, switch its dashboard to Custom HTML, add the starter code or a generated page, and test it against one of your devices. You can switch back to Default at any time. The Dashboard Layout docs cover each setting, and pricing lists the paid plans.

Sign up for a newsletter
Get latest news from Blynk
Over 500,000 people already signed up our newsletter.
We never spam.
Thank you!
Your submission has been received.
Oops! Something went wrong while submitting the form.