Skip to content

Commit

Permalink
🔨 Refactor ESPHome
Browse files Browse the repository at this point in the history
  • Loading branch information
Sholofly committed Oct 27, 2021
1 parent 469bcc4 commit e1ca557
Show file tree
Hide file tree
Showing 31 changed files with 183 additions and 30 deletions.
13 changes: 0 additions & 13 deletions esphome/_esp10.yaml

This file was deleted.

73 changes: 73 additions & 0 deletions esphome/_gang_bel.yaml_
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
substitutions:
label: esp16
slug: gang_bel
name: Gang Bel
description: Schakelt de deurbel.
restore_mode: RESTORE_DEFAULT_OFF

packages:
device: !include devices/esp01s-relay.yaml

# Global to store the on/off state of the chime
globals:
- id: "${slug}_state"
type: bool
restore_value: true
initial_value: 'true'

# Exposed switches.
switch:
# # Switch to turn on/off the chime.
# - platform: gpio
# id: "${slug}_relay"
# inverted: true
# name: "${name}"
# pin: GPIO0
# restore_mode: RESTORE_DEFAULT_OFF

# Switch to turn on/off chime when
# doorbell button is pushed.
#
# It creates a "virtual" switch based
# on a global variable.
- platform: template
name: "${name} enabled"
id: "${slug}_enabled"
restore_state: false
turn_on_action:
- globals.set:
id: "${slug}_state"
value: 'true'
turn_off_action:
- globals.set:
id: "${slug}_state"
value: 'false'
lambda: |-
return id("${slug}_state");

# Binary sensor representing the
# Doorbell button push.
binary_sensor:
- platform: gpio
id: "${slug}_button"
name: "${name} button"
pin:
# Connected to GPIO on the ESP-01S.
number: GPIO2
mode: INPUT_PULLUP
inverted: true
filters:
# Small filter, to debounce the button press.
- delayed_on: 25ms
- delayed_off: 25ms
on_press:
# Only turn on the chime when it is active.
then:
if:
condition:
- switch.is_on: "${slug}_enabled"
then:
- switch.turn_on: "${slug}_relay"
on_release:
# On release, turn of the chime.
- switch.turn_off: "${slug}_relay"
1 change: 1 addition & 0 deletions esphome/achtertuin_druppel_border.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ substitutions:
name: Achtertuin Druppel border
description: Bedient de druppelslang in de border.
restore_mode: ALWAYS_OFF
wifi_static_ip: 192.168.1.186

packages:
<<: !include_dir_named ./common
Expand Down
1 change: 1 addition & 0 deletions esphome/achtertuin_druppelslang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ substitutions:
name: Achtertuin Druppelslang
description: Bedient de druppelslang in de achtertuin.
restore_mode: ALWAYS_OFF
wifi_static_ip: 192.168.1.203

packages:
<<: !include_dir_named ./common
Expand Down
1 change: 1 addition & 0 deletions esphome/bijkeuken_droger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ substitutions:
# Lower value gives lower voltage readout
voltage_div: "800"
restore_mode: ALWAYS_ON
wifi_static_ip: 192.168.1.195

packages:
device: !include devices/neo_coolcam_pm.yaml
Expand Down
1 change: 1 addition & 0 deletions esphome/bijkeuken_plafond.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ substitutions:
name: Bijkeuken Plafond
description: Bedient de lamp in de bijkeuken.
restore_mode: RESTORE_DEFAULT_OFF
wifi_static_ip: 192.168.1.96

packages:
device: !include devices/shelly1_light.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
esphome:
<<: !include .esphome.yaml
platform: ESP32
board: lolin_d32
board: nodemcu-32s
11 changes: 11 additions & 0 deletions esphome/boards/esp8266_nodemcuv2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# Wemos D1 mini module
#
# Can be found in various Tuya-based devices.
#
# https://docs.platformio.org/en/latest/boards/espressif8266/esp8285.html
#
esphome:
<<: !include .esphome.yaml
platform: ESP8266
board: esp01_1m
2 changes: 1 addition & 1 deletion esphome/common/wifi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ wifi:
reboot_timeout: 10min
ap:
ssid: "${name}"
domain: .lan
domain: .local

sensor:
- <<: !include ../sensors/wifi_signal_percentage.yaml
Expand Down
3 changes: 3 additions & 0 deletions esphome/devices/esp-wroom-32.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packages:
<<: !include_dir_named ../common
board: !include ../boards/esp-wroom-32.yaml
12 changes: 12 additions & 0 deletions esphome/devices/esp8266_nodemcuv2-relay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
packages:
<<: !include_dir_named ../common
board: !include ../boards/esp8266_nodemcuv2.yaml

switch:
- platform: gpio
pin:
number: 0
inverted: yes
id: "${slug}_relay"
name: "${name}"
restore_mode: $restore_mode
5 changes: 3 additions & 2 deletions esphome/devices/wemos-d1-mini-relay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ packages:
switch:
- platform: gpio
name: "${name} Relay"
id: "${slug}_relay"
pin:
number: 4
inverted: true
number: 5
restore_mode: ALWAYS_OFF
14 changes: 7 additions & 7 deletions esphome/gang_bel.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
substitutions:
label: esp16
label: esp33
slug: gang_bel
name: Gang Bel
description: Schakelt de deurbel.
restore_mode: RESTORE_DEFAULT_OFF
restore_mode: RESTORE_ALWAYS_OFF

packages:
device: !include devices/esp01s-relay.yaml
device: !include devices/wemos-d1-mini-relay.yaml

# Global to store the on/off state of the chime
globals:
- id: "${slug}_state"
- id: chime
type: bool
restore_value: true
initial_value: 'true'
Expand All @@ -36,14 +36,14 @@ switch:
restore_state: false
turn_on_action:
- globals.set:
id: "${slug}_state"
id: chime
value: 'true'
turn_off_action:
- globals.set:
id: "${slug}_state"
id: chime
value: 'false'
lambda: |-
return id("${slug}_state");
return id(chime);
# Binary sensor representing the
# Doorbell button push.
Expand Down
1 change: 1 addition & 0 deletions esphome/gang_plafond.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ substitutions:
name: Gang Plafond
description: Bedient de lamp in de gang.
restore_mode: RESTORE_DEFAULT_OFF
wifi_static_ip: 192.168.1.46

packages:
device: !include devices/shelly1_light.yaml
13 changes: 7 additions & 6 deletions esphome/garage_garagedeur.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# failes update
substitutions:
label: esp11
slug: garage_garagedeur
name: Garage Garagedeur
description: Schakelt de garagedeur.
restore_mode: ALWAYS_OFF
toggle_delay: 1500ms
label: esp11
slug: garage_garagedeur
name: Garage Garagedeur
description: Schakelt de garagedeur.
restore_mode: ALWAYS_OFF
toggle_delay: 1500ms
wifi_static_ip: 192.168.1.121

packages:
device: !include devices/esp01s-relay-off.yaml
1 change: 1 addition & 0 deletions esphome/garage_werkbank.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ substitutions:
slug: garage_werkbank
name: Garage Werkbank
description: Lamp boven de werkbank in de garage.
wifi_static_ip: 192.168.1.49

packages:
device: !include devices/shelly1_light.yaml
1 change: 1 addition & 0 deletions esphome/kleine_schuur_airfryer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ substitutions:
# Lower value gives lower voltage readout
voltage_div: "800"
restore_mode: RESTORE_DEFAULT_OFF
wifi_static_ip: 192.168.1.247

packages:
device: !include devices/neo_coolcam_pm.yaml
1 change: 1 addition & 0 deletions esphome/meterkast-watermeter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ substitutions:
slug: meterkast_watermeter
name: Meterkast Watermeter
description: Sensor voor het meten van waterverbruik
wifi_static_ip: 192.168.1.180

packages:
device: !include devices/wemos-d1-mini-trt5000.yaml
1 change: 1 addition & 0 deletions esphome/mika_plafond.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ substitutions:
name: Mika Plafond
description: Bedient de lamp in Mika's slaapkamer.
restore_mode: RESTORE_DEFAULT_OFF
wifi_static_ip: 192.168.1.103
packages:
device: !include devices/sonoff_t1_light.yaml
1 change: 1 addition & 0 deletions esphome/noa_plafond.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ substitutions:
name: Noa Plafond
description: Bedient de lamp in Noa's slaapkamer.
restore_mode: RESTORE_DEFAULT_OFF
wifi_static_ip: 192.168.1.107
packages:
device: !include devices/sonoff_t1_light.yaml
1 change: 1 addition & 0 deletions esphome/overloop_plafond.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ substitutions:
name: Overloop Plafond
description: Bedient de lamp op de overloop.
restore_mode: RESTORE_DEFAULT_OFF
wifi_static_ip: 192.168.1.89

packages:
device: !include devices/shelly1_light.yaml
1 change: 1 addition & 0 deletions esphome/voortuin_hek.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ substitutions:
description: Schakelt het hek.
restore_mode: ALWAYS_OFF
toggle_delay: 500ms
wifi_static_ip: 192.168.1.98

packages:
device: !include devices/esp01s-relay-off.yaml
1 change: 1 addition & 0 deletions esphome/voortuin_sproeier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ substitutions:
name: Voortuin Sproeier
description: Bedient de sproeier in de voortuin.
restore_mode: ALWAYS_OFF
wifi_static_ip: 192.168.1.181

packages:
device: !include devices/shelly1.yaml
1 change: 1 addition & 0 deletions esphome/wc_plafond.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ substitutions:
name: WC Plafond
description: Bedient de lamp in de wc.
restore_mode: RESTORE_DEFAULT_OFF
wifi_static_ip: 192.168.1.70

packages:
device: !include devices/shelly1_light.yaml
1 change: 1 addition & 0 deletions esphome/woonkamer_dressoir.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ substitutions:
slug: woonkamer_dressoir
name: Woonkamer Dressoir
description: Bedient het licht op het dressoir in de woonkamer.
wifi_static_ip: 192.168.1.82

packages:
device: !include devices/neo_coolcam_light.yaml
1 change: 1 addition & 0 deletions esphome/woonkamer_raam_voor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ substitutions:
slug: woonkamer_raam_voor
name: Woonkamer Raam Voor
description: Bedient het licht in het raam voor.
wifi_static_ip: 192.168.1.131

packages:
device: !include devices/neo_coolcam_light.yaml
1 change: 1 addition & 0 deletions esphome/woonkamer_raam_zijkant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ substitutions:
# Lower value gives lower voltage readout
voltage_div: "800"
restore_mode: RESTORE_DEFAULT_OFF
wifi_static_ip: 192.168.1.226

packages:
device: !include devices/neo_coolcam_pm_light.yaml
1 change: 1 addition & 0 deletions esphome/woonkamer_wandrek.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ substitutions:
# Lower value gives lower voltage readout
voltage_div: "800"
restore_mode: RESTORE_DEFAULT_OFF
wifi_static_ip: 192.168.1.30

packages:
device: !include devices/neo_coolcam_pm_light.yaml
Loading

0 comments on commit e1ca557

Please sign in to comment.