Hi,
For more than a year I’m using this shower timer automation and we love it. It is an automation which is not complicated and the idea maybe also not. But in the theme of " parents helping each other…" I share this.
Why…
We have two kids, now 4 and 9 years old. They LOVE the shower. The longer, the better. (same as the parents ) … But a long shower is wasting a lot of water and a lot of energy.
For years we had every evening discussions about the time to stop the shower. Twice.
Then I made this automation.
When they start the shower, they push the button. A green light give confirmation that the automation/shower has started. After 3 minutes there is a short orange light. Which means: If you stil have shampoo in your hair, you have 1 minute to clean it al out!
One minute later there is a red light. This means: stop the shower.
Yeah… sounds simple… But it appears that the message of the light is way more powerful than the message of the parents…
And of course, this automation works for us as parents aswel.
How
It is a simple automation. Tigger-condition-action.
Trigger: You can use what you want. I use a button. (zigbee with deconz/conbee)
Condition: I have 2 different conditions to because I want a different " in between" light when I shower in the morning (more blue light) then when I shower in the evening and weekend (more yellow/red light).
Action: The action starts the sequence of lights. I recently did put the sequence in a script. Because when the kids push in a short time more then once on the button, it wil reset the first push (automation) instead of having two automations controlling the same light at one moment…
"eco-system"
Because I have a few more automations in my bathroom, all related to the motion sensor, this sensor needs to be put in a “pause” during the shower. It did this with a input_boolean. I also cancel the timers which are running when the shower-button is pushed.
extra’s…
When you push the same button twice (the aqara button can sent 4 different codes by pushing 1, 2, 3 of 4 times the button) It wil activate a automation which doubles the shower time. (my kids don’t know about this. My wife does. I think this is called the WAF-factor?
Also made as a test a color therapy automation. This is just a few different colors behind each other. Still have to make this one better.
I share the yaml of this automation and also of the rest of my bathroom, so you can understand the context.
in automation:
- id: automation 9bcdef
alias: douchen01 ochtend start
initial_state: 'on'
trigger:
platform: event
event_type: deconz_event
event_data:
id: knop_vrij
event: 1002
condition:
- condition: time
after: '06:00:00'
before: '09:00:00'
action:
- service: notify.pushberichten
data:
message: "start douche ochtend"
title: "knop"
target: ""
# Cancel ev. old timers
- service: script.turn_off
data:
entity_id: script.douchen01, script.douchen02, script.douchen03, script.douchen04, script.timer_off8b, script.timer_off8bb
- service: script.turn_on
data:
entity_id: script.douchen01
- id: automation 99befg
alias: douchen avond start
initial_state: 'on'
trigger:
platform: event
event_type: deconz_event
event_data:
id: knop_vrij
event: 1002
condition:
- condition: time
after: '09:00:01'
before: '05:59:59'
action:
- service: notify.pushberichten
data:
message: "start douche avond"
title: "knop"
target: ""
# Cancel ev. old timers
- service: script.turn_off
data:
entity_id: script.douchen01, script.douchen02, script.douchen03, script.douchen04, script.timer_off8b, script.timer_off8bb
- service: script.turn_on
data:
entity_id: script.douchen02
- id: automation 99befgf
alias: douchen avond start dubbel
initial_state: 'on'
trigger:
platform: event
event_type: deconz_event
event_data:
id: knop_vrij
event: 1004
condition:
- condition: time
after: '09:00:01'
before: '05:59:00'
action:
- service: notify.pushberichten
data:
message: "start douche avond dubbel"
title: "knop"
target: ""
# Cancel ev. old timers
- service: script.turn_off
data:
entity_id: script.douchen01, script.douchen02, script.douchen03, script.douchen04, script.timer_off8b, script.timer_off8bb
- service: script.turn_on
data:
entity_id: script.douchen03
##### codes/events knop ######
# 1002 One single short press
# 1004 One double short press
# 1005 One triple short press
# 1006 One quad short press
- id: automation 99befgfeg
alias: douchen kleurentherapie
initial_state: 'on'
trigger:
platform: event
event_type: deconz_event
event_data:
id: knop_vrij
event: 1006
action:
- service: notify.pushberichten
data:
message: "start douche kleurentherapie"
title: "knop"
target: ""
# Cancel ev. old timers
- service: script.turn_off
data:
entity_id: script.douchen01, script.douchen02, script.douchen03, script.douchen04, script.timer_off8b, script.timer_off8bb
- service: script.turn_on
data:
entity_id: script.douchen04
In script:
#####
#scripts douchen
###############
douchen01:
alias: "douchen ochend"
sequence:
- service: homeassistant.turn_on
entity_id: input_boolean.douchen
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [235,255,67]
brightness: 254
- delay: '00:00:05'
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 254
color_temp: 156
- delay: '00:03:00'
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [255,145,38]
brightness: 254
- delay: '00:00:10'
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 254
color_temp: 156
- delay: '00:01:00'
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [255,0,0]
brightness: 254
- delay: '00:00:30'
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 254
color_temp: 156
- service: homeassistant.turn_off
entity_id: input_boolean.douchen
# - service: homeassistant.turn_on
# entity_id: script.timed_lamp8b
douchen02:
alias: "douchen avond"
sequence:
- service: homeassistant.turn_on
entity_id: input_boolean.douchen
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [235,255,67]
brightness: 254
- delay: '00:00:05'
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 254
color_temp: 447
- delay: '00:03:00'
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [255,145,38]
brightness: 254
- delay: '00:00:10'
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 254
color_temp: 447
- delay: '00:01:00'
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [255,0,0]
brightness: 254
- delay: '00:00:30'
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 254
color_temp: 447
- service: homeassistant.turn_off
entity_id: input_boolean.douchen
# - service: homeassistant.turn_on
# entity_id: script.timed_lamp8b
douchen03:
alias: "douchen avond start dubbel"
sequence:
- service: homeassistant.turn_on
entity_id: input_boolean.douchen
- service: homeassistant.turn_on
entity_id: input_boolean.douchen
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [255,58,191]
brightness: 254
- delay: '00:00:05'
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 254
color_temp: 447
- delay: '00:14:00'
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [255,145,38]
brightness: 254
- delay: '00:00:10'
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 254
color_temp: 447
- delay: '00:01:00'
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [255,0,0]
brightness: 254
- delay: '00:00:30'
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 254
color_temp: 447
- service: homeassistant.turn_off
entity_id: input_boolean.douchen
# - service: homeassistant.turn_on
# entity_id: script.timed_lamp8b
douchen04:
alias: "douchen kleurentherapie"
sequence:
- service: homeassistant.turn_on
entity_id: input_boolean.douchen
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [255,58,191]
brightness: 254
- delay: '00:00:05'
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [255,0,0]
brightness: 254
- delay: '00:01:00'
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [255,189,46]
brightness: 254
- delay: '00:01:00'
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [0,0,255]
brightness: 254
- delay: '00:01:00'
- service: light.turn_on
data:
entity_id: light.badkamer01
rgb_color: [0,255,0]
brightness: 254
- delay: '00:01:00'
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 200
color_temp: 447
- service: homeassistant.turn_off
entity_id: input_boolean.douchen
# - service: homeassistant.turn_on
# entity_id: script.timed_lamp8b
context of automations in my bathroom:
# Badkamer
- id: automation 24b
alias: wakker worden badkamer door de week1
trigger:
- platform: state
entity_id: binary_sensor.beweging_badkamer01
to: 'on'
condition:
condition: and
conditions:
- condition: time
after: '06:00:01'
before: '09:00:00'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: state
entity_id: input_boolean.douchen
state: 'off'
action:
# Cancel ev. old timers
- service: script.turn_off
data:
entity_id: script.timer_off8b
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 254
color_temp: 156
#rgb_color: [255, 230, 192]
- id: automation 24bb
alias: wakker worden badkamer door de week2
trigger:
- platform: state
entity_id: binary_sensor.beweging_badkamer01
to: 'off'
condition:
condition: and
conditions:
- condition: time
after: '06:00:01'
before: '09:00:00'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: state
entity_id: input_boolean.douchen
state: 'off'
action:
service: homeassistant.turn_on
entity_id: script.timed_lamp8b
- id: automation 24bbb
alias: wakker worden badkamer weekend1
trigger:
- platform: state
entity_id: binary_sensor.beweging_badkamer01
to: 'on'
condition:
condition: and
conditions:
- condition: time
after: '06:00:01'
before: '09:00:00'
- condition: time
weekday:
- sat
- sun
- condition: state
entity_id: input_boolean.douchen
state: 'off'
action:
# Cancel ev. old timers
- service: script.turn_off
data:
entity_id: script.timer_off8b
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 240
color_temp: 346
#rgb_color: [255, 204, 127]
- id: automation 24bbbb
alias: wakker worden badkamer weekend2
trigger:
- platform: state
entity_id: binary_sensor.beweging_badkamer01
to: 'off'
condition:
condition: and
conditions:
- condition: time
after: '06:00:01'
before: '09:00:00'
- condition: time
weekday:
- sat
- sun
- condition: state
entity_id: input_boolean.douchen
state: 'off'
action:
service: homeassistant.turn_on
entity_id: script.timed_lamp3b
- id: automation 11b
alias: overdag badkamer1
trigger:
- platform: state
entity_id: binary_sensor.beweging_badkamer01
to: 'on'
condition:
condition: and
conditions:
- condition: time
after: '09:00:01'
before: '20:00:00'
- condition: state
entity_id: input_boolean.douchen
state: 'off'
action:
# Cancel ev. old timers
- service: script.turn_off
data:
entity_id: script.timer_off8bb, script.timer_off8b
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 240
color_temp: 346
#rgb_color: [255, 204, 127]
- id: automation 11bb
alias: overdag badkamer2
trigger:
- platform: state
entity_id: binary_sensor.beweging_badkamer01
to: 'off'
condition:
condition: and
conditions:
- condition: time
after: '09:00:01'
before: '20:00:00'
- condition: state
entity_id: input_boolean.douchen
state: 'off'
action:
service: homeassistant.turn_on
entity_id: script.timed_lamp3b
- id: automation 26a
alias: avond badkamer1
trigger:
- platform: state
entity_id: binary_sensor.beweging_badkamer01
to: 'on'
condition:
condition: and
conditions:
- condition: time
after: '20:00:01'
before: '23:00:00'
- condition: state
entity_id: input_boolean.douchen
state: 'off'
action:
# Cancel ev. old timers
- service: script.turn_off
data:
entity_id: script.timer_off8b
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 210
color_temp: 447
#rgb_color: [250, 179, 80]
- id: automation 26aa
alias: avond badkamer2
trigger:
- platform: state
entity_id: binary_sensor.beweging_badkamer01
to: 'off'
condition:
condition: and
conditions:
- condition: time
after: '20:00:01'
before: '23:00:00'
- condition: state
entity_id: input_boolean.douchen
state: 'off'
action:
service: homeassistant.turn_on
entity_id: script.timer_off8b
- id: automation 26bbb
alias: nacht badkamer1
trigger:
- platform: state
entity_id: binary_sensor.beweging_badkamer01
to: 'on'
condition:
condition: and
conditions:
- condition: time
after: '23:00:01'
before: '06:00:00'
- condition: state
entity_id: input_boolean.douchen
state: 'off'
action:
# Cancel ev. old timers
- service: script.turn_off
data:
entity_id: script.timer_off8b, script.timer_off8bb
- service: light.turn_on
data:
entity_id: light.badkamer01
brightness: 150
#color_temp: 500
rgb_color: [255,0,0]
- id: automation 26bb
alias: nacht badkamer2
trigger:
- platform: state
entity_id: binary_sensor.beweging_badkamer01
to: 'off'
condition:
condition: and
conditions:
- condition: time
after: '23:00:01'
before: '06:00:00'
- condition: state
entity_id: input_boolean.douchen
state: 'off'
action:
service: homeassistant.turn_on
entity_id: script.timer_off8b
scripts:
# scripts Badkamer
timed_lamp8b:
alias: "badkamer wakker worden timer"
sequence:
# Cancel ev. old timers
- service: script.turn_off
data:
entity_id: script.timer_off8b
# - service: light.turn_on
# data:
# entity_id: light.badkamer01
# brightness: 254
# color_temp: 156
#rgb_color: [255, 230, 192]
# Set new timer
- service: script.turn_on
data:
entity_id: script.timer_off8b
timer_off8b:
alias: "lamp uit na 2 minuten badkamer"
sequence:
- delay:
minutes: 2
- service: light.turn_off
data:
entity_id: light.badkamer01
timer_off8bb:
alias: "lamp uit na 30 seconden badkamer"
sequence:
- delay:
seconds: 30
- service: light.turn_off
data:
entity_id: light.badkamer01
timed_lamp3b:
alias: "badkamer overdag"
sequence:
# Cancel ev. old timers
- service: script.turn_off
data:
entity_id: script.timer_off8bb
# - service: light.turn_on
# data:
# entity_id: light.badkamer01
# brightness: 240
# color_temp: 346
# #rgb_color: [255, 204, 127]
# Set new timer
- service: script.turn_on
data:
entity_id: script.timer_off8bb
ps. the notify is optional. For me it was to check if this automation works. Now I know when someone starts taking a shower.
**edit 11-2-2020: I made some changes to the script of the shower sequins. You don’t need the last two lines. I also had a little annoying thing in script timed_lamp8b. Made the changes by adding " # " .
used hardware: raspberry pi 3b + raspbee (deconz)
motion sensors: hue and aqara (aliexpress)
lights: hue
software: hassio