Skip to content

Instantly share code, notes, and snippets.

View Resinchem's full-sized avatar

Resinchem

View GitHub Profile
@Resinchem
Resinchem / mqtt_discovery.cpp
Last active August 11, 2024 07:48
Sample Arduino code for publishing devices using Home Assistant MQTT Discovery. See the following for use case: https://youtu.be/VHiCtZqllU8 or https://resinchemtech.blogspot.com/2023/12/mqtt-auto-discovery.html
/* ===================================================================
SAMPLE CODE Segments for Home Assistant MQTT Discovery
This is NOT complete code but shows an example of generating a unique ID
for topic/entity publishing based on the device MAC address.
It also includes sample code for creating a Home Assistant device with four
entities via MQTT Discovery, as shown here:
Video: https://youtu.be/VHiCtZqllU8
Blog: https://resinchemtech.blogspot.com/2023/12/mqtt-auto-discovery.html
It is highly recommended that you include some sort of end-user accessible setting to
@Resinchem
Resinchem / analog-clock-leds.yaml
Last active July 28, 2024 12:54
ESPHome Code for MCP23017 Port Expander breadboard test as shown in the YouTube video: https://youtu.be/GyHiSyoyk_0
# ===============================================================
# Code used in the breadboard test for the MCP23017 Port Expander
# as shown in this YouTube Video: https://youtu.be/GyHiSyoyk_0
# ===============================================================
esphome:
name: analog-clock-leds
friendly_name: analog-clock-leds
esp8266:
board: d1_mini
@Resinchem
Resinchem / tag-reader.yaml
Last active November 4, 2023 18:59
ESPHome code for a Home Assistant DIY tag reader
# =========================================================
# This code is a slightly modified version of the original
# by Adonno and contains the modifications for some hardware
# changes.
#
# See the following for build details and use:
# YouTube Video: https://youtu.be/5Xo8yc4tQYc
# Written Blog: https://resinchemtech.blogspot.com/2023/07/nfc-tag-reader.html
# =========================================================
@Resinchem
Resinchem / midea-ac-home-assistant.yaml
Last active July 4, 2023 20:11
ESPHome and Home Assistant Code for Midea Window AC local integration and automation
# *******************************************************************************
# This contains the code used in my Midea window air conditioner local
# integration and automation within Home Assistant. It is specific to
# my paricular AC unit and needs. It will likely need to be adapted and
# modified for your own needs and equiment.
#
# This file contains the ESPHome code for the IR transmitter and the FSR
# bed sensor, along with the Home Assistant Helpers and automations. It is
# not meant to be used as a single file, but broken out into ESPHome code and
# other Home Assistant code.
@Resinchem
Resinchem / virtual_switch_examples.yaml
Last active April 28, 2024 14:26
Example Home Assistant Virtual Switch Examples as shown in YouTube Video
# ==========================================================
# DASHBOARD YAML
# All examples will need to be edited to use your entity
# names and particular installation.
#
# This dashboard example includes a toggle with conditional
# cards to switch between custom button card and standard
# entities display as shown in the video:
# https://youtu.be/mj2CIKqrQlc
# ==========================================================
@Resinchem
Resinchem / custom_button_card_samples.yaml
Created April 7, 2023 21:38
Example Custom Button Card Use - from YouTube video: https://youtu.be/5Pi21pqfbxA
cards:
- type: vertical-stack
cards:
- text: Physical Switches / Lights
type: custom:text-divider-row
- square: false
columns: 4
type: grid
cards:
- aspect_ratio: 1.2/1
@Resinchem
Resinchem / garage-multisensor.yaml
Created September 16, 2022 16:46
ESPHome Code for Multi-sensor
esphome:
name: garage-multisensor
esp8266:
board: nodemcuv2
# Enable logging
logger:
# Enable Home Assistant API
#===================================
# This version is for Home Assistant
# release 2021.12 or later
#===================================
# BASEMENT STAIR LED LIGHTING WITH MOTION DETECTION
# LED lighting is auto-on based on motion detection at top and bottom of stairs.
# Initial motion at bottom, lights sequence up the stairs from the bottom.
# Initial motion at top, lights sequence down the stairs from the top.
# Sequence continues until opposite motion detector fires movement, turning lights off.
# Defaults to 15 seconds before auto-shutoff if no futher motion detected.
@Resinchem
Resinchem / garage_lights.yaml
Created October 2, 2021 12:27
Automated Garage Lighting
# =========================
# GARAGE OVERHEAD LIGHTS
# =========================
# Two manual entities (or helpers) are required for these
# automations:
# input_boolean.garage_motion_enable
# timer.garage_motion_time
# ---------------------------------------------------------
# Lights on via manual switch/doors closed (disable automation)
# ---------------------------------------------------------
@Resinchem
Resinchem / dryer.yaml
Created September 11, 2021 12:45
Dryer Notifications
# =====================================
# DRYER State and Notifications
# =====================================
- alias: "Dryer Start"
trigger:
platform: numeric_state
entity_id: sensor.dryer_indicator_on #Top photoresistor
above: 0.75
condition:
condition: template