esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
294 stars 38 forks source link

Notification in home assistant about invalid authentication triggered by a ESPHome integration on one of the Overview tabs #978

Closed uherting closed 4 years ago

uherting commented 4 years ago

Operating environment/Installation (Hass.io/Docker/pip/etc.):

Ubuntu 18.04.3 LTS, hass.io in docker, ESPHome (all updated), fixed IP for host and ESP device via DHCP and MAC address

ESP (ESP32/ESP8266, Board/Sonoff):

ESP32-Worover-B on TTGO-camera board with button on IO34 and PIR, no BME280 The TTGO-camera board says "20190315 OV2640_V1.7" As I cannot find out which version the TTGO board has, I assumed it was TTGO T-Camera V05 nd not TTGO T-Camera V17

Affected component:

https://esphome.io/components/esp32_camera.html#configuration-for-ttgo-t-camera-v17

Description of problem: I have several views (tabs) on the overview page of home assistant. As soon as I select a view with integrated ESPHome devices (TTGO-camera) I get a persistant notification in the side bar saying "Login attempt or request with invalid authentication from ". The IP address is the IP address of the host where home assistant is installed in docker.

Problem-relevant YAML-configuration entries:

PASTE YAML FILE HERE
substitutions:
  devicename: l9camttgo01
  friendly_name: L9 Cam Ttgo 01
  friendly_id: L9CamTtgo01

  # details
  font_times_new_roman_ttf: "fonts/times-new-roman.ttf"

  # details (do _not_ edit the following substitutions)
  display_id: ${friendly_id}_DISP_01

######################### DEVICE #########################
esphome:
  name: $devicename
  platform: ESP32
  board: esp-wrover-kit

# publish the ESPHome version
text_sensor:
  - platform: version
    name: ${friendly_name} ESPHome Version

######################### WIFI #########################
wifi:
  networks:
  - ssid: !secret WIFI_L0_SSID
    password: !secret WIFI_L0_PW
  - ssid: !secret WIFI_L2_SSID
    password: !secret WIFI_L2_PW
  - ssid: !secret WIFI_L9_SSID
  domain: !secret WIFI_DOMAIN
#  manual_ip:
#    static_ip: !secret WIFI_STAT_IP_120
#    gateway: !secret WIFI_GATEWAY
#    subnet: !secret WIFI_SUBNET
#    dns1: !secret WIFI_DNS1
#    dns2: !secret WIFI_DNS2
#  use_address: !secret WIFI_STAT_IP_120_USE_ADDRESS

######################### LOGGING #########################
logger:
#  level: DEBUG
  level: WARN
#  level: ERROR

################### Home Assistant API ###################
api:
  password: !secret HA_API_PW

######################### OTA #########################
ota:
  password: !secret HA_OTA_PW

######################### TIME #########################
time:
  - platform: homeassistant
    id: homeassistant_time

####################################################################
###################### DETAILED CONFIGURATION ######################
####################################################################

######################### I2C #########################
i2c:
  sda: GPIO21
  scl: GPIO22

######################### CAM DEVICE #########################
esp32_camera:
  name: $friendly_name Cam
  external_clock:
    pin: GPIO32
    frequency: 20MHz
  i2c_pins:
    sda: GPIO13
    scl: GPIO12
  data_pins: [GPIO5, GPIO14, GPIO4, GPIO15, GPIO18, GPIO23, GPIO36, GPIO39]
  vsync_pin: GPIO27
  href_pin: GPIO25
  pixel_clock_pin: GPIO19
# I assumed TTGO T-Camera V17 so I deactivated the following line according the ESPHome documentation
#  power_down_pin: GPIO26
  resolution: 640x480
  jpeg_quality: 10
  vertical_flip: true
#  vertical_flip: false
  horizontal_mirror: false

######################### FONTS #########################
font:
  - file: $font_times_new_roman_ttf
    id: font_times_new_roman_20
    size: 20
  - file: $font_times_new_roman_ttf
    id: font_times_new_roman_35
    size: 35

######################### DISPLAY #########################
display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    address: 0x3C
    id: ${display_id}
#    rotation: 180°
    rotation: 0°
# using pages:
# see https://esphome.io/components/display/index.html#display-pages
    pages:
      - id: page1
        lambda: |-
          it.print(5, 20, id(font_times_new_roman_35), "Hallo!");
      - id: page2
        lambda: |-
          it.print(0, 0, id(font_times_new_roman_35), "");
#          it.strftime(64, 0, id(font_times_new_roman_20), TextAlign::TOP_CENTER,"%d.%m.%Y", id(homeassistant_time).now());
#          it.strftime(64, 64, id(font_times_new_roman_35), TextAlign::BASELINE_CENTER, "%H:%M", id(homeassistant_time).now());
#          it.print(0, 10, id(font_times_new_roman_20), "This is page 2!");

# update time and display it every x interval
interval:
  - interval: 20s
    then:
      - display.page.show: page2
      - component.update: ${display_id}

######################### BINARY SENSORS #########################
binary_sensor:
  # standards first
  - platform: status
    name: $friendly_name Status

  # now the real "stuff"
  - platform: gpio
    pin: GPIO33
    name: $friendly_name PIR
    device_class: motion

    # if motion is detected
    on_press:
      then:
        - display.page.show: page1
    # if no more motion is detected
    on_release:
      then:
        - delay: !secret DELAY_15SEC
        - display.page.show: page2

  - platform: gpio
    pin:
      number: GPIO34
      mode: INPUT_PULLUP
      inverted: True
    name: $friendly_name Button
    device_class: light

######################### SENSORS #########################
sensor:
  - platform: wifi_signal
    name: $friendly_name WiFi Signal
    update_interval: !secret WIFI_SIGNAL_UPDATE_INTERVAL
  - platform: uptime
    name: $friendly_name Uptime

Logs (if applicable):

PASTE DEBUG LOG HERE

Login attempt or request with invalid authentication from ". The IP address is the IP address of the host where home assistant is installed in docker.

Additional information and things you've tried: Screenshot from 2020-01-08 13-21-31

OttoWinter commented 4 years ago

That would be an error in Home Assistant.

ESPHome does not contact the HA frontend in any way - and only forwards the stream of JPEG images to the HA backend.

I know the HA frontend does some weird stuff for authenticating the camera stream, but that would be a bug in the HA codebase (and for multiple camera integrations), not here.