Added esphome files

This commit is contained in:
2021-10-15 21:29:38 -04:00
parent 55b69f0b99
commit bd7e0768d6
5 changed files with 408 additions and 0 deletions

90
esphome/globebulb1.yaml Normal file
View File

@@ -0,0 +1,90 @@
esphome:
name: globe_bulb_1
platform: ESP8266
board: esp01_1m
wifi:
networks:
- ssid: !secret "wifi_ssid"
password: !secret "wifi_pass"
- ssid: "Jen B"
password: "shae1234"
ap:
ssid: "globe_bulb_1_fallback"
password: "Fallback@!"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
# mqtt:
# broker: 192.168.0.30
# port: 1884
ota:
web_server:
port: 80
# sensors
sensor:
# signal wifi
- platform: wifi_signal
name: globe_bulb_1_signal
update_interval: 15s
# bulb ip
text_sensor:
- platform: wifi_info
ip_address:
name: globe_bulb_1_wifi
output:
- platform: esp8266_pwm
id: output_green
pin: GPIO12
#max_power: 0.7
- platform: esp8266_pwm
id: output_red
pin: GPIO4
#max_power: 0.7
- platform: esp8266_pwm
id: output_blue
pin: GPIO14
#max_power: 0.7
- platform: esp8266_pwm
id: output_wwhite
pin: GPIO13
#max_power: 0.65
- platform: esp8266_pwm
id: output_cwhite
pin: GPIO5
#max_power: 0.65
light:
- platform: rgbww
name: "globe_bulb_1"
id: light_rgb
red: output_red
green: output_green
blue: output_blue
cold_white: output_cwhite
warm_white: output_wwhite
cold_white_color_temperature: 5000 K
warm_white_color_temperature: 2000 K
effects:
- strobe:
- flicker:
- random:
# Ensure the light turns on by default if the physical switch is actuated.
#restore_mode: ALWAYS_ON

90
esphome/globebulb2.yaml Normal file
View File

@@ -0,0 +1,90 @@
esphome:
name: globe_bulb_2
platform: ESP8266
board: esp01_1m
wifi:
networks:
- ssid: !secret "wifi_ssid"
password: !secret "wifi_pass"
- ssid: "Jen B"
password: "shae1234"
ap:
ssid: "globe_bulb_2_fallback"
password: "Fallback@!"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
# mqtt:
# broker: 192.168.0.30
# port: 1884
ota:
web_server:
port: 80
# sensors
sensor:
# signal wifi
- platform: wifi_signal
name: globe_bulb_2_signal
update_interval: 15s
# bulb ip
text_sensor:
- platform: wifi_info
ip_address:
name: globe_bulb_2_wifi
output:
- platform: esp8266_pwm
id: output_green
pin: GPIO12
#max_power: 0.7
- platform: esp8266_pwm
id: output_red
pin: GPIO4
#max_power: 0.7
- platform: esp8266_pwm
id: output_blue
pin: GPIO14
#max_power: 0.7
- platform: esp8266_pwm
id: output_wwhite
pin: GPIO13
#max_power: 0.65
- platform: esp8266_pwm
id: output_cwhite
pin: GPIO5
#max_power: 0.65
light:
- platform: rgbww
name: "globe_bulb_2"
id: light_rgb
red: output_red
green: output_green
blue: output_blue
cold_white: output_cwhite
warm_white: output_wwhite
cold_white_color_temperature: 5000 K
warm_white_color_temperature: 2000 K
effects:
- strobe:
- flicker:
- random:
# Ensure the light turns on by default if the physical switch is actuated.
#restore_mode: ALWAYS_ON

62
esphome/smartplug1.yaml Normal file
View File

