From bd7e0768d67dd0d4026c341258cd2ca815b6a0b0 Mon Sep 17 00:00:00 2001 From: mkono87 Date: Fri, 15 Oct 2021 21:29:38 -0400 Subject: [PATCH] Added esphome files --- esphome/globebulb1.yaml | 90 +++++++++++++++++++++++++++++++++++ esphome/globebulb2.yaml | 90 +++++++++++++++++++++++++++++++++++ esphome/smartplug1.yaml | 62 ++++++++++++++++++++++++ esphome/smartplug2.yaml | 63 ++++++++++++++++++++++++ esphome/smartplug4.yaml | 103 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 408 insertions(+) create mode 100644 esphome/globebulb1.yaml create mode 100644 esphome/globebulb2.yaml create mode 100644 esphome/smartplug1.yaml create mode 100644 esphome/smartplug2.yaml create mode 100644 esphome/smartplug4.yaml diff --git a/esphome/globebulb1.yaml b/esphome/globebulb1.yaml new file mode 100644 index 0000000..7bcbc9e --- /dev/null +++ b/esphome/globebulb1.yaml @@ -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 \ No newline at end of file diff --git a/esphome/globebulb2.yaml b/esphome/globebulb2.yaml new file mode 100644 index 0000000..389f8dd --- /dev/null +++ b/esphome/globebulb2.yaml @@ -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 \ No newline at end of file diff --git a/esphome/smartplug1.yaml b/esphome/smartplug1.yaml new file mode 100644 index 0000000..d4e701d --- /dev/null +++ b/esphome/smartplug1.yaml @@ -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" \ No newline at end of file diff --git a/esphome/smartplug2.yaml b/esphome/smartplug2.yaml new file mode 100644 index 0000000..9b494a2 --- /dev/null +++ b/esphome/smartplug2.yaml @@ -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" \ No newline at end of file diff --git a/esphome/smartplug4.yaml b/esphome/smartplug4.yaml new file mode 100644 index 0000000..bd3172c --- /dev/null +++ b/esphome/smartplug4.yaml @@ -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 \ No newline at end of file