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 / 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 / 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
@pavax
pavax / z2m_aqara_trv_external_temperature.yaml
Last active March 21, 2024 12:17
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 / 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.
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 / window_aware_lights_control.yaml
Last active August 18, 2021 12:57
Window aware light control
blueprint:
name: Window aware light control
description: >
Turn off the active lights when a window is opened.
As soon as the window is closed, turn them on again.
domain: automation
source_url: https://gist.github.com/pavax/6afcd0eee7c990c456b99dd52680b4b0
input:
window_sensor_entity:
name: Window Sensor Entity
@pavax
pavax / window_aware_lights_control.yaml
Last active June 21, 2021 18:45
window_aware_lights_control.yaml
blueprint:
name: Window aware Light control
description: >
Turn off the active lights when a window is opened.
As soon as the window is closed, turn them on again.
domain: automation
source_url: https://gist.github.com/pavax/TBD
input:
window_sensor_entity:
name: Window Sensor Entity
blueprint:
name: Turn off entity after a while
description: >
Turn off entity after a period of time
domain: automation
source_url: "https://gist.github.com/pavax/4eb086412c1e455a26da4dc64673b3b9"
input:
target_entity:
name: target_entity
description: "The entity to turn off after a while."