@@ -0,0 +1,62 @@
esphome:
name: smart_plug_1
platform: ESP8266
board: esp01_1m
wifi:
networks:
- ssid: !secret "wifi_ssid"
password: !secret "wifi_pass"
- ssid: "Jen B"
password: "shae1234"
ap:
ssid: "smart_plug_1_fallback"
password: "Fallback@!"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
# mqtt:
# broker: 192.168.0.30
# port: 1884
ota:
web_server:
port: 80
binary_sensor:
- platform: gpio
pin:
number: GPIO13
mode: INPUT_PULLUP
inverted: True
name: "smart_plug_1"
on_press:
- switch.toggle: relay
switch:
- platform: gpio
name: "smart_plug_1_relay"
pin: GPIO12
id: relay
status_led:
pin:
number: GPIO5
inverted: yes
sensor:
- platform: wifi_signal
name: "smart_plug_1 WiFi signal"
update_interval: 60s
- platform: uptime
name: "Smart_plug_1_uptime"

63
esphome/smartplug2.yaml Normal file
View File

@@ -0,0 +1,63 @@
esphome:
name: smart_plug_2
platform: ESP8266
board: esp01_1m
wifi:
networks:
- ssid: !secret "wifi_ssid"
password: !secret "wifi_pass"
- ssid: "Jen B"
password: "shae1234"
ap:
ssid: "smart_plug_2_fallback"
password: "Fallback@!"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
# mqtt:
# broker: 192.168.0.30
# port: 1884
ota:
web_server:
port: 80
binary_sensor:
- platform: gpio
pin:
number: GPIO13
mode: INPUT_PULLUP
inverted: True
name: "smart_plug_2"
on_press:
- switch.toggle: relay
switch:
- platform: gpio
name: "smart_plug_2_relay"
pin: GPIO12
id: relay
restore_mode: ALWAYS_ON
status_led:
pin:
number: GPIO5
inverted: yes
sensor:
- platform: wifi_signal
name: "smart_plug_2 WiFi signal"
update_interval: 60s
- platform: uptime
name: "Smart_plug_2_uptime"

103
esphome/smartplug4.yaml Normal file
View File

@@ -0,0 +1,103 @@
esphome:
name: smart_plug_4
platform: ESP8266
board: esp01_1m
substitutions:
device_name: 'Smart_Plug_4'
friendly_name: 'Smart_plug_4'
wifi:
networks:
- ssid: !secret "wifi_ssid"
password: !secret "wifi_pass"
- ssid: "Jen B"
password: "shae1234"
ap:
ssid: "smart_plug_4_fallback"
password: "Fallback@!"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
reboot_timeout: 0s
ota:
web_server:
port: 80
binary_sensor:
- platform: gpio
pin:
number: GPIO3
mode: INPUT_PULLUP
inverted: True
name: "smart_plug_4"
on_press:
- switch.toggle: relay
switch:
- platform: gpio
name: "smart_plug_4_relay"
pin: GPIO14
id: relay
restore_mode: ALWAYS_ON
status_led:
pin:
number: GPIO1
inverted: yes
sensor:
- platform: wifi_signal
name: "smart_plug_4 WiFi signal"
update_interval: 60s
- platform: uptime
name: "Smart_plug_4_uptime"
# Power measuring sensor
- platform: hlw8012
sel_pin:
number: GPIO12
inverted: True
cf_pin: GPIO4
cf1_pin: GPIO5
current:
name: ${friendly_name} Current
power:
name: ${friendly_name} Power
id: power
filters:
# Some calibration
- multiply: 0.4545
voltage:
name: ${friendly_name} Voltage
current_resistor: 0.001 # default 0.001
voltage_divider: 910 # default 2351
change_mode_every: 3 # default 8
update_interval: 3s # default 60s
# Sum power readings over the day
- platform: total_daily_energy
name: ${friendly_name} Total Daily Energy
power_id: power
filters:
- multiply: 0.001 # convert Wh to kWh
unit_of_measurement: kWh
# Enable getting local time for total daily energy calculation
time:
- platform: homeassistant
id: homeassistant_time
timezone: America/Toronto