ECO Shower timer

This blueprints helps to save energy and water by reminding you about the shower time. This is done by blinking the light when you are showering longer than the shower time. Optional showering detection can be done by using a hygrostat after being triggered by the light switch.

  • Shower detection by watching the hygrostat or hygrostatic ventilator to avoid blinking when not showering
  • Configurable reminder blinks after the first blink
  • You can set the average time between switching the light on and the moment the hygrostat or ventilator turns on.

Entities used

  • switch for the light

Optional entities

  • Hygrostat sensor (binary sensor turns on when the moist level is too high, often already used for the bathroom fan)
  • Shower time helper (You could create a numeric helper for adjusting the maximum shower time from the UI)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

blueprint:
  name: ECO shower timer
  description: >
    Helps to save energy and water by limit the time you are showering
    This is done by blinking the light when you are showering longer than the shower time.
  domain: automation
  input:
    light_switch:
      name: Light to switch
      description: 'Bathroom light switch that will be used to blink the light'
      selector:
        entity:
          domain: switch
    shower_time_helper:
      name: (Optional) Shower time helper
      description: 'Helper numeric input entity that can be used to dynamically adjust the maximum shower time from the UI.' 
      selector:
        entity:
          domain: input_number
    hygrostat_sensor:
      name: (Optional) Hygrostat sensor
      description: 'Binary hygrostat sensor that turns on when the moist level is too high.' 
      selector:
        entity:
          domain: binary_sensor
    cfg_start_delay:
      name: Start delay
      description: 'Average time between switching on the lights and actual showering.'    
      default: 30
      selector:
        number:
          min: 0
          max: 300
          step: 10
          unit_of_measurement: 'sec'
    cfg_shower_time:
      name: Default showertime
      description: 'Shower time in minutes. (will be overwritten if timer helper is defined)'
      default: 3
      selector:
        number:
          min: 1
          max: 15
          step: 0.5
          unit_of_measurement: 'min'
    cfg_blink_speed:
      name: Blink duration
      description: 'Defines the time (in ms) the light will be switched off for a blink'
      default: 150
      selector:
        number:
          min: 25
          max: 500
          step: 25
          unit_of_measurement: 'ms'
    cfg_reminder_cycle:
      name: Number of blinks
      default: 2
      selector:
        number:
          min: 1
          max: 5
          step: 1
    cfg_reminder_wait_time:
      name: Time between blinks
      description: 'Defines the time in minutes between blinks'
      default: 3
      selector:
        number:
          min: 0.5
          max: 5
          step: 0.5
          unit_of_measurement: min
mode: single
variables:
  light_switch: !input 'light_switch'
  cfg_start_delay: !input cfg_start_delay
  start_delay: '{{ states(cfg_start_delay) | int(0) / 60 }}'
  hygrostat: !input hygrostat_sensor
  timer_value: !input cfg_shower_time 
  timer_helper: !input shower_time_helper
  cfg_blink_cycle: !input cfg_reminder_cycle 
  cfg_reminder_blink_speed: !input cfg_reminder_wait_time 
  cfg_reminder_wait: !input cfg_reminder_wait_time
  blink_cycle: '{{ states(cfg_blink_cycle) | int(0) }}'
  blink_speed: '{{ states(cfg_reminder_blink_speed) | int(0) }}'
  blink_wait: '{{ states(cfg_reminder_wait) | int(0) }}'
trigger:
  - platform: state
    entity_id: !input 'light_switch'
    to: 'on'
    for:
      milliseconds: 500
    from: 'off'    
condition: []
action:
  - delay: 
      minutes: >-
        {% if timer_helper != none -%}{{ states("timer_helper") | int(0) + start_delay }} 
        {%- else -%}{{ states("timer_value") | int(0) + start_delay }}{%- endif %}
  - condition: template
    value_template: >
      {% if hygrostat != none -%}{{ states(hygostat) }}
      {%- else -%} true {%- endif %}      
  - repeat:
      count: '{{ blink_cycle }}'
      sequence:
        - service: switch.turn_off
          data:
            entity_id: '{{ light_switch }}'
        - delay:
            milliseconds: '{{ blink_speed | int(0) }}'
        - service: switch.turn_on
          data:
            entity_id: '{{ light_switch }}'
        - delay:
            milliseconds: '{{ blink_speed | int(0) * 2 }}'
        - service: switch.turn_on
          data:
            entity_id: '{{ light_switch }}'
        - delay:
            minutes: '{{ blink_wait }}'

Please tell me what you think of it…

1 Like

I can’t import it because of this unknown error:

I am sorry. Just added some comments but that did cause the problem. Removed the comments now

@pdwonline This is an amazing blueprint. The only problem is that I can’t get it to work for some reason.

  1. When setting up the automation it requires the shower timer helper to be made, however this is indicated as optional.
  2. I created the automation but it does not work and when I go back to the automation list and it does not show up there. I am not sure why it is only in the yaml file but not in the UI list.

Found some issues and made an update. Should work now!