Skip to content

Instantly share code, notes, and snippets.

View letsautomatenet's full-sized avatar

Let's Automate! letsautomatenet

View GitHub Profile
@letsautomatenet
letsautomatenet / esphome_install.sh
Last active December 17, 2025 10:27
ESPHome Install - Ubuntu
#!/bin/bash
# If you're having difficulty running this file then ensure the file has execute permissions
# chmod 755 esphome_install.sh
# To run the script type:
# sudo ./esphome_install.sh
### START - Install Docker ###
# Remove any old docker files
@letsautomatenet
letsautomatenet / create_zone_script.yaml
Last active December 1, 2025 17:46
Create Zone of current phone location
# Create this script and then add a card to the dashboard linking to the script
alias: Add New Zone
sequence:
- service: zone.create
metadata: {}
data:
radius: "{{radius|default(100)}}"
name: "{{zone_name}}"
latitude: "{{ state_attr('device_tracker.marc_phone','latitude') }}"
longitude: "{{ state_attr('device_tracker.marc_phone','longitude') }}"
@letsautomatenet
letsautomatenet / sonoff_swv_liters_per_minute.jinja
Last active December 1, 2025 17:45
Sonoff SWV - Liters Per Minute
# Create a Template Sensor in Home Assistant to show Liters Per Minute (L/m) instead of Meters Cubed Per Hour (m³/h)
# Set "Unit of Measurement" to "L/min" and "Device Class" to "Volume FLow Rate"
{{ (states('sensor.front_garden_sprinklers_flow') | float * 1000 / 60) | round(2) }}
# Topic: zigbee2mqtt/Name of Device Here/set
# MQTT Payload
# This example releases 5 liters of water, once and then turns off
{
"cyclic_quantitative_irrigation": {
"total_number": 1,
"irrigation_capacity": 5,
"irrigation_interval": 0
@letsautomatenet
letsautomatenet / car-seat-sensor_est-poe-32.yaml
Created January 31, 2024 14:12
Car Seat Sensor - EST-PoE-32
### START - Update this section with relevant details ###
substitutions:
device_name: "device-name-here"
friendly_name: Device Name Here
board_type: esp32dev
framework: esp-idf # arduino or esp-idf (recommended for ESP32)
# ESPHome API used by Home Assistant, etc
@letsautomatenet
letsautomatenet / ESPHome YAML Template - ESP32.yaml
Created January 13, 2024 18:32
ESPHome YAML Template - ESP32
### START - Update this section with relevant details ###
substitutions:
device_name: "device-name-here"
friendly_name: Device Name Here
board_type: esp32dev
framework: esp-idf # arduino or esp-idf (recommended for ESP32)
# ESPHome API used by Home Assistant, etc
@letsautomatenet
letsautomatenet / switchbot_hub3_buttons_automation.yaml
Created July 27, 2025 12:54
SwitchBot - Hub 3 - Buttons - Example Automation
# The useful bit of this automation is the condition which stops false triggering of the automation.
# There are occasions whereby the button might go unavailable and you don't want that treated as a button press
alias: SwitchBot - Hub 3 - Buttons
description: ""
triggers:
- trigger: state
entity_id:
- event.hub_3_button_1_button
id: button1
- trigger: state
@letsautomatenet
letsautomatenet / install_ssh.sh
Last active September 21, 2025 05:58
Install SSH
# Always good to update things first
sudo apt-get update
sudo apt-get upgrade
# Install SSH
sudo apt-get install openssh-server
# Enable Service
sudo systemctl enable ssh
# Allow through Firewall
sudo ufw allow ssh
@letsautomatenet
letsautomatenet / iventoy_setup.sh
Created October 8, 2023 15:39
iVentoy Related Commands
# Start iVentoy web interface for first time
sudo bash iventoy.sh start
# Start iVentoy Web interface and service (no need to press green button)
sudo bash iventoy.sh -R start
# Transfer ISO image from local machine to PXE Boot Server
scp thefilename.iso username@ipaddress:/isopath
# Create symbolic link so that ISOs can be saved somewhere else but seen by iVentoy
# iVentoy needs to see ISOs in the "iso" folder
@letsautomatenet
letsautomatenet / ESPHome YAML Template - ESP8266.yaml
Created January 13, 2024 18:30
ESPHome YAML Template - ESP8266
### START - Update this section with relevant details ###
substitutions:
device_name: "device-name-here"
friendly_name: Device Name Here
board_type: d1_mini
# ESPHome API used by Home Assistant, etc
# If you go to this page it generates one for you automatically!