Hi all,
A update for my ESP-01 (esp8266 relay) was available on ESPhome on my hassio. Now my ESP is not reacting anymore on the Pullup. I also flashed the ESP again manually (pyflasher), I am not able to upload the .bin file on the 9600 baud, only on higher bauds. But the ESP-01 only reads signals from 9600 baud rate. So I assume this is the issue. Does anyone know how to fix this?
Please see my code below:
esphome:
name: doorbell
platform: ESP8266
board: esp01_1m
wifi:
.....
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
.....
captive_portal:
# Enable logging
logger:
baud_rate: 0
# Enable Home Assistant API
api:
ota:
# Enable Web server.
web_server:
port: 80
# Sync time with Home Assistant.
time:
- platform: homeassistant
id: homeassistant_time
# Text sensors with general information.
text_sensor:
# Expose ESPHome version as sensor.
- platform: version
name: Doorbell ESPHome Version
# Expose WiFi information as sensors.
- platform: wifi_info
ip_address:
name: Doorbell IP
ssid:
name: Doorbell SSID
bssid:
name: Doorbell BSSID
# Sensors with general information.
sensor:
# Uptime sensor.
- platform: uptime
name: Doorbell Uptime
# WiFi Signal sensor.
- platform: wifi_signal
name: Doorbell WiFi Signal
update_interval: 60s
# Global to store the on/off state of the chime
globals:
- id: chime
type: bool
restore_value: true
initial_value: 'true'
uart:
tx_pin: GPIO1
baud_rate: 9600
# Exposed switches.
switch:
# Switch to restart the doorbell.
- platform: restart
name: Doorbell Restart
# Switch to turn on/off the chime.
- platform: template
name: Doorbell Chime
id: relay
optimistic: true
turn_on_action:
- uart.write: [0xA0, 0x01, 0x01, 0xA2] # turn on Relay
turn_off_action:
- uart.write: [0xA0, 0x01, 0x00, 0xA1]
# Switch to turn on/off chime when
# doorbell button is pushed.
#
# It creates a "virtual" switch based
# on a global variable.
- platform: template
name: Doorbell Chime Active
id: chime_active
restore_state: false
turn_on_action:
- globals.set:
id: chime
value: 'true'
turn_off_action:
- globals.set:
id: chime
value: 'false'
lambda: |-
return id(chime);
# Binary sensor representing the
# Doorbell button push.
binary_sensor:
- platform: gpio
id: button
name: Doorbell 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: 1s # 25ms
- delayed_off: 1s # 25ms
on_press:
# Only turn on the chime when it is active.
then:
if:
condition:
- switch.is_on: chime_active
then:
- switch.turn_on: relay
# - delayed_on: 2s
# - max_length: 2s
on_release:
# On release, turn off the chime.
- switch.turn_off: relay