Skip to content

Instantly share code, notes, and snippets.

@blindguynar
blindguynar / gist:d68b71aa45a7aad6ac37837b09b3837d
Created January 12, 2026 17:39
NWS weather alert automation
alias: "Alert: NWS - Benton County Severity Based Actions"
description: ""
triggers:
- trigger: state
entity_id:
- sensor.nws_alerts_benton_county_alerts
conditions: []
actions:
- variables:
first_alert: >
@blindguynar
blindguynar / gist:a69f86b8afc8c94743765e166feef18d
Created February 10, 2025 00:21
Dimmer Automation Example
alias: "Light: Living Room Lights Dimmer"
description: ""
mode: queued
max: 10
triggers:
- trigger: state
entity_id:
- sensor.living_room_ceiling_lights_dimmer
attribute: action
id: Adjustment
@blindguynar
blindguynar / ha_watchdog_too.js
Created November 19, 2024 22:21
Script to run on Shelly Device to monitor HA endpoint to switch from detached mode to flipped mode upon inability to connect to HA.
let switchId = 1;
let hookId = 5;
let checkPeriod = 60 * 1000; // in ms
let haUrl = 'http://192.168.0.248: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");
@blindguynar
blindguynar / shelly_update_automation.txt
Last active February 23, 2024 18:51
automated shelly FW updates
alias: "Update: Shelly Devices"
description: ""
trigger:
- platform: template
value_template: >-
{{ integration_entities('shelly') | select('match', '^update.') |
select('is_state', 'on') | list | count > 0 }}
condition: []
action:
- repeat:
@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 } });