From 3d1d211ce9292defd0bd624a1e0f091700f618d7 Mon Sep 17 00:00:00 2001 From: ChNussbaum Date: Tue, 4 Feb 2020 22:04:48 -0600 Subject: [PATCH] Get all sensors working on basement bathroom sensor --- basement_bathroom_sensor.yaml | 51 ++++++++++++++++++---- basement_bathroom_shower_light_heater.yaml | 8 ++-- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/basement_bathroom_sensor.yaml b/basement_bathroom_sensor.yaml index 07ca1e5..c90b713 100644 --- a/basement_bathroom_sensor.yaml +++ b/basement_bathroom_sensor.yaml @@ -10,24 +10,52 @@ substitutions: esphome: <<: !include common/esphome.yaml + on_boot: + then: + - output.turn_on: motion_pwr <<: !include common/common.yaml <<: !include common/logger/logger.yaml +i2c: + sda: D2 + scl: D1 + scan: true + binary_sensor: - !include common/binary_sensor/status.yaml - platform: gpio name: Basement Bathroom Motion device_class: motion pin: - number: D - mode: INPUT_PULLUP + number: D0 + mode: INPUT_PULLDOWN_16 - platform: gpio name: Basement Bathroom Door device_class: door pin: - number: D + number: D7 mode: INPUT_PULLUP + - platform: homeassistant + id: day_night + entity_id: input_boolean.day_night + - platform: homeassistant + id: shower_light + entity_id: switch.basement_shower_light + +output: + - platform: gpio + pin: D3 + id: bme_gnd + - platform: gpio + pin: D5 + id: motion_gnd + - platform: gpio + pin: D6 + id: motion_pwr + - platform: gpio + pin: D8 + id: door_gnd sensor: - !include common/sensor/uptime.yaml @@ -42,17 +70,24 @@ sensor: humidity: id: humidity name: "Basement Bathroom Humidity" - address: 0x77 - update_interval: 30s + address: 0x76 + update_interval: 15s - platform: template name: "Basement Bathroom Median Humidity" - lambda: return id(humidity).state + unit_of_measurement: '%' + icon: mdi:water-percent + lambda: return id(humidity).state; update_interval: 60s filters: - median: window_size: 360 - send_every: 1 - send_first_at: 1 + send_every: 2 + send_first_at: 2 + +status_led: + pin: + number: D4 + inverted: true switch: - !include common/switch/restart.yaml diff --git a/basement_bathroom_shower_light_heater.yaml b/basement_bathroom_shower_light_heater.yaml index a0009eb..ae1d13f 100644 --- a/basement_bathroom_shower_light_heater.yaml +++ b/basement_bathroom_shower_light_heater.yaml @@ -17,7 +17,7 @@ esphome: binary_sensor: - !include common/binary_sensor/status.yaml - platform: gpio - id: light_toggle + id: light_button pin: number: 12 mode: INPUT_PULLUP @@ -25,7 +25,7 @@ binary_sensor: then: - switch.toggle: light - platform: gpio - id: heater_toggle + id: fan_button pin: number: 3 mode: INPUT_PULLUP @@ -38,7 +38,9 @@ sensor: - !include common/sensor/wifi.yaml status_led: - pin: 0 + pin: + number: 0 + inverted: true switch: - !include common/switch/restart.yaml