Everything uses packages

Finish folder re-org
README updates
This commit is contained in:
ChNussbaum 2020-10-07 17:21:38 -05:00
parent dbd6e6c824
commit 13f3977342
45 changed files with 171 additions and 394 deletions

View File

@ -1,44 +0,0 @@
substitutions:
device_id: example_gosund_dimmer
device_name: Example Light
platform: ESP8266
board: esp01_1m
ip_address: !secret example_gosund_dimmer_ip
ota_pwd: !secret example_gosund_dimmer_ota_pwd
api_pwd: !secret example_gosund_dimmer_pwd
ap_wifi_pwd: !secret example_gosund_dimmer_ap_wifi_pwd
day_level: '100'
night_level: '10'
esphome:
<<: !include common/esphome.yaml
includes:
- gosund_sw2_dimmer.h
<<: !include common/common_gosund_dimmer.yaml
<<: !include common/logger/logger_debug_no_serial.yaml
binary_sensor:
- !include common/binary_sensor/status.yaml
- !include common/binary_sensor/day_night.yaml
- !include common/binary_sensor/gosund_dimmer_button.yaml
sensor:
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
switch:
- !include common/switch/restart.yaml
text_sensor:
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml
script:
- id: single_tap
then:
- logger.log: "Single Tap"
- id: double_tap
then:
- logger.log: "Double Tap"

View File

@ -9,26 +9,29 @@
> Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. For more information check out [Home-Assistant.io](https://www.home-assistant.io/).
## Custom Devices
> ### Basement Bathroom Sensor
> ### [Basement Bathroom Sensor](./devices/basement_bathroom_sensor.yaml)
> This is a [WEMOS D1 Mini clone](https://www.amazon.com/gp/product/B076F52NQD/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) that is connected to a [motion sensor](https://www.amazon.com/gp/product/B07GJDJV63/ref=ppx_yo_dt_b_asin_title_o06_s01?ie=UTF8&psc=1), a [temperature/humidity/pressure sensor](https://www.amazon.com/gp/product/B07KYJNFMD/ref=ppx_yo_dt_b_asin_title_o06_s01?ie=UTF8&psc=1), and a [door sensor](https://www.amazon.com/gp/product/B07YBGZNNW/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1) and is used to control the lights, fan, and heater (heat lamps in the fan) in my basement bathroom.
> ### Coffee Maker
> ### [Coffee Maker](./devices/coffee_maker.yaml)
> This is a [NodeMCU](https://www.amazon.com/gp/product/B010N1SPRK/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) that I installed in my [Cuisinart Coffee Maker](https://www.amazon.com/gp/product/B01N6T5QNO/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1). It has GPIO's connected to the indicator lights for the bold setting and power and has a couple of [relays](https://www.amazon.com/gp/product/B0057OC6D8/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) connected to the bold setting button and the power button. Aside from the ability to trigger automations based on the state of the coffee maker and automate turning on the coffee maker I also added a "bloom" feature. Coffee tastes better if you let the carbon dioxide escape (bloom) after getting the coffee grounds wet before continuing the brew cycle.
> ### Fire Pit and Fountain
> ### [Fire Pit and Fountain](./devices/fire_pit_fountain.yaml)
> This is a [WEMOS D1 Mini Pro](https://www.amazon.com/gp/product/B07G9HZ5LM/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) that is connected to a couple of [relays](https://www.amazon.com/gp/product/B0057OC6D8/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) and a couple of water proof push buttons [red](https://www.amazon.com/gp/product/B079GNNSRP/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) and [blue](https://www.amazon.com/gp/product/B079GK565N/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1). The multi-click config on the fire pit switch is so that any press will turn it off but to turn it on you have to press it for 3 seconds (to try and prevent kids from turning it on). This is used to control the combination fire pit and fountain in my backyard. I just got this hooked up and is working good other then the fire pit doesn't always come on on the first try (I think I am getting some bounce in the switch but haven't had a chance to troubleshoot further).
> ### Garage Fridge
> ### [Garage Fridge](./devices/garage_fridge.yaml)
> This is a [NodeMCU](https://www.amazon.com/gp/product/B010N1SPRK/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) that I have installed in the back of my garage fridge and is connected to several [temperature sensors](https://www.amazon.com/gp/product/B012C597T0/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) that monitor the temperature of the compressor, the fridge, and the freezer and a pair of [relays](https://www.amazon.com/gp/product/B0057OC6D8/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) that control a [heat tape](https://www.amazon.com/gp/product/B07HHB1R5S/ref=ox_sc_act_title_1?smid=A1KEJ1ZBUGV6FW&psc=1) wrapped around the compressor and a couple of [heaters](https://www.amazon.com/gp/product/B07GXSDMR2/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) that are inside the fridge. This is to prevent the compressor from getting to cold (when it is cold the oil thickens up which is hard on the compressor), the fridge from dropping below freezing (frozen beer is no fun), and the freezer from getting to warm (when temperatures in the garage are around the desired fridge temperature the freezer tends to get to warm because of lack of cooling demand from the fridge so we warm the fridge up a little to get it to kick in the compressor).
> ### Master Bed
> This is a [NodeMCU](https://www.amazon.com/gp/product/B010N1SPRK/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) that I have installed under my bed and is connected to a pair of [Force Sensitive Resistors](https://www.kr4.us/force-sensitive-resistor-long.html?gclid=COqn7qrNxdICFVQlgQodeLEMKw) that are placed between the mattress and box spring of my bed, one for my side and one for my wife's side. Because the ESP8266 has only one analog input I had to add some transistors connected to pins D0 and D1 that are used to select which FSR is connected to the A0 analog input. The custom binary sensors in [bed_sensor.h](https://github.com/nuttytree/ESPHome-Devices/blob/master/bed_sensor.h) handles switching between the FSR's and calculating who is in bed. Generally when the bed is empty the reading is the full 1024 (or at least close to this). If someone is on one side of the bed or the other the reading is typically around 100. However if you lay in the middle of the bed I tend to get readings of around 600-700 on both sides. Thus the 3 different binary sensors (Chris is in Bed, Melissa is in Bed, Someone is in Bed). There is also a Master Bed Count that reports the total number of people in bed, I compare this to a sensor in Home Assistant that tracks the number of "masters" (my wife and me) that are home so that I can activate night mode when everyone is in bed.
> ### [Master Bed](./devices/master_bed.yaml)
> This is a [NodeMCU](https://www.amazon.com/gp/product/B010N1SPRK/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) that I have installed under my bed and is connected to a pair of [Force Sensitive Resistors](https://www.kr4.us/force-sensitive-resistor-long.html?gclid=COqn7qrNxdICFVQlgQodeLEMKw) that are placed between the mattress and box spring of my bed, one for my side and one for my wife's side. Because the ESP8266 has only one analog input I had to add some transistors connected to pins D0 and D1 that are used to select which FSR is connected to the A0 analog input. The custom sensors in [bed_sensor.h](./custom/bed_sensor.h) handles switching between the FSR's and reading the values from the FSR's. Generally when the bed is empty the reading is the full 1024 (or at least close to this). If someone is on one side of the bed or the other the reading is typically around 100. However if you lay in the middle of the bed I tend to get readings of around 600-700 on both sides. Thus the 3 different binary sensors (Chris is in Bed, Melissa is in Bed, Someone is in Bed). There is also a Master Bed Count that reports the total number of people in bed, I compare this to a sensor in Home Assistant that tracks the number of "masters" (my wife and me) that are home so that I can activate night mode when everyone is in bed.
> ### Patio Lights
> ### [Patio Lights](./devices/patio_lights.yaml)
> This is a [WEMOS D1 Mini Pro](https://www.amazon.com/gp/product/B07G9HZ5LM/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) that is connected to a [relay](https://www.amazon.com/gp/product/B00VRUAHLE/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) to control the power to the landscape lights around my patio. I used the WEMOS D1 Mini Pro because it has an external antenna. I initially used a [WEMOS D1 Mini clone](https://www.amazon.com/gp/product/B076F52NQD/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) but the power supply for my lights was to far from the house and I kept having connectivity issues.
> ### Scripture of the Day
> ### [Pool Pumps](./devices/pool_pumps.yaml)
> This is a [Shelly 2.5 Double Relay Switch](https://www.amazon.com/gp/product/B07RRD13DJ/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) that is controlling the main pump on my pool and the auxillary pump that runs the pool cleaner. It turns the pump on and off through out the day and off at night (when we are least likely to be using the pool and when you get the most heat/water loss if the pump is running) and turns on the cleaner for a couple of hours in the morning. It also has some modes for Off (during the winter) and Continous when I need extra cleaning.
> ### [Scripture of the Day](./devices/scripture_of_the_day.yaml)
> This is a project I just started working on (and I am still waiting on the hardware to arrive from China). I am planning on building 2 of them as Christmas presents for my wife and son. It will consist of a [ESP8266 e-Paper Panel Driver Board](https://www.waveshare.com/e-paper-esp8266-driver-board.htm) powered by a [lithium battery](https://www.amazon.com/dp/B0867KDMY7/?coliid=IE0LBNACFHG4U&colid=1LOK862UA8LA0&psc=1&ref_=lv_ov_lig_dp_it) and [TP4056 lithium battery charger module](https://www.amazon.com/dp/B06XQRQR3Q/?coliid=I1B2ELKKLLKAK0&colid=1LOK862UA8LA0&psc=1&ref_=lv_ov_lig_dp_it) and driving a [Waveshare 7.5inch 800×480 E-Ink display](https://www.waveshare.com/7.5inch-e-paper.htm) all mounted inside a picture frame. The plan is to have it sit in deep-sleep most of the time but wake up every night, grab a random scripture from the [Our Manna Daily Verses API](http://www.ourmanna.com/verses/api/), update the display with the verse, and go back to sleep.
## Switches
@ -36,15 +39,16 @@
> ### [Laghten Smart Switch](https://www.amazon.com/gp/product/B07VMDQ3WT/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&psc=1)
> This is not my favorite device, I was going for a switch to control a couple of non-light devices that looked/felt similar to the [Feit Dimmers](https://www.amazon.com/gp/product/B07SXDFH38/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1) I am using for most of my lights. This was about as close as I could get, the light is significantly dimmer and I don't care for the loose feeling of the button but it works, I really wish Feit made a switch to match their dimmers.
> > * Master Bathroom Fan
> > * [Master Bathroom Fan](./devices/master_bath_fan.yaml)
> ### [SANA Dual Switch](https://www.amazon.com/gp/product/B07QC5ZCHP/ref=ppx_yo_dt_b_asin_title_o03_s01?ie=UTF8&th=1)
> My basement bathroom has 4 devices (main light, fan, shower light, heat lamps) but only 2 single gang boxes (and not enough room to swith to dual gang) so these were a perfect fit. The prices is right, the buttons feel solid, and I was able to flash them using [Tuya-Convert](https://github.com/ct-Open-Source/tuya-convert). They do seem to have corners that are squarer then typical so I had a little bit of trouble getting a standard cover to fit but nothing I couldn't fix with a file.
> > * Basement Bathroom Light and Fan
> > * Basement Bathroom Shower Light and Heater
> > * [Basement Bathroom Light and Fan](./devices/basement_bathroom_light_fan.yaml)
> > * [Basement Bathroom Shower Light and Heater](./devices/basement_bathroom_shower_light_heater.yaml)
> ### [SANA Triple Switch](https://www.amazon.com/gp/product/B07Q5XPRKD/ref=ox_sc_act_title_1?smid=A3EOKYTNCLEIKH&psc=1)
> This is installed in place of the switch that controled my [TREO LED Pool Lights](https://www.amazon.com/gp/product/B06XTRLM5M/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1). These lights have the option to select different colors by briefly turning them off and back on again and they do remember the last color when turned on again. The custom light component handles tracking the current color and exposes custom "effects" for each of the colors to [Home Assistant](https://www.home-assistant.io/). I went with the triple switch so that I could use the third button to control my [Patio Lights](#patio-lights) which otherwise do not have a physical switch. The one issue I am having with this is occasionally the "effect" on the switch gets out of sync with the actual color of the lights. It has only happened a couple of times so I haven't gotten around to investigating why it happens.
> This is installed in place of the switch that controled my [TREO LED Pool Lights](https://www.amazon.com/gp/product/B06XTRLM5M/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1). These lights have the option to select different colors by briefly turning them off and back on again and they do remember the last color when turned on again. The custom [TreoLedPoolLight.h](./custom/TreoLedPoolLight.h) component handles tracking the current color and exposes custom "effects" for each of the colors to [Home Assistant](https://www.home-assistant.io/). I went with the triple switch so that I could use the third button to control my [Patio Lights](#patio-lights) which otherwise do not have a physical switch. The one issue I am having with this is occasionally the "effect" on the switch gets out of sync with the actual color of the lights. It has only happened a couple of times so I haven't gotten around to investigating why it happens.
> > * [Patio and Pool Lights](./devices/patio_and_pool_lights.yaml)
## Dimmer Switches
> ### [Feit Dimmers](https://www.amazon.com/gp/product/B07SXDFH38/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1)
@ -58,7 +62,7 @@
> > * Have to click repeatedly to change the brightness (can't hold to change)
> > * All buttons are managed by the Tuya MCU so adding things like double-taps is kind of a hack
> I have created a custom [component](https://github.com/nuttytree/ESPHome-Devices/blob/master/custom/tuya_light_plus.h) for these that extends the standard Tuya Light component that should work with most (if not all) Tuya dimmers and provides the following extra features:
> I have created a custom [tuya_light_plus.h](./custom/tuya_light_plus.h) component for these that extends the standard Tuya Light component that should work with most (if not all) Tuya dimmers and provides the following extra features:
> > * Resets the brightness level back to a default level when turned off so that it always comes on at the same level instead of the level it was at when turned off
> > * The default level is configurable as different levels when my house is in "Day" mode vs "Night" mode (based on a binary sensor in Home Assistant) and via a service in Home Assistant
> > * Provides an option to auto turn off the light after a period of time
@ -67,13 +71,13 @@
> > * Allows you to "link" other light(s) in Home Assistant that will be controlled by this dimmer
> The following devices are Feit Dimmers:
> > * [Basement Stair Lights](https://github.com/nuttytree/ESPHome-Devices/blob/master/devices/basement_stair_lights_1.yaml)/[Basement Stair Lights 2](https://github.com/nuttytree/ESPHome-Devices/blob/master/devices/basement_stair_lights_2.yaml)
> > * [Computer Light](https://github.com/nuttytree/ESPHome-Devices/blob/master/devices/computer_light.yaml)
> > * [Dining Room Light](https://github.com/nuttytree/ESPHome-Devices/blob/master/devices/dining_room_light.yaml)
> > * [Family Room Light](https://github.com/nuttytree/ESPHome-Devices/blob/master/devices/family_room_light.yaml)
> > * [Front Lights](https://github.com/nuttytree/ESPHome-Devices/blob/master/devices/front_lights.yaml)
> > * [Kitchen Bar Lights](https://github.com/nuttytree/ESPHome-Devices/blob/master/devices/kitchen_bar_lights.yaml)
> > * [Kitchen Table Light](https://github.com/nuttytree/ESPHome-Devices/blob/master/devices/kitchen_table_light.yaml)
> > * [Living Room Lights](https://github.com/nuttytree/ESPHome-Devices/blob/master/devices/living_room_lights.yaml)
> > * [Master Bathroom Lights](https://github.com/nuttytree/ESPHome-Devices/blob/master/devices/master_bath_lights_1.yaml)/[Master Bathroom Lights 2](https://github.com/nuttytree/ESPHome-Devices/blob/master/devices/master_bath_lights_2.yaml)
> > * [Office Light](https://github.com/nuttytree/ESPHome-Devices/blob/master/devices/office_light.yaml)
> > * [Basement Stair Lights](./devices/basement_stair_lights_1.yaml)/[Basement Stair Lights 2](./devices/basement_stair_lights_2.yaml)
> > * [Computer Light](./devices/computer_light.yaml)
> > * [Dining Room Light](./devices/dining_room_light.yaml)
> > * [Family Room Light](./devices/family_room_light.yaml)
> > * [Front Lights](./devices/front_lights.yaml)
> > * [Kitchen Bar Lights](./devices/kitchen_bar_lights.yaml)
> > * [Kitchen Table Light](./devices/kitchen_table_light.yaml)
> > * [Living Room Lights](./devices/living_room_lights.yaml)
> > * [Master Bathroom Lights](./devices/master_bath_lights_1.yaml)/[Master Bathroom Lights 2](./devices/master_bath_lights_2.yaml)
> > * [Office Light](./devices/office_light.yaml)

View File

@ -1,3 +0,0 @@
api:
password: ${api_pwd}

View File

@ -1,3 +0,0 @@
platform: homeassistant
id: day_night
entity_id: input_boolean.day_night

View File

@ -1,28 +0,0 @@
platform: gpio
pin:
number: GPIO4
inverted: true
id: gosund_button
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at most .4s
- ON for at most 1s
- OFF for at least 0.1s
then:
- script.execute: double_tap
- timing:
- ON for at most 1s
- OFF for at least 0.4s
then:
- if:
condition:
light.is_off: gosund_light
then:
- light.turn_on:
id: gosund_light
brightness: !lambda |-
return (id(day_night) ? ${day_level} : ${night_level}) / 100.0;
else:
- light.turn_off: gosund_light
- script.execute: single_tap

View File

@ -1,2 +0,0 @@
platform: status
name: ${device_name} Status

View File

@ -1,3 +0,0 @@
<<: !include wifi.yaml
<<: !include api.yaml
<<: !include ota.yaml

View File

@ -1,14 +0,0 @@
<<: !include wifi.yaml
<<: !include api.yaml
<<: !include ota.yaml
<<: !include status_led/gosund_dimmer.yaml
light:
- !include light/gosund_dimmer.yaml
output:
- !include output/gosund_dimmer_led.yaml
uart:
- !include uart/gosund_dimmer.yaml

View File

@ -1,5 +0,0 @@
name: ${device_id}
platform: ${platform}
board: ${board}
arduino_version: latest
build_path: build/${device_id}

View File

@ -1,8 +0,0 @@
platform: custom
lambda: |-
auto gosund_light = new GosundSW2Light(gosund_uart, gosund_dimmer_led);
App.register_component(gosund_light);
return {gosund_light};
lights:
- id: gosund_light
name: ${device_name}

View File

@ -1,7 +0,0 @@
platform: "tuya"
id: tuya_light
name: ${device_name}
dimmer_datapoint: 2
switch_datapoint: 1
min_value: 0
max_value: 1000

View File

@ -1,2 +0,0 @@
logger:
level: DEBUG

View File

@ -1,3 +0,0 @@
logger:
level: DEBUG
baud_rate: 0

View File

@ -1,2 +0,0 @@
logger:
level: INFO

View File

@ -1,3 +0,0 @@
logger:
level: NONE
baud_rate: 0

View File

@ -1,2 +0,0 @@
ota:
password: ${ota_pwd}

View File

@ -1,5 +0,0 @@
platform: gpio
id: gosund_dimmer_led
pin:
number: GPIO13
inverted: true

View File

@ -1 +0,0 @@
<<: !include ../secrets.yaml

View File

@ -1,2 +0,0 @@
platform: uptime
name: ${device_name} Uptime

View File

@ -1,2 +0,0 @@
platform: wifi_signal
name: ${device_name} WiFi Signal

View File

@ -1,4 +0,0 @@
status_led:
pin:
number: GPIO12
inverted: true

View File

@ -1,3 +0,0 @@
platform: restart
id: reboot
name: Restart ${device_name}

View File

@ -1,2 +0,0 @@
platform: version
name: ${device_name} Version

View File

@ -1,4 +0,0 @@
platform: wifi_info
ip_address:
name: ${device_name} IP Address
icon: mdi:ip-network

View File

@ -1,4 +0,0 @@
id: gosund_uart
rx_pin: GPIO3
tx_pin: GPIO1
baud_rate: 115200

View File

@ -1,3 +0,0 @@
rx_pin: GPIO3
tx_pin: GPIO1
baud_rate: 9600

View File

@ -1,14 +0,0 @@
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
power_save_mode: none
manual_ip:
static_ip: ${ip_address}
subnet: !secret ip_subnet
gateway: !secret ip_gateway
ap:
ssid: ${device_id}
password: ${ap_wifi_pwd}
captive_portal:

10
devices/.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

View File

@ -8,14 +8,10 @@ substitutions:
api_pwd: !secret basement_bathroom_light_fan_api_pwd
ap_wifi_pwd: !secret basement_bathroom_light_fan_ap_wifi_pwd
esphome:
<<: !include common/esphome.yaml
<<: !include common/common.yaml
<<: !include common/logger/logger_none.yaml
packages:
device_base: !include ../packages/device_base.yaml
binary_sensor:
- !include common/binary_sensor/status.yaml
- platform: gpio
id: light_button
pin:
@ -53,18 +49,7 @@ output:
id: light_output
pin: 13
sensor:
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
status_led:
pin:
number: 0
inverted: true
switch:
- !include common/switch/restart.yaml
text_sensor:
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml

View File

@ -8,23 +8,15 @@ substitutions:
api_pwd: !secret basement_bathroom_sensor_api_pwd
ap_wifi_pwd: !secret basement_bathroom_sensor_ap_wifi_pwd
packages:
device_base: !include ../packages/device_base.yaml
esphome:
<<: !include common/esphome.yaml
on_boot:
then:
- output.turn_on: motion_pwr
<<: !include common/common.yaml
<<: !include common/logger/logger_none.yaml
i2c:
sda: D2
scl: D1
scan: true
binary_sensor:
- !include common/binary_sensor/status.yaml
- platform: gpio
name: Basement Bathroom Door
id: door
@ -155,6 +147,11 @@ binary_sensor:
id: heat
entity_id: switch.basement_bathroom_heater
i2c:
sda: D2
scl: D1
scan: true
output:
- platform: gpio
pin: D3
@ -170,8 +167,6 @@ output:
id: door_gnd
sensor:
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
- platform: bme280
temperature:
id: temperature
@ -211,10 +206,3 @@ status_led:
pin:
number: D4
inverted: true
switch:
- !include common/switch/restart.yaml
text_sensor:
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml

View File

@ -8,14 +8,10 @@ substitutions:
api_pwd: !secret basement_bathroom_shower_light_heater_api_pwd
ap_wifi_pwd: !secret basement_bathroom_shower_light_heater_ap_wifi_pwd
esphome:
<<: !include common/esphome.yaml
<<: !include common/common.yaml
<<: !include common/logger/logger_none.yaml
packages:
device_base: !include ../packages/device_base.yaml
binary_sensor:
- !include common/binary_sensor/status.yaml
- platform: gpio
id: light_button
pin:
@ -44,23 +40,14 @@ output:
id: light_output
pin: 13
sensor:
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
status_led:
pin:
number: 0
inverted: true
switch:
- !include common/switch/restart.yaml
- platform: gpio
id: heater
name: "Basement Bathroom Heater"
icon: mdi:radiator
pin: 4
text_sensor:
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml

View File

@ -8,14 +8,10 @@ substitutions:
api_pwd: !secret coffee_maker_api_pwd
ap_wifi_pwd: !secret coffee_maker_ap_wifi_pwd
esphome:
<<: !include common/esphome.yaml
<<: !include common/common.yaml
<<: !include common/logger/logger_none.yaml
packages:
device_base: !include ../packages/device_base.yaml
binary_sensor:
- !include common/binary_sensor/status.yaml
- platform: gpio
id: power_light
pin:
@ -83,12 +79,7 @@ interval:
brewStage = 0;
}
sensor:
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
switch:
- !include common/switch/restart.yaml
- platform: template
id: power_switch
name: "Coffee Maker"
@ -143,7 +134,3 @@ switch:
id: bold_switch_physical
pin: D1
inverted: true
text_sensor:
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml

View File

@ -8,14 +8,10 @@ substitutions:
api_pwd: !secret fire_pit_fountain_api_pwd
ap_wifi_pwd: !secret fire_pit_fountain_ap_wifi_pwd
esphome:
<<: !include common/esphome.yaml
<<: !include common/common.yaml
<<: !include common/logger/logger_debug.yaml
packages:
device_base: !include ../packages/device_base.yaml
binary_sensor:
- !include common/binary_sensor/status.yaml
- platform: gpio
id: fountain_toggle
pin:
@ -43,12 +39,7 @@ binary_sensor:
then:
- switch.turn_off: fire_pit
sensor:
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
switch:
- !include common/switch/restart.yaml
- platform: gpio
id: fountain
name: "Fountain"
@ -61,7 +52,3 @@ switch:
icon: mdi:fire
pin: D2
inverted: true
text_sensor:
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml

View File

@ -8,14 +8,10 @@ substitutions:
api_pwd: !secret garage_fridge_api_pwd
ap_wifi_pwd: !secret garage_fridge_ap_wifi_pwd
esphome:
<<: !include common/esphome.yaml
<<: !include common/common.yaml
<<: !include common/logger/logger_none.yaml
packages:
device_base: !include ../packages/device_base.yaml
binary_sensor:
- !include common/binary_sensor/status.yaml
- platform: template
id: fridge_heater
name: "Garage Fridge Heater"
@ -48,8 +44,6 @@ script:
}
sensor:
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
- platform: dallas
id: fridge_temp
name: "Garage Fridge Temperature"
@ -101,7 +95,6 @@ sensor:
- script.execute: fridge_heater_control
switch:
- !include common/switch/restart.yaml
- platform: gpio
id: fridge_heater_switch
pin: D0
@ -110,7 +103,3 @@ switch:
id: compressor_heater_switch
pin: D1
inverted: true
text_sensor:
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml

View File

@ -8,14 +8,10 @@ substitutions:
api_pwd: !secret master_bath_fan_api_pwd
ap_wifi_pwd: !secret master_bath_fan_ap_wifi_pwd
esphome:
<<: !include common/esphome.yaml
<<: !include common/common.yaml
<<: !include common/logger/logger_none.yaml
packages:
device_base: !include ../packages/device_base.yaml
binary_sensor:
- !include common/binary_sensor/status.yaml
- platform: gpio
id: fan_button
pin:
@ -39,18 +35,7 @@ output:
id: button_led
pin: 4
sensor:
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
status_led:
pin:
number: 5
inverted: true
switch:
- !include common/switch/restart.yaml
text_sensor:
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml

View File

@ -8,25 +8,20 @@ substitutions:
api_pwd: !secret master_bath_humidity_temp_sensor_api_pwd
ap_wifi_pwd: !secret master_bath_humidity_temp_sensor_ap_wifi_pwd
esphome:
<<: !include common/esphome.yaml
<<: !include common/common.yaml
<<: !include common/logger/logger_none.yaml
i2c:
sda: D2
scl: D1
scan: true
packages:
device_base: !include ../packages/device_base.yaml
binary_sensor:
- !include common/binary_sensor/status.yaml
- platform: template
id: trigger_humidity
lambda: return (id(humidity).state - id(median_humidity).state) > 5;
filters:
- delayed_off: 5min
i2c:
sda: D2
scl: D1
scan: true
output:
- platform: gpio
@ -34,8 +29,6 @@ output:
id: bme_gnd
sensor:
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
- platform: bme280
temperature:
id: temperature
@ -65,10 +58,3 @@ status_led:
pin:
number: D4
inverted: true
switch:
- !include common/switch/restart.yaml
text_sensor:
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml

View File

@ -8,17 +8,14 @@ substitutions:
api_pwd: !secret master_bed_api_pwd
ap_wifi_pwd: !secret master_bed_ap_wifi_pwd
esphome:
<<: !include common/esphome.yaml
includes:
- bed_sensor.h
packages:
device_base: !include ../packages/device_base.yaml
<<: !include common/common.yaml
<<: !include common/logger/logger_none.yaml
esphome:
includes:
- ../custom/bed_sensor.h
binary_sensor:
- !include common/binary_sensor/status.yaml
- platform: template
name: "Melissa is in Bed"
id: melissa_in_bed
@ -48,9 +45,6 @@ binary_sensor:
state: !lambda 'return id(melissa_in_bed).state + id(chris_in_bed).state + id(someone_in_bed).state;'
sensor:
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
- platform: custom
lambda: |-
auto bedSensor = new BedSensor();
@ -125,13 +119,7 @@ sensor:
return "Unknown";
}
switch:
- !include common/switch/restart.yaml
text_sensor:
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml
- platform: template
name: "Master Bed Status"
id: master_bed_status

View File

@ -8,16 +8,14 @@ substitutions:
api_pwd: !secret pool_and_patio_lights_api_pwd
ap_wifi_pwd: !secret pool_and_patio_lights_ap_wifi_pwd
esphome:
<<: !include common/esphome.yaml
includes:
- TreoLedPoolLight.h
packages:
device_base: !include ../packages/device_base.yaml
<<: !include common/common.yaml
<<: !include common/logger/logger_none.yaml
esphome:
includes:
- ../custom/TreoLedPoolLight.h
binary_sensor:
- !include common/binary_sensor/status.yaml
- platform: gpio
id: patio_lights_button
pin:
@ -66,21 +64,12 @@ light:
- id: pool_lights
name: "Pool Lights"
sensor:
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
status_led:
pin:
number: 0
inverted: true
switch:
- !include common/switch/restart.yaml
- platform: gpio
id: patio_lights_indicator
pin: 13
text_sensor:
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml

View File

@ -8,14 +8,8 @@ substitutions:
api_pwd: !secret patio_lights_api_pwd
ap_wifi_pwd: !secret patio_lights_ap_wifi_pwd
esphome:
<<: !include common/esphome.yaml
<<: !include common/common.yaml
<<: !include common/logger/logger_none.yaml
binary_sensor:
- !include common/binary_sensor/status.yaml
packages:
device_base: !include ../packages/device_base.yaml
light:
- platform: binary
@ -26,14 +20,3 @@ output:
- platform: gpio
id: patio_lights_output
pin: D1
sensor:
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
switch:
- !include common/switch/restart.yaml
text_sensor:
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml

View File

@ -8,22 +8,14 @@ substitutions:
api_pwd: !secret pool_pumps_api_pwd
ap_wifi_pwd: !secret pool_pumps_ap_wifi_pwd
esphome:
<<: !include common/esphome.yaml
<<: !include common/common.yaml
<<: !include common/logger/logger_debug_no_serial.yaml
binary_sensor:
- !include common/binary_sensor/status.yaml
packages:
device_base: !include ../packages/device_base.yaml
i2c:
sda: GPIO12
scl: GPIO14
sensor:
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
- platform: ade7953
voltage:
name: ${device_name} Voltage
@ -107,7 +99,6 @@ status_led:
inverted: yes
switch:
- !include common/switch/restart.yaml
- platform: gpio
pin: GPIO4
name: "Pool Pump"
@ -126,8 +117,6 @@ switch:
- switch.turn_on: pool_pump
text_sensor:
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml
- platform: homeassistant
name: "Pool Mode Text"
entity_id: input_select.pool_mode

View File

@ -0,0 +1,93 @@
# I had a couple of Gosund SW2 dimmers for a while but I wasn't very happy with them.
# I did develop a custom light component for them so I wanted to preserve the code for others to use.
substitutions:
day_level: '100'
night_level: '10'
esphome:
name: example_gosund_dimmer
platform: ESP8266
board: esp01_1m
arduino_version: latest
includes:
- gosund_sw2_dimmer.h
wifi:
ssid: MyHomeNetwork
password: VerySafePassword
api:
password: VerySafePassword
logger:
level: INFO
baud_rate: 0 # This must be 0 to prevent conflicts with the dimmer
status_led:
pin:
number: GPIO12
inverted: true
light:
- platform: custom
lambda: |-
auto gosund_light = new GosundSW2Light(gosund_uart, gosund_dimmer_led);
App.register_component(gosund_light);
return {gosund_light};
lights:
- id: gosund_light
name: Example Gosund Dimmer
output:
- platform: gpio
id: gosund_dimmer_led
pin:
number: GPIO13
inverted: true
uart:
- id: gosund_uart
rx_pin: GPIO3
tx_pin: GPIO1
baud_rate: 115200
binary_sensor:
- platform: homeassistant
id: day_night
entity_id: input_boolean.day_night
- platform: gpio
pin:
number: GPIO4
inverted: true
id: gosund_button
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at most .4s
- ON for at most 1s
- OFF for at least 0.1s
then:
- script.execute: double_tap
- timing:
- ON for at most 1s
- OFF for at least 0.4s
then:
- if:
condition:
light.is_off: gosund_light
then:
- light.turn_on:
id: gosund_light
brightness: !lambda |-
return (id(day_night) ? ${day_level} : ${night_level}) / 100.0;
else:
- light.turn_off: gosund_light
- script.execute: single_tap
script:
- id: single_tap
then:
- logger.log: "Single Tap"
- id: double_tap
then:
- logger.log: "Double Tap"