Skip to main content

Image Widget

👁 Display

The Image widget renders a still image or MJPEG video stream from a URL sent by the device. Perfect for IP cameras, ESP32-CAM streams, preview snapshots, or any web-accessible image URL.

Default size: 3 × 3 grid cells


Configuration

PropertyTypeDefaultDescription
fitcontain | cover | fillcontainImage scaling mode
refreshIntervalnumber0Auto-refresh interval in seconds (0 = disabled, use for stills)
DevicedeviceThe device to read from
PinV0V255The virtual pin providing the URL
LabelstringWidget label

Pin value format

The device sends an image URL as a string:

"http://192.168.1.105:81/stream"     ← MJPEG stream
"http://192.168.1.105/capture" ← JPEG snapshot
"https://cdn.example.com/thumb.jpg" ← Static image

Firmware examples

ESP32-CAM MJPEG stream

#include "esp_camera.h"
#include <WebServer.h>

WebServer server(81);

void startCameraServer() {
server.on("/stream", HTTP_GET, handleStream);
server.begin();
}

void loop() {
Vwire.run();
server.handleClient();

// Push URL once on connect, or periodically
char url[64];
snprintf(url, sizeof(url), "http://%s:81/stream", WiFi.localIP().toString().c_str());
Vwire.virtualSend(V0, url);

delay(30000); // re-announce URL every 30 s
}

Snapshot with refresh

void loop() {
Vwire.run();

// Push snapshot URL; use refreshInterval in widget settings to auto-reload
char url[64];
snprintf(url, sizeof(url), "http://%s/capture?t=%lu",
WiFi.localIP().toString().c_str(), millis());
Vwire.virtualSend(V0, url);

delay(5000); // match widget refreshInterval
}

Notes

LAN-only streams

MJPEG streams from ESP32-CAM are typically LAN-only (192.168.x.x). The Image widget must be viewed on the same network as the device, or you must expose the stream via a reverse proxy / tunnel.

Object fit

Use cover to fill the widget cell edge-to-edge (may crop). Use contain to see the full image with letterboxing.