Skip to main content

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

TypeProtocolExample Devices
Tasmota (HTTP)HTTP GET to /cm?cmnd=Power%20OnSonoff S31, Athom Tasmota plugs, any Tasmota-flashed device
Tasmota (MQTT)MQTT cmnd/{device}/POWER topicSame devices as above, via MQTT broker
Home AssistantHA REST API — POST /api/services/switch/turn_onAny HA-integrated smart plug (TP-Link Kasa, IKEA, Shelly, Zigbee plugs)
Tasmota Is the Easiest Integration

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:

  1. Go to Settings → Printers → [Printer Name] → Edit
  2. Scroll to the Smart Plug section
  3. Select the plug type
  4. Enter the required fields (see below)
  5. Click Test Connection to verify the plug responds
  6. Save

Tasmota HTTP Fields

FieldDescription
Plug Typetasmota_http
Plug HostIP address of the Tasmota device (e.g., 192.168.1.45)

Tasmota MQTT Fields

FieldDescription
Plug Typetasmota_mqtt
MQTT TopicBase topic for the device (e.g., tasmota/plug01)

Home Assistant Fields

FieldDescription
Plug Typehome_assistant
HA URLYour Home Assistant instance URL (e.g., http://homeassistant.local:8123)
HA TokenLong-lived access token from HA user profile
Entity IDThe 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