binary_sensor:
  - platform: gpio
    id: humidifier_status
    #name: "Humidifier Status"
    pin: 
      number: 19
      inverted: True    

output:
  - platform: gpio
    id: humidifier_output
    pin: 
      number: 18
      inverted: true

switch:
  - platform: template
    id: humidifier
    name: "Humidifier"
    restore_mode: DISABLED
    lambda: |-
      if (id(humidifier_status).state) {
        return true;
      } else {
        return false;
      }
    turn_on_action:
      - output.turn_on: humidifier_output
      - delay: 100ms
      - output.turn_off: humidifier_output
    turn_off_action:
      - output.turn_on: humidifier_output
      - delay: 100ms
      - output.turn_off: humidifier_output
      - delay: 100ms
      - output.turn_on: humidifier_output
      - delay: 100ms
      - output.turn_off: humidifier_output
