From 7b510529d95f0d3595390eea83428959a4835182 Mon Sep 17 00:00:00 2001 From: Tim Meneely Date: Mon, 6 Dec 2021 08:34:20 -0500 Subject: [PATCH] Another sonoff S31, dynamic IP, on at boot --- chip_list_esp32.txt | 1 + sonoff-s31e.yaml | 71 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 sonoff-s31e.yaml diff --git a/chip_list_esp32.txt b/chip_list_esp32.txt index 020db8c..0346d58 100644 --- a/chip_list_esp32.txt +++ b/chip_list_esp32.txt @@ -12,4 +12,5 @@ rf_bridge_87_60 192.168.87.60 esp01_1m sonoff_s31a 192.168.87.71 esp01_1m Sonoff S31 power monitoring plug sonoff_s31b 87.72 now DHCP esp01_1m Sonoff S31 power monitoring plug sonoff-s31christmas 87.74 esp01_1m Sonoff S31 power monitoring plug +sonoff-s31e 87.75 now DHCP esp01_1m Sonoff S31 power monitoring plug ifan04_a 192.168.87.73 diff --git a/sonoff-s31e.yaml b/sonoff-s31e.yaml new file mode 100644 index 0000000..716dc66 --- /dev/null +++ b/sonoff-s31e.yaml @@ -0,0 +1,71 @@ +substitutions: + device_name: sonoff-s31e + # device_ip: 192.168.87.75 + +esphome: + name: ${device_name} + platform: ESP8266 + board: esp01_1m + on_boot: + - switch.turn_on: relay + # platformio_options: + # upload_speed: 115200 #baud, tagging this so grep will find it later + +#<<: !include standard_wifi.yaml +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password +# manual_ip: +# # static_ip: ${device_ip} +# gateway: 192.168.86.1 +# subnet: 255.255.254.0 + fast_connect: True + +logger: + baud_rate: 0 # (UART logging interferes with cse7766) + +api: + # reboot_timeout: 15min + +ota: + +# Device Specific Config + +uart: + rx_pin: RX + baud_rate: 4800 + +binary_sensor: + - platform: gpio + pin: + number: GPIO0 + mode: INPUT_PULLUP + inverted: True + name: ${device_name}_button + on_press: + - switch.toggle: relay + - platform: status + name: ${device_name}_status + +sensor: + - platform: wifi_signal + name: ${device_name}_wifi + update_interval: 60s + - platform: cse7766 + current: + name: ${device_name}_current + accuracy_decimals: 1 + voltage: + name: ${device_name}_voltage + accuracy_decimals: 1 + power: + name: ${device_name}_power + accuracy_decimals: 1 +switch: + - platform: gpio + name: ${device_name}_relay + pin: GPIO12 + id: relay + +status_led: + pin: GPIO13