Skip to content

Instantly share code, notes, and snippets.

View mehstg's full-sized avatar

Paul Braham mehstg

View GitHub Profile
@mehstg
mehstg / gist:30880a27bcc24ad0437f0aea79127388
Created November 18, 2023 21:48
Dimplex Optymist ESP8266 ESPHome
esphome:
name: cabin-fireplace
platform: ESP8266
board: d1_mini_lite
# Enable logging
logger:
# Enable Home Assistant API
api:
@mehstg
mehstg / automation.yaml
Created February 2, 2023 21:29
Home Assistant automation - Pause battery discharge when car is charging in Octopus Intelligent slot
alias: "Battery: Intelligent Octopus pause GivEnergy whilst charging"
description: "Whilst in an Octopus Intelligent slot, and EV is charging, disable discharge on GivEnergy inverter"
trigger:
- platform: state
entity_id:
- binary_sensor.octopus_intelligent_slot
- platform: numeric_state
entity_id: sensor.wallbox_portal_charging_power
above: 0.1
condition: []
@mehstg
mehstg / wg_mqtt_exporter.sh
Last active March 14, 2025 09:51
Wireguard CLI to MQTT Bash Script - For getting Wireguard information in to Home Assistant MQTT sensors
# A script to pull information from the Wireguard CLI and redirect to a MQTT Broker
# Based on the original script written by valvex - https://community.home-assistant.io/t/send-wireguard-client-info-to-ha-with-mqtt-template-sensor-to-show-active-clients/259532
# Paul Braham 2022
#!/bin/bash
CONF_FILE="/etc/wireguard/wg0.conf"
MQTT_IP="192.168.1.200"
MQTT_USERNAME="mqttuser"
MQTT_PASSWORD="mqttpass"
# apiVersion: v1
# kind: Namespace
# metadata:
# name: homeassistant
---
apiVersion: v1
kind: Service
metadata:
namespace: homeassistant
name: homeassistant-mysql
-/+ module.cognito.aws_cognito_user_pool.pool (new resource required)
id: "eu-west-1_wkghCiMhd" => <computed> (forces new resource)
admin_create_user_config.#: "1" => <computed>
arn: "arn:aws:cognito-idp:eu-west-1:600395332734:userpool/eu-west-1_wkghCiMhd" => <computed>
auto_verified_attributes.#: "1" => "1"
auto_verified_attributes.881205744: "email" => "email"
creation_date: "2019-06-05T12:14:15Z" => <computed>
email_verification_message: "" => <computed>
email_verification_subject: "" => <computed>
endpoint: "cognito-idp.eu-west-1.amazonaws.com/eu-west-1_wkghCiMhd" => <computed>
@mehstg
mehstg / launch-config.sh
Created May 10, 2019 09:10
AWS Launch Config Tee to file
#!/bin/bash -xe
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1