diff --git a/.example_gosund_dimmer.yaml b/.example_gosund_dimmer.yaml new file mode 100644 index 0000000..36a2b2e --- /dev/null +++ b/.example_gosund_dimmer.yaml @@ -0,0 +1,44 @@ +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 3a9d64d..a365667 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,10 @@ ## Switches > I plan to use dimmer switches for anything that is dimmable just for consistency and you never know when you might want to have the ability to dim a light. However there are times when a dimmer isn't an option. +> ### [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 + > ### [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 @@ -64,5 +68,5 @@ > > * Family Room Light > > * Kitchen Bar Lights > > * Kitchen Table Light -> > * Master Bathroom Lights +> > * Master Bathroom Lights/Master Bathroom Lights 2 > > * Office Light diff --git a/front_lights.yaml b/front_lights.yaml new file mode 100644 index 0000000..f0ce38c --- /dev/null +++ b/front_lights.yaml @@ -0,0 +1,15 @@ +substitutions: + device_id: front_lights + device_name: Front Lights + platform: ESP8266 + board: esp01_1m + ip_address: !secret front_lights_ip + ota_pwd: !secret front_lights_ota_pwd + api_pwd: !secret front_lights_api_pwd + ap_wifi_pwd: !secret front_lights_ap_wifi_pwd + day_brightness: "1" + night_brightness: "1" + night_auto_off_time: 15min + linked_lights: "" + +<<: !include common/device_tuya_dimmer.yaml diff --git a/living_room_lights.yaml b/living_room_lights.yaml index f7fbab1..e76027a 100644 --- a/living_room_lights.yaml +++ b/living_room_lights.yaml @@ -7,38 +7,9 @@ substitutions: ota_pwd: !secret living_room_lights_ota_pwd api_pwd: !secret living_room_lights_api_pwd ap_wifi_pwd: !secret living_room_lights_ap_wifi_pwd + day_brightness: "1" + night_brightness: ".03" + night_auto_off_time: 15min + linked_lights: "" - 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" +<<: !include common/device_tuya_dimmer.yaml diff --git a/master_bath_fan.yaml b/master_bath_fan.yaml new file mode 100644 index 0000000..33286cc --- /dev/null +++ b/master_bath_fan.yaml @@ -0,0 +1,56 @@ +substitutions: + device_id: master_bath_fan + device_name: Master Bathroom Fan + platform: ESP8266 + board: esp01_1m + ip_address: !secret master_bath_fan_ip + ota_pwd: !secret master_bath_fan_ota_pwd + 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 + +binary_sensor: + - !include common/binary_sensor/status.yaml + - platform: gpio + id: fan_button + pin: + number: 13 + mode: INPUT_PULLUP + on_press: + then: + - fan.toggle: the_fan + +fan: + - platform: binary + id: the_fan + output: fan_output + name: ${device_name} + +output: + - platform: gpio + id: fan_output + pin: 12 + - platform: gpio + 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/master_bath_humidity_temp_sensor.yaml new file mode 100644 index 0000000..051aec4 --- /dev/null +++ b/master_bath_humidity_temp_sensor.yaml @@ -0,0 +1,74 @@ +substitutions: + device_id: master_bath_humidity_temp_sensor + device_name: Master Bathroom Humidity and Temperature Sensor + platform: ESP8266 + board: d1_mini + ip_address: !secret master_bath_humidity_temp_sensor_ip + ota_pwd: !secret master_bath_humidity_temp_sensor_ota_pwd + 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 + +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 + +output: + - platform: gpio + pin: D3 + id: bme_gnd + +sensor: + - !include common/sensor/uptime.yaml + - !include common/sensor/wifi.yaml + - platform: bme280 + temperature: + id: temperature + name: "Master Bathroom Temperature" + pressure: + id: pressure + name: "Master Bathroom Pressure" + humidity: + id: humidity + name: "Master Bathroom Humidity" + address: 0x76 + update_interval: 15s + - platform: template + name: "Master Bathroom Median Humidity" + id: median_humidity + unit_of_measurement: '%' + icon: mdi:water-percent + lambda: return id(humidity).state; + update_interval: 60s + filters: + - median: + window_size: 360 + send_every: 2 + send_first_at: 2 + +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_bath_lights_2.yaml b/master_bath_lights_2.yaml new file mode 100644 index 0000000..e82cbd4 --- /dev/null +++ b/master_bath_lights_2.yaml @@ -0,0 +1,15 @@ +substitutions: + device_id: master_bath_lights_2 + device_name: Master Bathroom Lights 2 + platform: ESP8266 + board: esp01_1m + ip_address: !secret master_bath_lights_2_ip + ota_pwd: !secret master_bath_lights_2_ota_pwd + api_pwd: !secret master_bath_lights_2_api_pwd + ap_wifi_pwd: !secret master_bath_lights_2_ap_wifi_pwd + day_brightness: "1" + night_brightness: ".05" + night_auto_off_time: 15min + linked_lights: "" + +<<: !include common/device_tuya_dimmer.yaml diff --git a/pool_pumps.yaml b/pool_pumps.yaml index 572fafd..26a2065 100644 --- a/pool_pumps.yaml +++ b/pool_pumps.yaml @@ -32,15 +32,39 @@ sensor: current_a: name: Pool Cleaner Current filters: - - lambda: "return x < .1 ? 0 : x;" + - lambda: |- + // Filter the initial high current spike when the motor starts to prevent tripping the on_value_range logic + static float last_cleaner_current = 0.0; + if (isnan(x)) + { + return {}; + } + if (last_cleaner_current <= 7 && x > 7) + { + last_cleaner_current = x; + return {}; + } + return last_cleaner_current = x < .1 ? 0.0 : x; on_value_range: - above: 10 + above: 7 then: - switch.turn_off: pool_cleaner current_b: name: Pool Pump Current filters: - - lambda: "return x < .1 ? 0 : x;" + - lambda: |- + // Filter the initial high current spike when the motor starts to prevent tripping the on_value_range logic + static float last_pump_current = 0.0; + if (isnan(x)) + { + return {}; + } + if (last_pump_current <= 8 && x > 8) + { + last_pump_current = x; + return {}; + } + return last_pump_current = x < .1 ? 0.0 : x; on_value_range: above: 8 then: