Skip to main content

Icon Status Widget

👁 Display

The Icon Status widget maps discrete values received from a device to icons and colors. Instead of showing a raw number, you see a meaningful icon: a battery icon for charge levels, a thermometer for temperature zones, a lock/unlock icon for door state.

Default size: 2 × 2 grid cells


Configuration

PropertyTypeDefaultDescription
mappings{value, icon, color, label}[]See belowOrdered list of value → icon mappings
defaultIconstringhelp-circleIcon shown when value matches no mapping
defaultColorhex color#6B7280Color for the default/unmatched state
DevicedeviceThe device to read from
PinV0V255The virtual pin to display
LabelstringWidget label

Mapping schema

Each entry in mappings:

FieldTypeDescription
valuestringThe pin value to match (exact)
iconstringLucide icon name
colorhexIcon / background color
labelstringCaption below the icon

Example: door lock

[
{ "value": "1", "icon": "lock", "color": "#10B981", "label": "Locked" },
{ "value": "0", "icon": "lock-open", "color": "#EF4444", "label": "Unlocked" },
{ "value": "error","icon": "alert-triangle","color": "#F59E0B", "label": "Error" }
]

Example: battery level

[
{ "value": "full", "icon": "battery-full", "color": "#10B981", "label": "Full" },
{ "value": "medium", "icon": "battery-medium", "color": "#F59E0B", "label": "Medium" },
{ "value": "low", "icon": "battery-low", "color": "#EF4444", "label": "Low" },
{ "value": "charging","icon": "battery-charging", "color": "#6366F1", "label": "Charging"}
]

Firmware example

void loop() {
Vwire.run();

int battMv = analogRead(BATT_PIN) * 4890 / 1023; // mV
String state;
if (battMv > 4000) state = "full";
else if (battMv > 3500) state = "medium";
else if (battMv > 3200) state = "low";
else state = "charging";

Vwire.virtualSend(V0, state);
delay(30000);
}