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 / z2m_aqara_trv_external_temperature.yaml
Last active April 24, 2024 08:25
z2m_aqara_trv_external_temperature.yaml
blueprint:
name: Aqara TRV E1 external temperature
description: >
Configures the Aqara TRV to receive it's temperature from an external sensor.
Every time the temperature sensor value cahnges it's is send to the TRV.
domain: automation
source_url: "https://gist.github.com/pavax/8d6ed250765d89cb281d4a1762b8d2e8"
input:
external_temp_sensor:
name: External temperature sensor
@pavax
pavax / motion_aware_lights.yaml
Last active March 8, 2024 10:33
Home Assistant Motion Aware Lights Blueprint
blueprint:
name: Motion Aware Lights Toggling
description: >
Turn a light on and off based on detected motion but only if certain criteria a matched provided by a Illuminance-Sensor or a Binary-Sensor.
Also allows to disable motion aware lights. This might be useful for example if a person is in the bed or a movie is playing.
domain: automation
source_url: https://gist.github.com/pavax/ce9559c428b9a3c369ce79ef215ef1e2
input:
motion_sensor:
name: Motion Sensor
@pavax
pavax / natpmpc-transmission-update.sh
Last active February 20, 2024 17:03
Bash script to open a port using natpmpc and update the opened port in transmission-daemon
#!/bin/bash
# The gatway to send the natpmp commands
natpmp_ip="10.2.0.1"
# Path to the lock file
lock_file="/tmp/transmission_update.lock"
# Path to the Transmission settings.json file
settings_file="/etc/transmission-daemon/settings.json"
@pavax
pavax / nagging_alert_notification.yaml
Last active February 4, 2024 03:13
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 / udpbroadcastrelay
Last active January 2, 2024 15:14
udpbroadcastrelay freebsd service
#!/bin/sh
# How to use:
# Place this file in /usr/local/etc/rc.d/
# Adjust the command_args to your needs
# Add udpbroadcastrelay_enable="YES" to /etc/rc.config
# Start using the command: service udpbroadcastrelay start
. /etc/rc.subr
blueprint:
name: Illuminance aware cover control
description: >
Close cover based on a illuminance sensor.
Allow manual control to open the cover again, but reactivate the automatic control again after a defined time.
Optionally define state sensors to prevent re-opening again. For Example when a media_player is playing.
domain: automation
source_url: https://gist.github.com/pavax/ed424e1d7bbb1c69b7e33e60d1415b5a
input:
cover_control:
@pavax
pavax / z2m-ikea-remote-controls.yaml
Last active August 1, 2023 15:28
z2m-ikea-remote-controls.yaml
blueprint:
name: "[Z2M] Generic Ikea Remote Control"
description: "Blueprint for Ikea Remote Controls (On/Off, 5-Button, Shortuct)"
domain: automation
source_url: https://community.home-assistant.io/t/zigbee2mqtt-ikea-on-off-switch-general-use/263895
input:
remote:
name: Remote
description: IKEA remote to use (e.g sensor.kitchen_remote_action)
selector:
@pavax
pavax / illuminance_aware_cover_control.yaml
Last active July 28, 2023 10:10
illuminance_aware_cover_control.yaml
blueprint:
name: Illuminance aware cover control
description: >
Close cover based on a illuminance sensor.
Allow manual control to open the cover again, but reactivate the automatic control again after a defined time.
Optional defined state sensors to prevent re-opening again. For Example when a media_player is playing
domain: automation
source_url: https://gist.github.com/pavax/ed424e1d7bbb1c69b7e33e60d1415b5a
input:
cover_control:
@pavax
pavax / cec-tv-status.sh
Last active July 24, 2023 21:49
cec-tv-status.sh
#/bin/bash
if [[ $1 == "turn-on" ]]; then
command=$(echo 'on 0.0.0.0' | cec-client -s -d 1)
elif [[ $1 == "turn-off" ]]; then
command=$(echo 'standby 0.0.0.0' | cec-client -s -d 1)
elif [[ $1 == "status" ]]; then
#command=$(echo 'pow 0.0.0.0' | cec-client -s -d 1)
readarray -t lines < <(echo 'pow 0.0.0.0' | cec-client -s -d 1)
<?php
/**
* HOW-TO INSTALL
* - Download and edit the DEFINE-ME variables in this file
* - Upload the file to your server (for example into your WordPress installation directory)
* - Go to the Amelia Settings Page and click on Integrations.
* - Go to the "Webhooks" Tab
*
* URL: Provide your URL that matches to where you uploaded this php file on your server.