Skip to content

Instantly share code, notes, and snippets.

View greghesp's full-sized avatar
🖐️

Greg Hesp greghesp

🖐️
View GitHub Profile
substitutions:
room_name: 'Living Room'
device_name: 'living-room-esp32'
friendly_name: 'Living Room ESP32'
description: 'Living Room Touch LCD with MQTT Room, Glucose Levels and Fireplace Temperature'
static_ip: 192.168.1.25
esp32:
board: esp32dev
framework:
@greghesp
greghesp / device.yml
Created November 12, 2024 19:07
Lambda Function for BT Beacon to MQTT Broadcast for Home Assistant mqtt_room
- lambda: |-
if (x.get_ibeacon().has_value()) {
std::string uuid;
esp_bt_uuid_t raw_uuid = x.get_ibeacon().value().get_uuid().get_uuid();
char sbuf[64];
char *bpos = sbuf;
switch (raw_uuid.len) {
case ESP_UUID_LEN_128:
for (int8_t i = 0; i <= 15; i++) {
sprintf(bpos, "%02x", raw_uuid.uuid.uuid128[i]);
esphome:
name: master-bedroom-oled-display
comment: Bedroom OLED with Glucose Levels
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
esphome:
name: dressing-room-esp32
esp32:
board: mhetesp32minikit
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
esphome:
name: living-room-display
esp8266:
board: d1_mini
# Enable logging
logger:
level: DEBUG
@greghesp
greghesp / esphome_ble_config.yaml
Last active May 26, 2023 18:01 — forked from kmdm/esphome_ble_config.yaml
esphome, esp32 ble tracker and Home Assistant mqtt_room sensors
# MQTT broker configuration
mqtt:
broker: !secret mqtt_broker
username: !secret mqtt_username
password: !secret mqtt_password
discovery: False # Only if you use the HA API usually
id: mqtt_client
# Define the room for this ESP32 node
substitutions:
@greghesp
greghesp / nodered
Created January 4, 2022 11:11
Node Red Error Handling Flow
[{"id":"9c2bbc33.ea38a8","type":"tab","label":"Error Handling","disabled":false,"info":""},{"id":"c5d148b4.60be08","type":"component_in","z":"9c2bbc33.ea38a8","name":"Error Handling","api":[{"name":"error","type":"any","required":false},{"name":"title","type":"string","required":false}],"x":130,"y":80,"wires":[["48d15bee.5c8144"]]},{"id":"fd5aeffe.53525","type":"file","z":"9c2bbc33.ea38a8","name":"Exception Log","filename":"/share/logs/node-red-exceptions.log","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":540,"y":60,"wires":[[]]},{"id":"751e1c04.0448a4","type":"debug","z":"9c2bbc33.ea38a8","name":"Errors","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":530,"y":120,"wires":[]},{"id":"48d15bee.5c8144","type":"function","z":"9c2bbc33.ea38a8","name":"Format","func":"let error = msg.error;\nlet title = msg.title;\nlet device = msg.topic;\n\nif(msg.topic == \"/config/home-assistant.log\
@greghesp
greghesp / ColorLoop.json
Last active January 7, 2022 15:03
RGB Colour loop for a Home Assistant Light
[{"id":"ec22fd2d9a498086","type":"tab","label":"Color Loop","disabled":false,"info":"","env":[]},{"id":"5c960d526cfff1b2","type":"link in","z":"ec22fd2d9a498086","name":"","links":["dd2114c718df4892","5085829335ba248c","ac68dbc399f99fd1","f23f2d6854efbe20","2764c38f9e14979d"],"x":115,"y":60,"wires":[["8e09f9d06493bcb6"]]},{"id":"651e1d7c5572c654","type":"link out","z":"ec22fd2d9a498086","name":"","mode":"return","links":[],"x":1195,"y":60,"wires":[]},{"id":"8e09f9d06493bcb6","type":"change","z":"ec22fd2d9a498086","name":"Store RGB Color","rules":[{"t":"set","p":"status","pt":"flow","to":"status","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":60,"wires":[["c15001e6c435dbed"]]},{"id":"c15001e6c435dbed","type":"function","z":"ec22fd2d9a498086","name":"Set Flow Var","func":"if(!msg.entity) {\n node.status({\n text: 'No Light defined',\n shape: 'ring',\n fill: 'red'\n });\n return; \n}\n\nflow.set(\"i\", 0);\n\nreturn msg;","outputs":1,"noerr":0,"
@greghesp
greghesp / tailwind-flex-wrap-row-space.html
Last active December 24, 2022 19:36
Tailwind Flex Wrap with Row spacing
// Apply negative value to the items you want to add to each child
// In this example, the first row and last items to the right will have the overlap the negative values to create the effect of them not being there
<div class="flex flex-wrap -mt-2 -mr-2">
// forEach, map etc
// Apply a positive value to the items you want to add to each child.
<div class="mt-2 mr-2">Loop Item</div>
</div>
@greghesp
greghesp / update_notification.yaml
Last active March 25, 2021 22:29
Home Assistant Update Notification for Android
blueprint:
name: Home Assistant Update Notification for Android
description: Send a notification when there's an update available for Home Assistant
domain: automation
input:
updater:
name: Update sensor
description: "The sensor which indicates if there's an update. Default is 'binary_sensor.updater'"
default: binary_sensor.updater
selector: