Initial commit

This commit is contained in:
Jason Williams 2023-05-12 11:55:51 -06:00
commit 08d3547a44
6 changed files with 447 additions and 0 deletions

10
.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
/.esphome/
**/.pioenvs/
**/.piolibdeps/
**/lib/
**/src/
**/platformio.ini
/secrets.yaml

51
basement.yaml Normal file
View File

@ -0,0 +1,51 @@
esphome:
name: basement
platform: ESP8266
board: nodemcuv2
logger:
level: INFO
ota:
password: "872a00fc1540e5da2bde65034519d736"
wifi:
ssid: !secret ssid
password: !secret pass
fast_connect: true
mqtt:
broker: henry.int.jnf.me
username: esphome
password: esphome
topic_prefix: esphome/basement
dallas:
- pin: D1
sensor:
- platform: dallas
address: 0xB20114310AB9F728
name: "Furnace Room"
binary_sensor:
- platform: gpio
pin: D6
name: "Doorbell"
device_class: sound
filters:
- delayed_off: 5s
- platform: gpio
pin: D7
name: "Hot Water Tank"
device_class: moisture
filters:
- invert
- delayed_off: 5s
- platform: gpio
pin: D3
name: "Basement Drain"
device_class: moisture
filters:
- invert
- delayed_off: 5s

61
bedroom-lightstrips.yaml Normal file
View File

@ -0,0 +1,61 @@
esphome:
name: bedroom-lightstrips
esp8266:
board: nodemcuv2
framework:
version: 2.7.4
logger:
level: INFO
ota:
password: "69ad39126b95f706a401f48614a8404d"
wifi:
ssid: !secret ssid
password: !secret pass
fast_connect: true
mqtt:
broker: henry.int.jnf.me
username: esphome
password: esphome
topic_prefix: esphome/bedroom-lightstrips
light:
- platform: fastled_spi
name: "Full LED Strip"
id: fullstrip
chipset: SK9822
rgb_order: BGR
data_pin: D5
clock_pin: D6
num_leds: 116
- platform: partition
name: "Jason's Under Bed Lights"
segments:
- id: fullstrip
from: 0
to: 57
effects:
- addressable_rainbow
- addressable_color_wipe
- addressable_scan
- addressable_twinkle
- addressable_fireworks
- addressable_flicker
- platform: partition
name: "Flo's Under Bed Lights"
segments:
- id: fullstrip
from: 58
to: 115
reversed: true
effects:
- addressable_rainbow
- addressable_color_wipe
- addressable_scan
- addressable_twinkle
- addressable_fireworks
- addressable_flicker

158
garage.yaml Normal file
View File

@ -0,0 +1,158 @@
esphome:
name: garage
platform: ESP8266
board: nodemcuv2
logger:
level: INFO
ota:
password: "143fd33979958ada2bb06df1622d5a4d"
wifi:
ssid: !secret ssid
password: !secret pass
fast_connect: true
mqtt:
broker: henry.int.jnf.me
username: esphome
password: esphome
topic_prefix: esphome/garage
dallas:
- pin: D7
sensor:
- platform: dallas
address: 0x7701143100966C28
name: "Freezer"
id: garage_freezer
- platform: dallas
address: 0x200114310A086F28
name: "Garage"
id: garage_temp
- platform: ultrasonic
trigger_pin: D5
echo_pin: D8
id: garage_spot_1
internal: true
- platform: ultrasonic
trigger_pin: D3
echo_pin: D4
id: garage_spot_2
internal: true
text_sensor:
- platform: template
name: "Garage Door State"
id: garage_door_state
lambda: !lambda |-
if (id(garage_door_open).state && id(garage_door_closed).state) {
return {"Error"};
} else if (id(garage_door_open).state) {
return {"Open"};
} else if (id(garage_door_closed).state) {
return {"Closed"};
} else return {"Moving"};
binary_sensor:
- platform: gpio
pin: D0
name: "Garage Door"
device_class: door
id: garage_door_open
filters:
- invert:
on_press:
then:
- lambda: |-
id(garage_door_state).publish_state("Open");
on_release:
then:
- lambda: |-
id(garage_door).current_operation = COVER_OPERATION_CLOSING;
id(garage_door).publish_state();
id(garage_door_state).publish_state("Moving");
- platform: gpio
pin: D1
id: garage_door_closed
filters:
- invert:
internal: true
on_press:
then:
- lambda: |-
id(garage_door_state).publish_state("Closed");
on_release:
then:
- lambda: |-
id(garage_door).current_operation = COVER_OPERATION_OPENING;
id(garage_door).publish_state();
id(garage_door_state).publish_state("Moving");
- platform: gpio
pin: D2
name: "Side Door"
device_class: door
filters:
- invert
- delayed_off: 5s
- platform: template
name: "Left Parking Spot"
device_class: occupancy
lambda: |-
if (id(garage_spot_1).state < 2) {
return true;
} else {
return false;
}
- platform: template
name: "Right Parking Spot"
device_class: occupancy
lambda: |-
if (id(garage_spot_2).state < 2) {
return true;
} else {
return false;
}
switch:
- platform: gpio
pin:
number: D6
inverted: true
id: garage_door_switch
on_turn_on:
- delay: 500ms
- switch.turn_off: garage_door_switch
internal: true
cover:
- platform: template
name: "Garage Door"
id: garage_door
device_class: garage
lambda: !lambda |-
if (id(garage_door_open).state) {
return COVER_OPEN;
} else if (id(garage_door_closed).state) {
return COVER_CLOSED;
} else return {};
open_action:
- switch.turn_on: garage_door_switch
- delay: 3s
- if:
condition:
binary_sensor.is_on: garage_door_closed
then:
- switch.turn_on: garage_door_switch
close_action:
- switch.turn_on: garage_door_switch
- delay: 3s
- if:
condition:
binary_sensor.is_on: garage_door_open
then:
- switch.turn_on: garage_door_switch

