Skip to content

Instantly share code, notes, and snippets.

View alanaasmaa's full-sized avatar
🎯
Focusing

Alan Aasmaa alanaasmaa

🎯
Focusing
View GitHub Profile
@alanaasmaa
alanaasmaa / shelly-fail-safe.md
Last active November 24, 2025 08:47
Shelly Fail‑Safe Detached Mode: Gen2/Gen3 Script That Auto‑Flips Gen1 (Shelly 2.5) Between Detached and Toggle When Home Assistant Is Down

Shelly Fail‑Safe Detached Mode: Gen2/Gen3 Script That Auto‑Flips Gen1 (Shelly 2.5) Between Detached and Toggle When Home Assistant Is Down

A lightweight, on‑device script for Shelly Plus/Gen2/Gen3 that pings Home Assistant and automatically:

  • Keeps smart‑bulb circuits in detached mode when HA is healthy.
  • Switches Shelly Gen1 (e.g., Shelly 2.5) to toggle/edge for direct wall‑switch control when HA is down.
  • Optionally flips the hosting Gen2/3 device’s input mode to ensure local control even with LAN/WAN outages.

This provides a guest‑proof, local‑first, no‑cloud fallback so lights still work from the wall switch during server, automation, or network failures.

// LAUNCH OPTIONS
-novid -tickrate 128 -threads 8 -high -nojoy +cl_forcepreload 1 -noforcemaccel -language bananagaming +exec autoexec
//
//
//BINDS
bind alt "use weapon_c4;drop"
bind v "use weapon_knife;use weapon_incgrenade; use weapon_molotov"
bind t "use weapon_knife;use weapon_smokegrenade"
bind c "use weapon_knife;use weapon_hegrenade"