Enoo
1
Hi trying to use an Sonoff Dual R3 v1.6 for controlling a projector screen, but having some issues. Any thoughts/help?
substitutions:
f_name: lounge_screen
esphome:
name: lounge-screen
friendly_name: lounge_screen
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret enc_key
ota:
- platform: esphome
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Lounge-Screen Fallback Hotspot"
password: !secret fb_password
captive_portal:
#Establish UART for Power Monitoring
uart:
tx_pin: GPIO25
rx_pin: GPIO26
baud_rate: 38400
parity: EVEN
stop_bits: 1
# Power Monitoring
sensor:
- platform: cse7761
update_interval: 21s
voltage:
name: 'Voltage'
current_1:
name: 'Current 1'
disabled_by_default: True
id: current_1
current_2:
name: 'Current 2'
disabled_by_default: True
id: current_2
active_power_1:
name: 'Power 1'
active_power_2:
name: 'Power 2'
light:
- platform: status_led
name: "LED"
id: led_status
pin:
number: GPIO13
inverted: True
internal: True
switch:
- platform: gpio
name: "Up"
pin: GPIO27
id: relay_1
interlock: relay_2
disabled_by_default: True
- platform: gpio
name: "Down"
pin: GPIO14
id: relay_2
interlock: relay_1
disabled_by_default: True
binary_sensor:
- platform: gpio
name: "Button"
id: sensor_button
pin:
number: GPIO00
mode:
input: True
pullup: True
inverted: True
disabled_by_default: True
icon: 'mdi:radiobox-blank'
filters:
- delayed_on: 50ms
on_press:
- switch.toggle: relay_1
- platform: gpio
name: "Up"
pin:
number: GPIO32
mode:
input: True
pullup: True
inverted: True
disabled_by_default: True
filters:
- delayed_on_off: 50ms
on_press:
- switch.turn_on: relay_1
on_release:
- switch.turn_off: relay_1
- platform: gpio
name: "Down"
pin:
number: GPIO33
mode:
input: True
pullup: True
inverted: True
disabled_by_default: True
filters:
- delayed_on_off: 50ms
on_press:
- switch.turn_on: relay_2
on_release:
- switch.turn_off: relay_2
cover:
- platform: current_based
name: "Projector Screen"
open_sensor: current_2
open_moving_current_threshold: 0.5
open_obstacle_current_threshold: 0.8
open_duration: 10s
open_action:
- switch.turn_on: relay_2
close_sensor: current_1
close_moving_current_threshold: 0.5
close_obstacle_current_threshold: 0.8
close_duration: 12s
close_action:
- switch.turn_on: relay_1
stop_action:
- switch.turn_off: relay_1
- switch.turn_off: relay_2
obstacle_rollback: 10%
start_sensing_delay: 0.8s
Enoo
2
It appears to go into a boot loop due to a UART error?
[22:39:38][I][logger:171]: Log initialized
[22:39:38][C][safe_mode:079]: There have been 9 suspected unsuccessful boot attempts
[22:39:39][D][esp32.preferences:114]: Saving 1 preferences to flash...
[22:39:39][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[22:39:39][I][app:029]: Running through setup()...
[22:39:39][C][uart.arduino_esp32:077]: Setting up UART...
[22:39:39][C][status_led:056]: Setting up Status LED...
[22:39:39][C][switch.gpio:011]: Setting up GPIO Switch 'Up'...
[22:39:39][D][switch:016]: 'Up' Turning OFF.
[22:39:39][D][switch:055]: 'Up': Sending state OFF
[22:39:39][D][switch:016]: 'Up' Turning OFF.
[22:39:39][C][switch.gpio:011]: Setting up GPIO Switch 'Down'...
[22:39:39][D][switch:016]: 'Down' Turning OFF.
[22:39:39][D][switch:055]: 'Down': Sending state OFF
[22:39:39][D][switch:016]: 'Down' Turning OFF.
[22:39:39][D][binary_sensor:034]: 'Button': Sending initial state OFF
[22:39:39][C][light:021]: Setting up light 'LED'...
[22:39:39][D][status_led:039]: 'LED': Setting initial state
[22:39:39][D][status_led:050]: 'LED': Setting state OFF
[22:39:39][D][light:036]: 'LED' Setting:
[22:39:39][D][light:041]: Color mode:
[22:39:39][C][cse7761:045]: Setting up CSE7761...
[22:39:39][E][uart:015]: Reading from UART timed out at byte 0!
[22:39:39][E][uart:015]: Reading from UART timed out at byte 0!
[22:39:39][E][uart:015]: Reading from UART timed out at byte 0!
[22:39:39][D][cse7761:118]: Received 0 bytes for register 0
[22:39:39][D][cse7761:050]: CSE7761 found
[22:39:39][C][wifi:048]: Setting up WiFi...
[22:39:39][C][wifi:061]: Starting WiFi...
[22:39:39][C][wifi:062]: Local MAC: 88:13:BF:71:56:60
[22:39:39]ets Jul 29 2019 12:21:46
[22:39:39]
[22:39:39]rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[22:39:39]configsip: 0, SPIWP:0xee
[22:39:39]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[22:39:39]mode:DIO, clock div:2
[22:39:39]load:0x3fff0030,len:1184
[22:39:39]load:0x40078000,len:13132
[22:39:39]load:0x40080400,len:3036
[22:39:39]entry 0x400805e4
[22:39:39][I][logger:171]: Log initialized
[22:39:39][C][safe_mode:079]: There have been 10 suspected unsuccessful boot attempts
[22:39:40][D][esp32.preferences:114]: Saving 1 preferences to flash...
[22:39:40][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[22:39:40][E][safe_mode:086]: Boot loop detected. Proceeding to safe mode
[22:39:40][E][component:164]: Component safe_mode set Error flag: unspecified
[22:39:40][I][app:029]: Running through setup()...
[22:39:40][C][wifi:048]: Setting up WiFi...
[22:39:40][C][wifi:061]: Starting WiFi...
[22:39:40][C][wifi:062]: Local MAC: 88:13:BF:71:56:60
[22:39:40]ets Jul 29 2019 12:21:46
[22:39:40]
[22:39:40]rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[22:39:40]configsip: 0, SPIWP:0xee
[22:39:40]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[22:39:40]mode:DIO, clock div:2
[22:39:40]load:0x3fff0030,len:1184
[22:39:40]load:0x40078000,len:13132
[22:39:40]load:0x40080400,len:3036
[22:39:40]entry 0x400805e4
[22:39:40][I][logger:171]: Log initialized
[22:39:40][C][safe_mode:079]: There have been 0 suspected unsuccessful boot attempts
[22:39:40][D][esp32.preferences:114]: Saving 1 preferences to flash...
[22:39:40][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[22:39:40][I][app:029]: Running through setup()...
[22:39:40][C][uart.arduino_esp32:077]: Setting up UART...
[22:39:40][C][status_led:056]: Setting up Status LED...
[22:39:40][C][switch.gpio:011]: Setting up GPIO Switch 'Up'...
[22:39:40][D][switch:016]: 'Up' Turning OFF.
[22:39:41][D][switch:055]: 'Up': Sending state OFF
[22:39:41][D][switch:016]: 'Up' Turning OFF.
[22:39:41][C][switch.gpio:011]: Setting up GPIO Switch 'Down'...
[22:39:41][D][switch:016]: 'Down' Turning OFF.
[22:39:41][D][switch:055]: 'Down': Sending state OFF
[22:39:41][D][switch:016]: 'Down' Turning OFF.
[22:39:41][D][binary_sensor:034]: 'Button': Sending initial state OFF
[22:39:41][C][light:021]: Setting up light 'LED'...
[22:39:41][D][status_led:039]: 'LED': Setting initial state
[22:39:41][D][status_led:050]: 'LED': Setting state OFF
[22:39:41][D][light:036]: 'LED' Setting:
[22:39:41][D][light:041]: Color mode:
[22:39:41][C][cse7761:045]: Setting up CSE7761...
[22:39:41][E][uart:015]: Reading from UART timed out at byte 0!
[22:39:41][E][uart:015]: Reading from UART timed out at byte 0!
[22:39:41][E][uart:015]: Reading from UART timed out at byte 0!
[22:39:41][D][cse7761:118]: Received 0 bytes for register 0
[22:39:41][D][cse7761:050]: CSE7761 found
[22:39:41][C][wifi:048]: Setting up WiFi...
[22:39:41][C][wifi:061]: Starting WiFi...
[22:39:41][C][wifi:062]: Local MAC: 88:13:BF:71:56:60
[22:39:41]ets Jul 29 2019 12:21:46
[22:39:41]
[22:39:41]rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[22:39:41]configsip: 0, SPIWP:0xee
[22:39:41]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[22:39:41]mode:DIO, clock div:2
[22:39:41]load:0x3fff0030,len:1184
[22:39:41]load:0x40078000,len:13132
[22:39:41]load:0x40080400,len:3036
[22:39:41]entry 0x400805e4
Enoo
3
I should have read more carefully, working well now when powered from mains.