Skip to content

Instantly share code, notes, and snippets.

View pavax's full-sized avatar

Patrick D. pavax

  • schaltstelle
  • Bern, Switzerland
View GitHub Profile
@pavax
pavax / nagging_alert_notification.yaml
Last active November 24, 2025 17:04
Home Assistant Alert Notification Blueprint
blueprint:
name: Nagging Alerting Notification Automation
description: >
Trigger an alert based on the state of a given sensor.
The Alert is send to a mobile app device and repeats as long as the sensor is in the given state.
An additonal action can be specified. This might be useful to tts the message.
domain: automation
source_url: https://gist.github.com/pavax/08705e383bdd3b58ea7b75a1f01c7e54
input:
sensor_entity:
@pavax
pavax / motion_aware_lights.yaml
Last active April 6, 2025 22:20
Home Assistant Motion Aware Lights Blueprint
blueprint:
name: Motion-Aware Light Control
description: >
Automatically controls lights based on motion detection, with optional conditions for illuminance and binary sensors.
The automation can be disabled using binary sensors (e.g., sleep mode or movie watching) to prevent lights from turning on under certain conditions.
Additionally, if the lights were already turned on and motion is detected, the automation will wait for the motion detection to clear before turning off the lights.
domain: automation
source_url: https://gist.github.com/pavax/ce9559c428b9a3c369ce79ef215ef1e2
homeassistant:
@pavax
pavax / SvgFixingDirective.ts
Last active November 10, 2019 07:28
Fixing fontawesome SVG mask, clip-path and fill url() values for the safari browser when using a base-href
import { AfterViewInit, Directive, ElementRef, Inject } from '@angular/core';
import { AbstractSubscriber } from '../../core/abstract-subscriber';
import { filter, startWith, takeUntil } from 'rxjs/operators';
import { NavigationEnd, Router } from '@angular/router';
import { APP_BASE_HREF, Location } from '@angular/common';
function isSafariBrowser() {
return navigator.vendor && navigator.vendor.indexOf('Apple') > -1 &&
navigator.userAgent &&
navigator.userAgent.indexOf('CriOS') === -1 &&
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="no" omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()">