Skip to content

Instantly share code, notes, and snippets.

View letsautomatenet's full-sized avatar

Let's Automate! letsautomatenet

View GitHub Profile
@letsautomatenet
letsautomatenet / switchbot_function_node.txt
Last active June 4, 2024 19:53
Node-Red SwitchBot Authentication Example
// Add module called 'crypto'
const token = msg.token;
const secret = msg.secret;
const t = Date.now();
const nonce = msg.payload;
const data = token + t + nonce;
const signTerm = crypto.createHmac('sha256', secret)
.update(Buffer.from(data, 'utf-8'))
@letsautomatenet
letsautomatenet / ESPHome Example - Binary Sensor.yaml
Created September 5, 2023 12:53
ESPHome Example - Binary Sensor - PIR & Touch Button
substitutions:
variable1: "test1"
esphome:
name: ${variable1}
friendly_name: Test1
esp8266:
board: d1_mini
@letsautomatenet
letsautomatenet / water-sensor-1.yaml
Created September 7, 2023 12:32
Water Sensor - Non-Contact - ESPHome
esphome:
name: water-sensor-1
friendly_name: Water Sensor 1
esp8266:
board: d1_mini
# Enable logging
logger:
@letsautomatenet
letsautomatenet / install_ssh.sh
Last active October 8, 2023 15:40
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
# Install Samba
sudo apt install samba
# Add Share to Samba configuration file
sudo nano /etc/samba/smb.conf
#At the bottom of the file add share details, e.g.
[isos]
comment = PXE Boot ISOs
path = /home/pxe/iventoy-1.0.19/iso
@letsautomatenet
letsautomatenet / Home Assistant Notification Commands.yaml
Created December 6, 2023 11:17
Home Assistant Notification Commands
# Notification Commands - The useful commands are for Android only.
# See this documentation for more information: https://companion.home-assistant.io/docs/notifications/notification-commands
# Pause YouTube
service: notify.mobile_app_marc_phone
data:
message: command_media
data:
media_package_name: com.google.android.youtube
media_command: pause
@letsautomatenet
letsautomatenet / Bluetooth Proxy - Ethernet EST-PoE-32.yaml
Last active December 12, 2023 10:01
Bluetooth Proxy - Ethernet (EST-PoE-32)
esphome:
name: est-poe-32
friendly_name: EST-PoE-32
esp32:
board: esp32dev
framework:
type: esp-idf
# Enable logging
@letsautomatenet
letsautomatenet / BME680 Air Quality Sensor.yaml
Created December 27, 2023 15:24
BME680 Air Quality Sensor
esphome:
name: bme680
friendly_name: Air Quality Sensor
esp8266:
board: d1_mini
# Enable logging
logger:
@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!