Skip to content

Instantly share code, notes, and snippets.

@igresc
Last active May 30, 2022 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igresc/eef164a28a503ba048155594079fd046 to your computer and use it in GitHub Desktop.
Save igresc/eef164a28a503ba048155594079fd046 to your computer and use it in GitHub Desktop.
Sonoff SwitchMan M5 3 Gang switch ESPHome config
esphome:
name: switchman-3-kitchen
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "ota-password"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Switchman-3-Kitchen"
password: "fallback-ap-password"
captive_portal:
output:
- platform: ledc
pin: 18
frequency: 1000 Hz
id: pwm_output
- platform: gpio
id: relay_1
pin: 23
- platform: gpio
id: relay_2
pin: 19
- platform: gpio
id: relay_3
pin: 22
light:
- platform: monochromatic
output: pwm_output
name: "LEDs"
- platform: status_led
name: "Swtich state"
pin:
number: 5
inverted: true
- platform: binary
id: kitchen_switch_1
name: "General Cocina"
output: relay_1
- platform: binary
id: kitchen_switch_2
name: "Muebles Cocina"
output: relay_2
- platform: binary
id: kitchen_switch_3
name: "Galeria"
output: relay_3
binary_sensor:
- platform: gpio
id: left_button
name: "kitchen left button"
pin:
number: 4
mode: INPUT_PULLUP
on_press:
- light.toggle: kitchen_switch_1
- platform: gpio
id: middle_button
pin:
number: 0
mode: INPUT_PULLUP
on_press:
- light.toggle: kitchen_switch_2
- platform: gpio
id: right_button
pin:
number: 15
mode: INPUT_PULLUP
on_press:
- light.toggle: kitchen_switch_3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment