Smart Plug Control
O.D.I.N. supports smart plug integration for automatic printer power control and energy consumption tracking. Plugs can be turned on before a job starts and off after a print completes.
Supported Plug Types
| Type | Protocol | Example Devices |
|---|---|---|
| Tasmota (HTTP) | HTTP GET to /cm?cmnd=Power%20On | Sonoff S31, Athom Tasmota plugs, any Tasmota-flashed device |
| Tasmota (MQTT) | MQTT cmnd/{device}/POWER topic | Same devices as above, via MQTT broker |
| Home Assistant | HA REST API — POST /api/services/switch/turn_on | Any HA-integrated smart plug (TP-Link Kasa, IKEA, Shelly, Zigbee plugs) |
Tasmota HTTP requires only a device IP address — no MQTT broker or Home Assistant required. Flash any compatible plug with Tasmota and enter the IP address in O.D.I.N. It is the lowest-friction option for a self-hosted setup.
Setup
Configure a smart plug per printer:
- Go to Settings → Printers → [Printer Name] → Edit
- Scroll to the Smart Plug section
- Select the plug type
- Enter the required fields (see below)
- Click Test Connection to verify the plug responds
- Save
Tasmota HTTP Fields
| Field | Description |
|---|---|
| Plug Type | tasmota_http |
| Plug Host | IP address of the Tasmota device (e.g., 192.168.1.45) |
Tasmota MQTT Fields
| Field | Description |
|---|---|
| Plug Type | tasmota_mqtt |
| MQTT Topic | Base topic for the device (e.g., tasmota/plug01) |
Home Assistant Fields
| Field | Description |
|---|---|
| Plug Type | home_assistant |
| HA URL | Your Home Assistant instance URL (e.g., http://homeassistant.local:8123) |
| HA Token | Long-lived access token from HA user profile |
| Entity ID | The switch entity ID (e.g., switch.printer_plug) |
Manual Control
On any printer card or printer detail view:
- Power On button — turns the plug on immediately
- Power Off button — turns the plug off immediately
- Status indicator — shows current plug state (on/off/unknown)
Manual control requires operator or admin role.
Automation
Auto Power-On Before Dispatch
When the job scheduler dispatches a job to a printer, O.D.I.N. automatically powers on the smart plug before sending the print command. This allows printers to start from cold.
Auto Power-Off After Completion
After a print completes (or is cancelled), O.D.I.N. turns off the smart plug after a configurable cooldown period. The cooldown allows the printer's cooling fans to run and the bed to lower before power is cut.
Configure the cooldown in Settings → Printers → [Printer Name] → Smart Plug → Cooldown (minutes).
Energy Consumption Tracking
When a smart plug is configured and reports wattage data (Tasmota's energy monitoring plugs report live wattage via MQTT), O.D.I.N. calculates:
- kWh per job — wattage × print hours
- Energy cost per job — kWh × electricity rate from pricing config
This data feeds into the Analytics & Reporting energy widget and is stored in the print archive.
See Also
- Adding Printers — printer configuration panel
- Analytics & Reporting — energy consumption reporting