Hi, thanks. Feel free to add any of this to the docs. I’ve been testing some more and found a more elegant solution. It turns out you just need to not program wifi credentials and then you can even use the web_server component. It’ll only start the captive portal when in factory reset state, and not when it cannot connect.
wifi:
ap:
ssid: "Test Fallback Hotspot"
password: "00000000"
ap_timeout: 0s
captive_portal:
web_server:
port: 80
binary_sensor:
- platform: gpio
pin: D4
name: btntest
filters:
- invert:
on_click:
- min_length: 5000ms
max_length: 10000ms
then:
- switch.turn_on: factrst
switch:
- platform: factory_reset
id: factrst