Icon Status Widget
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
| Property | Type | Default | Description |
|---|---|---|---|
mappings | {value, icon, color, label}[] | See below | Ordered list of value → icon mappings |
defaultIcon | string | help-circle | Icon shown when value matches no mapping |
defaultColor | hex color | #6B7280 | Color for the default/unmatched state |
| Device | device | — | The device to read from |
| Pin | V0–V255 | — | The virtual pin to display |
| Label | string | — | Widget label |
Mapping schema
Each entry in mappings:
| Field | Type | Description |
|---|---|---|
value | string | The pin value to match (exact) |
icon | string | Lucide icon name |
color | hex | Icon / background color |
label | string | Caption 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);
}