🚿 Bathroom Humidity Exhaust Fan

FAQ - How to use the same ‘Fan Switch’ also in ‘Manual Trigger’ or ‘Manual Fan Switch’

I have a new blueprint :stop_button: Manual Control Status Tracker that will work better than a template binary sensor. Check this out first and I will update this FAQ when I get time.

If your wall-mounted physical switch controls the fan and you want to use this same switch to control the ‘Manual Trigger’ or ‘Manual Fan Switch’ functionality while ensuring your automations continue to work, you must create a trigger-based template binary sensor.

Please follow these steps

Step 1: Create a template binary sensor by adding the code below into your “configuration.yaml” file.

The things you will need to change are:

  • switch.your_fan_switch_id_here = Replace this with the entity ID of your fan switch used in ‘Fan Switch’.

The things you can change to your liking are:

  • Manual Fan Switch = This is the name you would like to call your new binary sensor.
  • fan-clock = The icon used. You can change it to your preference or remove the line icon: mdi:fan-clock if you don’t want an icon. To see what icons you can use click here.
template:
  - trigger:
      - platform: state
        entity_id: switch.your_fan_switch_id_here
        to: "on"
        id: "t1"
      - platform: state
        entity_id: switch.your_fan_switch_id_here
        to: "off"

    binary_sensor:
      - name: "Manual Fan Switch"
        icon: mdi:fan-clock
        state: >
          {% if trigger.id == 't1' and trigger.to_state.context.parent_id is none %}
            on
          {% else %}
            off
          {% endif %}

Step 2: Once you have added it into your “configuration.yaml” file, for it to take effect you have 2 options.

  1. Go into developer tools / under ‘YAML configuration reloading’, click ‘Template Entities’ (recommended).
  • OR
  1. Restart Home Assistant.

Step 3: You can only add it into either the ‘Manual Trigger’ or ‘Manual Fan Switch’. You can not add it into both choose only one.

OR

Step 4: Your done :partying_face: test it out.

Enjoy

Blacky :grinning:

Back to FAQ: Click Here

1 Like