HomeOps

Modular Widget System and Custom Panels

The HomeOps dashboard is not a fixed interface with predetermined layouts. It is a modular canvas where widgets serve as the building blocks for your personalized smart home control center. Each widget connects to one or more MQTT topics and presents data or controls in a specific visual format. From simple toggles to complex multi-series charts, the widget system provides the tools to build exactly the dashboard you need. This post explores the built-in widget types, the process for creating custom widgets, the layout grid system, and how data binding connects everything to your devices.

Built-In Widget Types

HomeOps includes a comprehensive library of widget types that cover the most common smart home display and control needs. The gauge widget displays a single numeric value on a radial or linear gauge, ideal for temperature, humidity, power draw, and other continuous measurements. Gauges support configurable min and max ranges, color zones that change as values enter warning or critical thresholds, and a numeric readout showing the exact value alongside the graphical indicator.

The chart widget plots time-series data as line graphs, bar charts, or area charts. It can display multiple data series on the same axes, which is useful for comparing indoor and outdoor temperatures or overlaying power consumption from different circuits. Charts support configurable time windows from the last hour to the last month, auto-scaling axes, and interactive tooltips that show exact values when you hover over data points. The data feeding the chart comes directly from MQTT messages and is buffered locally in the browser for smooth rendering.

Control widgets include the toggle for on/off devices, the slider for continuous adjustments like dimming and volume, the button for triggering one-shot actions, and the select dropdown for choosing between predefined states or modes. Each control widget publishes an MQTT message when interacted with and listens for state confirmations to update its visual state. This bidirectional binding ensures the widget always reflects the actual device state, even when the device is controlled from another source like a physical switch or a voice command.

Specialized widgets include the camera feed widget that displays an MJPEG or snapshot stream from a local IP camera, the thermostat widget that combines temperature display with heating and cooling mode controls, and the weather widget that aggregates multiple weather sensor readings into a compact panel. Each specialized widget is essentially a pre-configured composite of simpler widget elements, packaged for convenience.

Creating Custom Widgets and Data Binding

When the built-in widgets do not match your specific needs, the custom widget system lets you build your own. A custom widget is defined as an HTML template with data binding expressions that reference MQTT topics. The template uses a simple syntax to insert live values: {{topic:homeops/sensor/temp}} inserts the current value of that topic wherever it appears in the HTML. You can use standard HTML and CSS to create any visual presentation, from simple text displays to complex SVG-based diagrams.

Data binding in HomeOps is reactive. When an MQTT message arrives on a bound topic, the widget re-renders the affected elements automatically. Bindings support transformations through a pipe syntax: {{topic:homeops/sensor/temp | round:1 | suffix:"F"}} rounds the value to one decimal place and appends a unit label. Available transformations include mathematical operations, string formatting, conditional display (show or hide elements based on value thresholds), and color mapping that changes an element's color based on the bound value.

For more complex custom widgets that need logic beyond simple data binding, HomeOps supports a JavaScript widget API. The API provides hooks for initialization, data updates, user interactions, and cleanup. You can use the API to create widgets with animated visualizations, interactive floor plans where rooms change color based on occupancy or temperature, or integration panels that aggregate data from multiple devices into a single coherent view. Custom JavaScript widgets run in sandboxed iframes for security and performance isolation.

Layout Grid System and Widget Marketplace

The dashboard layout uses a responsive CSS grid with 12 columns on desktop. Each widget occupies a configurable number of columns and rows. Small widgets like toggles and gauges typically span 2 to 3 columns, medium widgets like charts span 4 to 6 columns, and large widgets like camera feeds or floor plan views can span the full 12 columns. Row heights auto-adjust to the widget content, though you can set fixed heights for a more uniform appearance.

The grid supports drag-and-drop rearrangement in edit mode. Widgets snap to grid cells as you drag them, and other widgets reflow automatically to accommodate the new position. You can also set per-breakpoint layouts, so a widget that spans 6 columns on desktop might span the full width on a phone. The layout editor provides a preview mode for each breakpoint so you can verify the arrangement at different screen sizes without leaving the desktop browser.

The widget marketplace is a community-driven repository where users share custom widget templates. You can browse the marketplace from within the HomeOps dashboard, preview widgets, and install them with a single click. Installed widgets appear in your widget palette alongside the built-in types. Popular marketplace widgets include floor plan visualizers, energy cost calculators, irrigation controllers, and retro-styled analog gauges. Contributing your own widgets to the marketplace involves packaging the HTML template, CSS, and optional JavaScript into a standard widget bundle format and uploading it through the dashboard.

Tip: Start with the built-in widgets and customize their appearance through the style settings before building custom widgets from scratch. Most dashboard needs can be met by adjusting colors, labels, ranges, and sizes on the standard widget types.

What's Next

The widget system is the visual layer that makes HomeOps accessible and useful on a daily basis. With the right combination of widgets, your dashboard becomes a single-glance summary of your entire home's status and a one-touch control panel for every device. The next post addresses network isolation and local-first security, covering VLAN configuration, encrypted MQTT, firewall strategies, and the privacy advantages of keeping your smart home data entirely on your own network.

Back to Blog