This a simple gas leak/smoke sensor that will beep an alarm when triggered and send a notification to android based on ESP8266 nodeMCU. The alarm will sound every 2 seconds and its the same tone as microwave oven. I got a speaker from an old motherboard but any small speaker will do. I have one esp8266 in the basement between the furnace and the water heater and one esp8266 in the kitchen above the stove. Natural gas (mostly methane) is less dense than air.
![image](https://community-assets.home-assistant.io/original/4X/d/2/9/d29a31203dad4ba23ea312102dfc6d5ec3497cbb.png)
I use the kitchen one for other things as well
I dont have a picture with the 3d printed case
esphome:
name: esphome-web-0cd631
friendly_name: Furnace gas detector
esp8266:
board: nodemcuv2
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "xxxxxxxxxxxxxxxxxxxxxxxx"
ota:
password: "xxxxxxxxxxxxxxxxxxxx"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
use_address: 192.168.2.xxx
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-0Cd631"
password: "xxxxxxxxxx"
captive_portal:
#Define sensors
sensor:
- platform: adc
pin: A0
name: "Smoke sensor"
id: smk
update_interval: 1s
filters:
- multiply: 100
unit_of_measurement: "%"
icon: "mdi:percent"
#Speaker output
output:
- platform: esp8266_pwm
pin: D1
id: buzzer_output
rtttl:
output: buzzer_output
interval:
- interval: 2s
then:
if:
condition:
and:
- switch.is_on: buzzerswitch
- sensor.in_range:
id: smk
above: 30
then:
- rtttl.play: 'siren:d=16,o=6,b=800:b'
switch:
- platform: gpio
pin: D4 #Internal LED switching
name: "NodeMCU Internal LED"
id: internal_led
inverted: true
restore_mode: ALWAYS_ON
- platform: gpio
pin: D2 #choose a free pin here, just to make ESPHome happy. we do not need it for anything
name: "Buzzer"
id: buzzerswitch
restore_mode: ALWAYS_ON