Hello everybody,
My Name is Dan and new here on the forum but not new in ESPhome and Hass. For quite some time i have been building sensors and more to connect with Hass.
Now i’m ussing the weak points of the ESPhome as an alarm trigger. When multiple devices are disconnected from Wifi or when Wifi is jammed.
So i build an ESP8266 with a 136db sirene, colour led and its own powersuply.
My goal is that when the sirene is disconnected from Wifi( Jammed) or gets stolen. The sirene goes off.
The problem now is that when there is a Wifi glitch, the siren goes off. Can’t figure out what code off Yaml is best for this to fix a delay or reset wifi.
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
min_auth_mode: wpa2
# Turn on Alarm when disconnected from Wifi to avoid jamming and theft
on_disconnect:
- delay:
30s
- switch.turn_on:
id: sirene
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Alarm Fallback Hotspot"
password: "xxxxxxxxx"
captive_portal:
switch:
- platform: gpio
pin: GPIO5
id: sirene
icon: mdi:volume-high
restore_mode: RESTORE_DEFAULT_OFF
name: Sirene
on_turn_on: # sirine active time
- delay: 30s
- switch.turn_off: sirene
- platform: template
name: "Inbraak Alarm"
id: inbraak_alarm_disabled
icon: mdi:alarm-light-outline
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF
entity_category: config
on_turn_on:
then:
- light.turn_on:
id: activity_led
effect: pulse
brightness: 100%
red: 0%
green: 0%
blue: 100%
# - switch.turn_on:
# id: sirene
on_turn_off:
then:
- light.turn_off: activity_led
# - switch.turn_off:
# id: sirene
- platform: template
name: "Brand Alarm"
id: brand_alarm_disabled
icon: mdi:fire-alert
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF
entity_category: config
on_turn_on:
then:
- light.turn_on:
id: activity_led
effect: pulse
brightness: 100%
red: 100%
green: 0%
blue: 0%
- switch.turn_on:
id: sirene
on_turn_off:
then:
- light.turn_off: activity_led
- switch.turn_off:
id: sirene
- platform: template
name: "Rook Alarm"
id: alarm_rook_alarm
icon: mdi:fire-alert
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF
entity_category: config
on_turn_on:
then:
- light.turn_on:
id: activity_led
effect: pulse
brightness: 100%
red: 40%
green: 30%
blue: 10%
- switch.turn_on:
id: sirene
on_turn_off:
then:
- light.turn_off: activity_led
- switch.turn_off:
id: sirene
# Configure LED
light:
- platform: neopixelbus
variant: WS2812
pin: GPIO4
num_leds: 8
flash_transition_length: 500ms
type: GRB
id: activity_led
name: "Status LED"
restore_mode: ALWAYS_OFF #normal OFF
effects:
- pulse
- pulse:
name: "Fast Pulse"
transition_length: 1s
update_interval: 0.5s
min_brightness: 0%
max_brightness: 100%
Hass Rapberry pi 5
Wifi Ruckus zonedrirector