Add front and living room lights

Add master bath fan, second light dimmer, and temp/humidity sensor
Fix occasional issue with tripping the over current on the pool pumps
This commit is contained in:
ChNussbaum 2020-09-22 15:49:55 -05:00
parent 830fcb5006
commit fc5873c2cf
8 changed files with 241 additions and 38 deletions

View File

@ -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"

View File

@ -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

15
front_lights.yaml Normal file
View File

@ -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

View File

@ -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

56
master_bath_fan.yaml Normal file
View File

@ -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

View File

@ -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

15
master_bath_lights_2.yaml Normal file
View File

@ -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

View File

@ -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: