From 13f397734260f3c68d718e411a7944a597fc086f Mon Sep 17 00:00:00 2001 From: ChNussbaum Date: Wed, 7 Oct 2020 17:21:38 -0500 Subject: [PATCH] Everything uses packages Finish folder re-org README updates --- .example_gosund_dimmer.yaml | 44 --------- README.md | 50 +++++----- common/api.yaml | 3 - common/binary_sensor/day_night.yaml | 3 - .../binary_sensor/gosund_dimmer_button.yaml | 28 ------ common/binary_sensor/status.yaml | 2 - common/common.yaml | 3 - common/common_gosund_dimmer.yaml | 14 --- common/esphome.yaml | 5 - common/light/gosund_dimmer.yaml | 8 -- common/light/tuya_dimmer.yaml | 7 -- common/logger/logger_debug.yaml | 2 - common/logger/logger_debug_no_serial.yaml | 3 - common/logger/logger_info.yaml | 2 - common/logger/logger_none.yaml | 3 - common/ota.yaml | 2 - common/output/gosund_dimmer_led.yaml | 5 - common/secrets.yaml | 1 - common/sensor/uptime.yaml | 2 - common/sensor/wifi.yaml | 2 - common/status_led/gosund_dimmer.yaml | 4 - common/switch/restart.yaml | 3 - common/text_sensor/version.yaml | 2 - common/text_sensor/wifi.yaml | 4 - common/uart/gosund_dimmer.yaml | 4 - common/uart/tuya.yaml | 3 - common/wifi.yaml | 14 --- .../TreoLedPoolLight.h | 0 bed_sensor.h => custom/bed_sensor.h | 0 devices/.gitignore | 10 ++ .../basement_bathroom_light_fan.yaml | 19 +--- .../basement_bathroom_sensor.yaml | 28 ++---- ...basement_bathroom_shower_light_heater.yaml | 17 +--- .../coffee_maker.yaml | 17 +--- .../fire_pit_fountain.yaml | 17 +--- .../garage_fridge.yaml | 15 +-- .../master_bath_fan.yaml | 19 +--- .../master_bath_humidity_temp_sensor.yaml | 28 ++---- master_bed.yaml => devices/master_bed.yaml | 22 +---- .../patio_and_pool_lights.yaml | 21 +---- .../patio_lights.yaml | 21 +---- pool_pumps.yaml => devices/pool_pumps.yaml | 15 +-- ...melissa.yaml => scripture_of_the_day.yaml} | 0 other/example_gosund_dimmer.yaml | 93 +++++++++++++++++++ .../gosund_sw2_dimmer.h | 0 45 files changed, 171 insertions(+), 394 deletions(-) delete mode 100644 .example_gosund_dimmer.yaml delete mode 100644 common/api.yaml delete mode 100644 common/binary_sensor/day_night.yaml delete mode 100644 common/binary_sensor/gosund_dimmer_button.yaml delete mode 100644 common/binary_sensor/status.yaml delete mode 100644 common/common.yaml delete mode 100644 common/common_gosund_dimmer.yaml delete mode 100644 common/esphome.yaml delete mode 100644 common/light/gosund_dimmer.yaml delete mode 100644 common/light/tuya_dimmer.yaml delete mode 100644 common/logger/logger_debug.yaml delete mode 100644 common/logger/logger_debug_no_serial.yaml delete mode 100644 common/logger/logger_info.yaml delete mode 100644 common/logger/logger_none.yaml delete mode 100644 common/ota.yaml delete mode 100644 common/output/gosund_dimmer_led.yaml delete mode 100644 common/secrets.yaml delete mode 100644 common/sensor/uptime.yaml delete mode 100644 common/sensor/wifi.yaml delete mode 100644 common/status_led/gosund_dimmer.yaml delete mode 100644 common/switch/restart.yaml delete mode 100644 common/text_sensor/version.yaml delete mode 100644 common/text_sensor/wifi.yaml delete mode 100644 common/uart/gosund_dimmer.yaml delete mode 100644 common/uart/tuya.yaml delete mode 100644 common/wifi.yaml rename TreoLedPoolLight.h => custom/TreoLedPoolLight.h (100%) rename bed_sensor.h => custom/bed_sensor.h (100%) create mode 100644 devices/.gitignore rename basement_bathroom_light_fan.yaml => devices/basement_bathroom_light_fan.yaml (72%) rename basement_bathroom_sensor.yaml => devices/basement_bathroom_sensor.yaml (92%) rename basement_bathroom_shower_light_heater.yaml => devices/basement_bathroom_shower_light_heater.yaml (73%) rename coffee_maker.yaml => devices/coffee_maker.yaml (91%) rename fire_pit_fountain.yaml => devices/fire_pit_fountain.yaml (74%) rename garage_fridge.yaml => devices/garage_fridge.yaml (88%) rename master_bath_fan.yaml => devices/master_bath_fan.yaml (63%) rename master_bath_humidity_temp_sensor.yaml => devices/master_bath_humidity_temp_sensor.yaml (77%) rename master_bed.yaml => devices/master_bed.yaml (90%) rename patio_and_pool_lights.yaml => devices/patio_and_pool_lights.yaml (78%) rename patio_lights.yaml => devices/patio_lights.yaml (50%) rename pool_pumps.yaml => devices/pool_pumps.yaml (95%) rename devices/{scripture_of_the_day_melissa.yaml => scripture_of_the_day.yaml} (100%) create mode 100644 other/example_gosund_dimmer.yaml rename gosund_sw2_dimmer.h => other/gosund_sw2_dimmer.h (100%) diff --git a/.example_gosund_dimmer.yaml b/.example_gosund_dimmer.yaml deleted file mode 100644 index 36a2b2e..0000000 --- a/.example_gosund_dimmer.yaml +++ /dev/null @@ -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" diff --git a/README.md b/README.md index 3bd9972..509c7b7 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/common/api.yaml b/common/api.yaml deleted file mode 100644 index 1a735dc..0000000 --- a/common/api.yaml +++ /dev/null @@ -1,3 +0,0 @@ -api: - password: ${api_pwd} - \ No newline at end of file diff --git a/common/binary_sensor/day_night.yaml b/common/binary_sensor/day_night.yaml deleted file mode 100644 index 7457f85..0000000 --- a/common/binary_sensor/day_night.yaml +++ /dev/null @@ -1,3 +0,0 @@ -platform: homeassistant -id: day_night -entity_id: input_boolean.day_night diff --git a/common/binary_sensor/gosund_dimmer_button.yaml b/common/binary_sensor/gosund_dimmer_button.yaml deleted file mode 100644 index 963fbe2..0000000 --- a/common/binary_sensor/gosund_dimmer_button.yaml +++ /dev/null @@ -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 diff --git a/common/binary_sensor/status.yaml b/common/binary_sensor/status.yaml deleted file mode 100644 index c339cbc..0000000 --- a/common/binary_sensor/status.yaml +++ /dev/null @@ -1,2 +0,0 @@ -platform: status -name: ${device_name} Status \ No newline at end of file diff --git a/common/common.yaml b/common/common.yaml deleted file mode 100644 index d892ae6..0000000 --- a/common/common.yaml +++ /dev/null @@ -1,3 +0,0 @@ -<<: !include wifi.yaml -<<: !include api.yaml -<<: !include ota.yaml \ No newline at end of file diff --git a/common/common_gosund_dimmer.yaml b/common/common_gosund_dimmer.yaml deleted file mode 100644 index edc6f23..0000000 --- a/common/common_gosund_dimmer.yaml +++ /dev/null @@ -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 diff --git a/common/esphome.yaml b/common/esphome.yaml deleted file mode 100644 index b545211..0000000 --- a/common/esphome.yaml +++ /dev/null @@ -1,5 +0,0 @@ -name: ${device_id} -platform: ${platform} -board: ${board} -arduino_version: latest -build_path: build/${device_id} \ No newline at end of file diff --git a/common/light/gosund_dimmer.yaml b/common/light/gosund_dimmer.yaml deleted file mode 100644 index 74840bb..0000000 --- a/common/light/gosund_dimmer.yaml +++ /dev/null @@ -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} diff --git a/common/light/tuya_dimmer.yaml b/common/light/tuya_dimmer.yaml deleted file mode 100644 index e170f16..0000000 --- a/common/light/tuya_dimmer.yaml +++ /dev/null @@ -1,7 +0,0 @@ -platform: "tuya" -id: tuya_light -name: ${device_name} -dimmer_datapoint: 2 -switch_datapoint: 1 -min_value: 0 -max_value: 1000 diff --git a/common/logger/logger_debug.yaml b/common/logger/logger_debug.yaml deleted file mode 100644 index 35e6ada..0000000 --- a/common/logger/logger_debug.yaml +++ /dev/null @@ -1,2 +0,0 @@ -logger: - level: DEBUG \ No newline at end of file diff --git a/common/logger/logger_debug_no_serial.yaml b/common/logger/logger_debug_no_serial.yaml deleted file mode 100644 index 81bed9f..0000000 --- a/common/logger/logger_debug_no_serial.yaml +++ /dev/null @@ -1,3 +0,0 @@ -logger: - level: DEBUG - baud_rate: 0 \ No newline at end of file diff --git a/common/logger/logger_info.yaml b/common/logger/logger_info.yaml deleted file mode 100644 index 2a24094..0000000 --- a/common/logger/logger_info.yaml +++ /dev/null @@ -1,2 +0,0 @@ -logger: - level: INFO \ No newline at end of file diff --git a/common/logger/logger_none.yaml b/common/logger/logger_none.yaml deleted file mode 100644 index 1a657ab..0000000 --- a/common/logger/logger_none.yaml +++ /dev/null @@ -1,3 +0,0 @@ -logger: - level: NONE - baud_rate: 0 \ No newline at end of file diff --git a/common/ota.yaml b/common/ota.yaml deleted file mode 100644 index 20330d6..0000000 --- a/common/ota.yaml +++ /dev/null @@ -1,2 +0,0 @@ -ota: - password: ${ota_pwd} diff --git a/common/output/gosund_dimmer_led.yaml b/common/output/gosund_dimmer_led.yaml deleted file mode 100644 index e755e40..0000000 --- a/common/output/gosund_dimmer_led.yaml +++ /dev/null @@ -1,5 +0,0 @@ -platform: gpio -id: gosund_dimmer_led -pin: - number: GPIO13 - inverted: true diff --git a/common/secrets.yaml b/common/secrets.yaml deleted file mode 100644 index 257cb74..0000000 --- a/common/secrets.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include ../secrets.yaml \ No newline at end of file diff --git a/common/sensor/uptime.yaml b/common/sensor/uptime.yaml deleted file mode 100644 index a86656e..0000000 --- a/common/sensor/uptime.yaml +++ /dev/null @@ -1,2 +0,0 @@ -platform: uptime -name: ${device_name} Uptime diff --git a/common/sensor/wifi.yaml b/common/sensor/wifi.yaml deleted file mode 100644 index 3ce38eb..0000000 --- a/common/sensor/wifi.yaml +++ /dev/null @@ -1,2 +0,0 @@ -platform: wifi_signal -name: ${device_name} WiFi Signal diff --git a/common/status_led/gosund_dimmer.yaml b/common/status_led/gosund_dimmer.yaml deleted file mode 100644 index 6bdb50d..0000000 --- a/common/status_led/gosund_dimmer.yaml +++ /dev/null @@ -1,4 +0,0 @@ -status_led: - pin: - number: GPIO12 - inverted: true diff --git a/common/switch/restart.yaml b/common/switch/restart.yaml deleted file mode 100644 index 02f87f0..0000000 --- a/common/switch/restart.yaml +++ /dev/null @@ -1,3 +0,0 @@ -platform: restart -id: reboot -name: Restart ${device_name} \ No newline at end of file diff --git a/common/text_sensor/version.yaml b/common/text_sensor/version.yaml deleted file mode 100644 index cc80131..0000000 --- a/common/text_sensor/version.yaml +++ /dev/null @@ -1,2 +0,0 @@ -platform: version -name: ${device_name} Version \ No newline at end of file diff --git a/common/text_sensor/wifi.yaml b/common/text_sensor/wifi.yaml deleted file mode 100644 index cc41a53..0000000 --- a/common/text_sensor/wifi.yaml +++ /dev/null @@ -1,4 +0,0 @@ -platform: wifi_info -ip_address: - name: ${device_name} IP Address - icon: mdi:ip-network \ No newline at end of file diff --git a/common/uart/gosund_dimmer.yaml b/common/uart/gosund_dimmer.yaml deleted file mode 100644 index e114999..0000000 --- a/common/uart/gosund_dimmer.yaml +++ /dev/null @@ -1,4 +0,0 @@ -id: gosund_uart -rx_pin: GPIO3 -tx_pin: GPIO1 -baud_rate: 115200 diff --git a/common/uart/tuya.yaml b/common/uart/tuya.yaml deleted file mode 100644 index ad78c6f..0000000 --- a/common/uart/tuya.yaml +++ /dev/null @@ -1,3 +0,0 @@ -rx_pin: GPIO3 -tx_pin: GPIO1 -baud_rate: 9600 diff --git a/common/wifi.yaml b/common/wifi.yaml deleted file mode 100644 index 5fed11c..0000000 --- a/common/wifi.yaml +++ /dev/null @@ -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: \ No newline at end of file diff --git a/TreoLedPoolLight.h b/custom/TreoLedPoolLight.h similarity index 100% rename from TreoLedPoolLight.h rename to custom/TreoLedPoolLight.h diff --git a/bed_sensor.h b/custom/bed_sensor.h similarity index 100% rename from bed_sensor.h rename to custom/bed_sensor.h diff --git a/devices/.gitignore b/devices/.gitignore new file mode 100644 index 0000000..0bbf89c --- /dev/null +++ b/devices/.gitignore @@ -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 diff --git a/basement_bathroom_light_fan.yaml b/devices/basement_bathroom_light_fan.yaml similarity index 72% rename from basement_bathroom_light_fan.yaml rename to devices/basement_bathroom_light_fan.yaml index 2ae6738..fc7b6ba 100644 --- a/basement_bathroom_light_fan.yaml +++ b/devices/basement_bathroom_light_fan.yaml @@ -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 \ No newline at end of file diff --git a/basement_bathroom_sensor.yaml b/devices/basement_bathroom_sensor.yaml similarity index 92% rename from basement_bathroom_sensor.yaml rename to devices/basement_bathroom_sensor.yaml index 2ea8cd9..4cb8591 100644 --- a/basement_bathroom_sensor.yaml +++ b/devices/basement_bathroom_sensor.yaml @@ -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 \ No newline at end of file diff --git a/basement_bathroom_shower_light_heater.yaml b/devices/basement_bathroom_shower_light_heater.yaml similarity index 73% rename from basement_bathroom_shower_light_heater.yaml rename to devices/basement_bathroom_shower_light_heater.yaml index 33505c3..80056c0 100644 --- a/basement_bathroom_shower_light_heater.yaml +++ b/devices/basement_bathroom_shower_light_heater.yaml @@ -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 \ No newline at end of file diff --git a/coffee_maker.yaml b/devices/coffee_maker.yaml similarity index 91% rename from coffee_maker.yaml rename to devices/coffee_maker.yaml index 812fd9a..980d900 100644 --- a/coffee_maker.yaml +++ b/devices/coffee_maker.yaml @@ -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 diff --git a/fire_pit_fountain.yaml b/devices/fire_pit_fountain.yaml similarity index 74% rename from fire_pit_fountain.yaml rename to devices/fire_pit_fountain.yaml index 8dff9b9..71fd4c8 100644 --- a/fire_pit_fountain.yaml +++ b/devices/fire_pit_fountain.yaml @@ -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 \ No newline at end of file diff --git a/garage_fridge.yaml b/devices/garage_fridge.yaml similarity index 88% rename from garage_fridge.yaml rename to devices/garage_fridge.yaml index 6161c47..354bfc0 100644 --- a/garage_fridge.yaml +++ b/devices/garage_fridge.yaml @@ -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 \ No newline at end of file diff --git a/master_bath_fan.yaml b/devices/master_bath_fan.yaml similarity index 63% rename from master_bath_fan.yaml rename to devices/master_bath_fan.yaml index 33286cc..aae7d93 100644 --- a/master_bath_fan.yaml +++ b/devices/master_bath_fan.yaml @@ -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 \ No newline at end of file diff --git a/master_bath_humidity_temp_sensor.yaml b/devices/master_bath_humidity_temp_sensor.yaml similarity index 77% rename from master_bath_humidity_temp_sensor.yaml rename to devices/master_bath_humidity_temp_sensor.yaml index 051aec4..cda46f5 100644 --- a/master_bath_humidity_temp_sensor.yaml +++ b/devices/master_bath_humidity_temp_sensor.yaml @@ -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 \ No newline at end of file diff --git a/master_bed.yaml b/devices/master_bed.yaml similarity index 90% rename from master_bed.yaml rename to devices/master_bed.yaml index e3dd791..1dc5f53 100644 --- a/master_bed.yaml +++ b/devices/master_bed.yaml @@ -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 diff --git a/patio_and_pool_lights.yaml b/devices/patio_and_pool_lights.yaml similarity index 78% rename from patio_and_pool_lights.yaml rename to devices/patio_and_pool_lights.yaml index 146c2ae..866ffcd 100644 --- a/patio_and_pool_lights.yaml +++ b/devices/patio_and_pool_lights.yaml @@ -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 \ No newline at end of file diff --git a/patio_lights.yaml b/devices/patio_lights.yaml similarity index 50% rename from patio_lights.yaml rename to devices/patio_lights.yaml index 5f5983e..104f858 100644 --- a/patio_lights.yaml +++ b/devices/patio_lights.yaml @@ -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 \ No newline at end of file diff --git a/pool_pumps.yaml b/devices/pool_pumps.yaml similarity index 95% rename from pool_pumps.yaml rename to devices/pool_pumps.yaml index 26a2065..53081dd 100644 --- a/pool_pumps.yaml +++ b/devices/pool_pumps.yaml @@ -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 diff --git a/devices/scripture_of_the_day_melissa.yaml b/devices/scripture_of_the_day.yaml similarity index 100% rename from devices/scripture_of_the_day_melissa.yaml rename to devices/scripture_of_the_day.yaml diff --git a/other/example_gosund_dimmer.yaml b/other/example_gosund_dimmer.yaml new file mode 100644 index 0000000..2eb43c0 --- /dev/null +++ b/other/example_gosund_dimmer.yaml @@ -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" diff --git a/gosund_sw2_dimmer.h b/other/gosund_sw2_dimmer.h similarity index 100% rename from gosund_sw2_dimmer.h rename to other/gosund_sw2_dimmer.h