Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn on guest bathroom fan when someone's showering #14

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
43e77ca
Initial binary sensor
tetsuo13 Mar 12, 2022
beeb74d
Merge branch 'main' into feature/guest-bathroom-fan-when-showering
tetsuo13 Dec 27, 2022
ca6739f
Fix position and sensor entity for bathroom
tetsuo13 Dec 27, 2022
8ef432e
Merge branch 'main' into feature/guest-bathroom-fan-when-showering
tetsuo13 Jan 13, 2023
9b9c2de
Fix lint error
tetsuo13 Jan 13, 2023
181d589
Merge branch 'main' into feature/guest-bathroom-fan-when-showering
tetsuo13 Feb 23, 2023
deec216
Remove quotes on strings
tetsuo13 Feb 23, 2023
a55a8b8
Try different approach with statistics sensor
tetsuo13 Feb 28, 2023
99e6293
Fix humidity sensor ID
tetsuo13 Mar 1, 2023
353c48b
Document how threshold was derived
tetsuo13 Mar 1, 2023
79a8c31
Move fan-related things together in preparation
tetsuo13 Mar 1, 2023
d8c7881
Fix always evaluating to False because of comments in template
tetsuo13 Mar 2, 2023
d4f182b
More better grammar
tetsuo13 Mar 2, 2023
3ab4700
Add automation to turn on fan, update README for fans automations
tetsuo13 Mar 2, 2023
bc30ead
Simplify trigger
tetsuo13 Mar 3, 2023
31993f1
Rewrite to match consistency in file
tetsuo13 Mar 5, 2023
0287093
Merge branch 'main' into feature/guest-bathroom-fan-when-showering
tetsuo13 Mar 22, 2023
1c472c9
Merge branch 'main' into feature/guest-bathroom-fan-when-showering
tetsuo13 Mar 29, 2023
839f4c6
Merge branch 'main' into feature/guest-bathroom-fan-when-showering
tetsuo13 May 7, 2023
c73140a
Merge branch 'main' into feature/guest-bathroom-fan-when-showering
conorsham Jun 4, 2023
28fb9e3
Merge branch 'main' into feature/guest-bathroom-fan-when-showering
tetsuo13 Jun 4, 2023
bdc6591
Merge branch 'main' into feature/guest-bathroom-fan-when-showering
tetsuo13 Jun 13, 2023
6fa8db2
Merge branch 'main' into feature/guest-bathroom-fan-when-showering
tetsuo13 Jul 30, 2023
2430015
Merge branch 'main' into feature/guest-bathroom-fan-when-showering
tetsuo13 Oct 14, 2024
dfc086a
Merge branch 'main' into feature/guest-bathroom-fan-when-showering
tetsuo13 Oct 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ When a smoke alarm detects smoke or carbon monoxide, an announcement is made ove

Air purifier isn't smart but it's plugged into a Wemo smart plug. Air purifier is intended to run overnight. Automation cuts power in the morning to turn it off and another automation task turns power back on however someone must still manually press the "on" button on the air purifier unit to actually turn it on. Toggling power to the dumb air purifier is preferable to some of the much more expensive smart air purifiers out there.

The guest bathroom fan will turn on when there's motion detected and the humidity level rises more than 10%. It'll stay on until either manually turned off or the next automation triggers.

The guest bathroom fan will turn off after 5 minutes of no motion detected in the room.

## [Light Automations](automation/lights.yaml)

There are automations to gradually fade on bedside lamps on weekday mornings, turn off before leaving for work, gradually fade on again at sundown, and gradually fade off by bedtime. Similar automations to handle outside lights.
Expand Down
16 changes: 16 additions & 0 deletions automation/fans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@
data:
entity_id: switch.wemo_mini_1

# Not considering motion, it's assumed if the shower is running.
- alias: Turn On Guest Bathroom Fan When Someone's Showering
id: turn_on_guest_bathroom_fan_when_someones_showering
triggers:
- trigger: state
entity_id: binary_sensor.someone_is_showering_in_guest_bathroom
to: "on"
for: "00:01:00"
conditions:
- condition: state
entity_id: switch.dimmer_dry_contact_relay
state: "off"
actions:
- action: switch.turn_on
entity_id: switch.dimmer_dry_contact_relay

- alias: Motion - Turn Off Guest Bathroom Fan When No Motion Detected
id: motion_turn_off_guest_bathroom_fan_when_no_motion_detected
triggers:
Expand Down
12 changes: 12 additions & 0 deletions components/packages/binary_sensor.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
# yamllint disable rule:line-length
# https://www.home-assistant.io/integrations/binary_sensor

binary_sensor:
Expand All @@ -20,6 +21,17 @@ binary_sensor:
friendly_name: Today is Someone's Birthday
value_template: !secret birthday_evaluator

# The threshold is fairly arbitrary and unscientific. Based on walking
# into the room, feeling when it's too humid, and referencing the result
# of (humidity - average) at that time.
someone_showering_guest_bathroom:
friendly_name: Someone is Showering in Guest Bathroom
value_template: >
{% set humidity = states("sensor.4_in_1_sensor_humidity") | int(default=0) %}
{% set average = states("sensor.guest_bathroom_humidity_average_over_last_24h") | int(default=0) %}
{% set threshold = 10 %}
{{ (humidity - average) > threshold }}

# Service will return a single object with key "busy" and a boolean value.
# Sensor value to match the boolean value.
# Example payload: {"busy":false}
Expand Down
11 changes: 11 additions & 0 deletions components/packages/sensor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# https://www.home-assistant.io/integrations/statistics

sensor:
- platform: statistics
name: Guest Bathroom Humidity Average Over Last 24h
entity_id: sensor.4_in_1_sensor_humidity
state_characteristic: average_linear
max_age:
hours: 24