Skip to content

Instantly share code, notes, and snippets.

@tathamoddie
Last active January 5, 2021 22:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tathamoddie/63bef161fc3ba02bbb546151b79fbb88 to your computer and use it in GitHub Desktop.
Save tathamoddie/63bef161fc3ba02bbb546151b79fbb88 to your computer and use it in GitHub Desktop.
AS3935 and ESPHome config
substitutions:
device_name: lightning_detector
friendly_name: Lightning
## Board config
esphome:
name: ${device_name}
platform: ESP32
board: m5stack-core-esp32
on_boot:
- priority: 300 # after sensors, but before wi-fi
then:
- light.turn_on:
id: neo_light
brightness: 1.0
red: 0.5
green: 1.0
blue: 0.0
- priority: -100 # after everything
then:
- light.turn_on:
id: neo_light
brightness: 1.0
red: 0.0
green: 1.0
blue: 0.0
## Boilerplate, same for all devices
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
power_save_mode: none
logger:
level: verbose
api:
password: !secret esphome_secret
ota:
password: !secret esphome_secret
## Hardware setup
light:
- platform: fastled_clockless
id: neo_light
chipset: WS2812B
pin: 27
num_leds: 1
rgb_order: GRB
i2c:
sda: 21
scl: 25
scan: True
as3935_i2c:
address: 0x03
irq_pin:
number: 22
mode: INPUT_PULLDOWN
sensor:
- platform: as3935
lightning_energy:
name: Lightning Energy
distance:
name: Lightning Distance
binary_sensor:
- platform: as3935
name: Lightning Alert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment