Skip to content

Instantly share code, notes, and snippets.

View nobodyguy's full-sized avatar

Jan nobodyguy

  • ExpertaLabs
  • Brno, Czech Republic
View GitHub Profile
@nobodyguy
nobodyguy / printer_monitor.js
Last active August 14, 2024 02:04
Shelly Plus Plug S script to automatically turn off the plug after 3D printing has finished and cooling delay has elapsed
// This script detects printing start and stop events based on power consumption.
// When the stop event is detected, it waits for 15 minutes to enable printer to cool down and shutdown event is triggered.
let CONFIG = {
cooldownDelay: 15 * 60 * 1000, // 15 minutes
idlePowerMax: 12, // 12 Watts (in reality 7-8W)
};
let cooldownTimer = null;
let printingStarted = false;