40
houseplant.yaml Normal file
View File

@ -0,0 +1,40 @@
esphome:
name: houseplant
platform: ESP8266
board: nodemcuv2
logger:
level: INFO
ota:
password: "71987bd671fe226031259af06d0ccbea"
wifi:
ssid: !secret ssid
password: !secret pass
fast_connect: true
mqtt:
broker: henry.int.jnf.me
username: esphome
password: esphome
topic_prefix: esphome/houseplant
http_request:
sensor:
- platform: adc
pin: A0
name: "Moisture Level"
id: moisture_level
unit_of_measurement: "u"
update_interval: 1h
filters:
- multiply: 1024
on_value:
- http_request.get:
verify_ssl: false
url: !lambda |-
return (std::string) "https://jasonsplant.jaywll.co/newreading?v=" + to_string(int(id(moisture_level).state));
headers:
auth-key: !secret houseplant_key

127
laundry.yaml Normal file
View File

@ -0,0 +1,127 @@
esphome:
name: laundry
platform: ESP8266
board: nodemcuv2
logger:
level: INFO
ota:
password: "03af999284928f8525c82a13771a4a4f"
wifi:
ssid: !secret ssid
password: !secret pass
fast_connect: true
mqtt:
broker: henry.int.jnf.me
username: esphome
password: esphome
topic_prefix: esphome/laundry
i2c:
sda: D6
scl: D5
scan: True
id: bus_a
sensor:
- platform: mpu6050
address: 0x68
update_interval: 1s
gyro_x:
name: "Dryer Gyro X"
id: dryer_gyro_x
internal: true
gyro_y:
name: "Dryer Gyro Y"
id: dryer_gyro_y
internal: true
gyro_z:
name: "Dryer Gyro Z"
id: dryer_gyro_z
internal: true
temperature:
name: "Dryer Temperature"
filters:
- throttle: 30s
- platform: mpu6050
address: 0x69
update_interval: 1s
gyro_x:
name: "Washer Gyro X"
id: washer_gyro_x
internal: true
gyro_y:
name: "Washer Gyro Y"
id: washer_gyro_y
internal: true
gyro_z:
name: "Washer Gyro Z"
id: washer_gyro_z
internal: true
temperature:
name: "Washer Temperature"
filters:
- throttle: 30s
- platform: template
name: "Dryer Gyro All"
id: dryer_gyro_all
unit_of_measurement: °/s²
lambda: |-
return fabs(id(dryer_gyro_x).state) + fabs(id(dryer_gyro_y).state) + fabs(id(dryer_gyro_z).state);
update_interval: 1s
filters:
- lambda: |-
static float last_dryer_value = 0;
static float dryer_change = 0;
dryer_change = x - last_dryer_value;
last_dryer_value = x;
return fabs(dryer_change);
- sliding_window_moving_average:
window_size: 120
send_every: 10
- platform: template
name: "Washer Gyro All"
id: washer_gyro_all
unit_of_measurement: °/s²
lambda: |-
return fabs(id(washer_gyro_x).state) + fabs(id(washer_gyro_y).state) + fabs(id(washer_gyro_z).state);
update_interval: 1s
filters:
- lambda: |-
static float last_washer_value = 0;
static float washer_change = 0;
washer_change = x - last_washer_value;
last_washer_value = x;
return fabs(washer_change);
- sliding_window_moving_average:
window_size: 120
send_every: 10
binary_sensor:
- platform: template
name: "Dryer"
id: dryer
lambda: |-
if (id(dryer_gyro_all).state >= 2.0) {
return true;
} else {
return false;
}
filters:
- delayed_on: 30s
- delayed_off: 60s
- platform: template
name: "Washer"
id: washer
lambda: |-
if (id(washer_gyro_all).state >= 1.0) {
return true;
} else {
return false;
}
filters:
- delayed_on: 30s
- delayed_off: 120s