esphome: name: are-you-home platform: ESP8266 board: esp01_1m # Enable logging logger: # Enable Home Assistant API api: ota: password: !secret ota_password wifi: ssid: "MyHotspot" password: !secret wifi_password # Enable fallback hotspot (captive portal) in case wifi connection fails ap: ssid: "Are-You-Home-Fallback-Hotspot" password: !secret fallback_password captive_portal: switch: - platform: gpio pin: number: 0 inverted: true id: are_you_home_siren - platform: template name: "Siren" optimistic: yes id: sirentemp turn_on_action: - while: condition: lambda: 'return true;' then: - switch.turn_on: are_you_home_siren - delay: 500ms - switch.turn_off: are_you_home_siren - delay: 500ms turn_off_action: - switch.turn_off: are_you_home_siren binary_sensor: - platform: gpio pin: number: 3 mode: INPUT_PULLUP id: "silence_alarm_button" name: "Silence alarm" internal: true #device_class: sound on_press: then: - switch.turn_off: sirentemp