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 / creative-stage-se-esphome.yaml
Created October 13, 2024 15:44
IR Transmitter Commands to Control the Creative Stage SE Soundbar using ESPHome
button:
- platform: template
name: "${name} Power"
on_press:
- remote_transmitter.transmit_nec:
address: 0xB683
command: 0xB24D
command_repeats: 1
- platform: template
acme-v01.api.letsencrypt.org
acme-staging.api.letsencrypt.org
acme-v02.api.letsencrypt.org
acme-staging-v02.api.letsencrypt.org
outbound1a.letsencrypt.org
outbound1b.letsencrypt.org
outbound1c.letsencrypt.org
outbound1d.letsencrypt.org
outbound1e.letsencrypt.org
outbound1f.letsencrypt.org
@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 July 30, 2024 21:17
udpbroadcastrelay freebsd service
#!/bin/sh
# How to use:
# Place this file in /usr/local/etc/rc.d/
# Make the file executable: chmod +x /usr/local/etc/rc.d/udpbroadcastrelay2
# 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 November 9, 2024 21:59
z2m_aqara_trv_external_temperature.yaml
blueprint:
name: Aqara TRV E1 External Temperature Control
description: >
This automation allows the Aqara TRV E1 Smart Radiator Thermostat to use temperature readings from an external sensor rather than its internal sensor. Whenever the temperature sensor reports a new value, it is sent to the TRV for more accurate climate control.
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