hebom
(Christiaan)
December 30, 2023, 10:36am
1
Hi there,
I’ve got a AOFO C730 power strip and I’ve replaced the CB2S with a ESP-02S, all relays are working but I can’t seem to get the button and status-light working. Any help would be appreciated. If you happen to know a place where I can find some more details on the ESP-02S, that would be appreciated since ESP-02S TYWE2S Replacement Module (ESP-02S) Configuration for Tasmota (blakadder.com) is confuzing (the GPIO’s don’t match the image).
My current YAML looks like this:
name: "kast--aquarium"
friendly_name: "Kast - aquarium"
esphome:
name: "${name}"
friendly_name: "${friendly_name}"
project:
name: esphome.esp-02s-aofo-c730-template
version: "1.0"
esp8266:
board: esp01_1m
restore_from_flash: true
preferences:
flash_write_interval: 0s
logger:
baud_rate: 0
api:
encryption:
key: !secret api_encryption_key
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
password: !secret ap_password
captive_portal:
web_server:
port: 80
auth:
username: !secret web_server_username
password: !secret web_server_password
version: 2
local: true
text_sensor:
- platform: wifi_info
ip_address:
name: WiFi - IP-address
ssid:
name: WiFi - Connected SSID
bssid:
name: WiFi - Connected BSSID
mac_address:
name: WiFi - MAC-address
scan_results:
name: WiFi - Latest Scan Results
dns_address:
name: WiFi - DNS Address
sensor:
- platform: wifi_signal
name: "WiFi - Signal"
update_interval: 60s
entity_category: "diagnostic"
switch:
- platform: restart
name: "Device - Restart"
- platform: gpio
name: "Device - USB"
pin: GPIO13
id: relay_1
restore_mode: ALWAYS_ON
- platform: gpio
name: "Device - Relay 2"
pin: GPIO12
id: relay_2
restore_mode: ALWAYS_ON
- platform: gpio
name: "Device - Relay 3"
pin: GPIO14
id: relay_3
restore_mode: ALWAYS_ON
- platform: gpio
name: "Device - Relay 4"
pin: GPIO05
id: relay_4
restore_mode: ALWAYS_ON
- platform: gpio
name: "Device - Relay 5"
pin: GPIO4
id: relay_5
restore_mode: ALWAYS_ON
binary_sensor:
- platform: status
name: "API - Status"
- platform: gpio
pin:
number: GPIO03
mode: INPUT_PULLUP
inverted: True
name: "Device - GPIO3"
on_press:
- switch.turn_off: relay_1
- switch.turn_off: relay_2
- switch.turn_off: relay_3
- switch.turn_off: relay_4
- switch.turn_off: relay_5
status_led:
pin:
number: GPIO01
inverted: true
hebom
(Christiaan)
December 30, 2023, 11:53am
2
logger:
baud_rate: 0
GPIO03 is RX.
- platform: gpio
pin:
number: GPIO03
mode: INPUT_PULLUP
inverted: True
name: "Device - GPIO3"
I’ve tried with and without mode
and inverted
but that doesn’t change anything, it still won’t register a button press.
hebom
(Christiaan)
December 30, 2023, 12:43pm
3
I’ve found the issue
GPIO01
is the button
GPIO03
is the status-light
Now continue tinkering with the YAML
hebom
(Christiaan)
January 1, 2024, 6:41pm
4
My current template version.
I’ve split up the config in multiple YAML’s, so if I change my WiFi-settings it will change for all devices. Because I’m using this for my aquarium I’ve also connected a DS18B20 sensor and that sensor will turn on/off the heating in case the temperature gets to cold/warm. I’m also going to implement a safeguard for my pump and an integration with HA so I can bypass the safeguard for a certain time.
substitutions:
name: "aofo-c730"
friendly_name: "AOFO C730"
esphome:
name: "${name}"
friendly_name: "${friendly_name}"
project:
name: esphome.esp-02s-aofo-c730-template
version: "1.0"
esp8266:
board: esp01_1m
restore_from_flash: true
preferences:
flash_write_interval: 0s
logger:
baud_rate: 0
packages:
binary_sensor: !include ./includes/binary_sensor.yaml
api:
encryption:
key: !secret api_encryption_key
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
password: !secret ap_password
captive_portal:
web_server:
port: 80
auth:
username: !secret web_server_username
password: !secret web_server_password
version: 2
local: true
time:
- platform: homeassistant
id: homeassistant_time
sensor:
- platform: wifi_signal
name: "WiFi - Signal"
update_interval: 60s
entity_category: "diagnostic"
switch:
- platform: restart
name: "Device - Restart"
- platform: gpio
name: "Device - Relay 1 / USB"
pin: GPIO13
id: relay_1
restore_mode: ALWAYS_ON
- platform: gpio
name: "Device - Relay 2"
pin: GPIO12
id: relay_2
restore_mode: ALWAYS_ON
- platform: gpio
name: "Device - Relay 3"
pin: GPIO14
id: relay_3
restore_mode: ALWAYS_ON
- platform: gpio
name: "Device - Relay 4"
pin: GPIO05
id: relay_4
restore_mode: ALWAYS_ON
- platform: gpio
name: "Device - Relay 5"
pin: GPIO4
id: relay_5
restore_mode: ALWAYS_ON
binary_sensor:
- platform: gpio
pin:
number: GPIO01
mode: INPUT_PULLUP
inverted: True
name: "Device - GPIO1"
on_click:
if:
condition:
and:
- switch.is_on: relay_1
- switch.is_on: relay_2
- switch.is_on: relay_3
- switch.is_on: relay_4
- switch.is_on: relay_5
then:
- switch.turn_off: relay_1
- switch.turn_off: relay_2
- switch.turn_off: relay_3
- switch.turn_off: relay_4
- switch.turn_off: relay_5
else:
- switch.turn_on: relay_1
- switch.turn_on: relay_2
- switch.turn_on: relay_3
- switch.turn_on: relay_4
- switch.turn_on: relay_5
binary_sensor:
- platform: status
name: "API - Status"
text_sensor:
- platform: wifi_info
ip_address:
name: WiFi - IP-address
ssid:
name: WiFi - Connected SSID
bssid:
name: WiFi - Connected BSSID
mac_address:
name: WiFi - MAC-address
scan_results:
name: WiFi - Latest Scan Results
dns_address:
name: WiFi - DNS Address
status_led:
pin:
number: GPIO03
inverted: true
binary_sensor.yaml
binary_sensor:
- platform: status
name: "API - Status"
1 Like