Skip to content

Instantly share code, notes, and snippets.

View mdehaas's full-sized avatar

Marcel de Haas mdehaas

View GitHub Profile
@blindguynar
blindguynar / ha_watchdog.js
Last active February 4, 2026 13:30
Shelly Script
let switchId = 1;
let checkPeriod = 60 * 1000; // in ms
let haUrl = 'http://192.168.50.10:8123';
let mode = "detached"; // Could be "detached", "flip", "follow" or "momentary". Use "detached" when HA is in control
function updateConfig(oldConfig) {
//Apply the new config only if the switch is not already working in the desired mode
if (oldConfig.in_mode !== mode) {
print("switching it up");
Shelly.call("Switch.SetConfig", { id: switchId, config: { in_mode: mode } });
@AdamNaj
AdamNaj / about.md
Last active March 12, 2025 21:47
Z Wave Graph for Home Assistant