esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
291 stars 34 forks source link

BME680 via BSEC on ESP8266 when Text sensor used, no Wifi #4655

Open mawoka-myblock opened 1 year ago

mawoka-myblock commented 1 year ago

The problem

Ok, the title is kinda bad, but there are so many different points needed.

Everything works, but as soon as I add ONE of the text_sensors below, the esp fails to connect to the wifi, with different reasons, listed in the log below. The wifi-textsensor works without problems. It also works, if the text_sensor doesn't have any children.

Which version of ESPHome has the issue?

2023.6.4

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2023.6.3

What platform are you using?

ESP8266

Board

(Fake?) NodeMCU

Component causing the issue

bme680_bsec, text_sensor

Example YAML snippet

esphome:
  name: luftsensor
  friendly_name: Luftsensor

esp8266:
  board: nodemcu

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "lKBy2llot9bW0u7PF0uQndLRltd6DR2cPznfXIndhY8="

ota:
  password: "99e1209d7535inc34c73ed98b49fa504"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: True

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Luftsensor Fallback Hotspot"
    password: "ZE3OXwggZhNi"

captive_portal:

i2c:
  sda: D6
  scl: D7
  id: i2c_bus

bme680_bsec:
  address: 0x77
  i2c_id: i2c_bus
  sample_rate: ULP

sensor:
  - platform: bme680_bsec
    temperature:
      name: "Temperatur"

    pressure:
      name: "Luftdruck"
    humidity:
      name: "Feuchtigkeit"
    iaq:
      name: "BME680 IAQ"
      id: iaq
    co2_equivalent:
      name: "BME680 CO2 Equivalent"
    breath_voc_equivalent:
      name: "BME680 Breath VOC Equivalent"

text_sensor:
# If one or both of the following is activated, it won't connect to wifi
  - platform: bme680_bsec
    iaq_accuracy:
      name: "BME680 IAQ Accuracy"

  - platform: template
    name: "BME680 IAQ Classification"
    icon: "mdi:checkbox-marked-circle-outline"
    lambda: |-
      if ( int(id(iaq).state) <= 50) {
        return {"Excellent"};
      }
      else if (int(id(iaq).state) >= 51 && int(id(iaq).state) <= 100) {
        return {"Good"};
      }
      else if (int(id(iaq).state) >= 101 && int(id(iaq).state) <= 150) {
        return {"Lightly polluted"};
      }
      else if (int(id(iaq).state) >= 151 && int(id(iaq).state) <= 200) {
        return {"Moderately polluted"};
      }
      else if (int(id(iaq).state) >= 201 && int(id(iaq).state) <= 250) {
        return {"Heavily polluted"};
      }
      else if (int(id(iaq).state) >= 251 && int(id(iaq).state) <= 350) {
        return {"Severely polluted"};
      }
      else if (int(id(iaq).state) >= 351) {
        return {"Extremely polluted"};
      }
      else {
        return {"error"};
      }
## But if only this is in, it works flawlessly.
  - platform: wifi_info
    ip_address:
      name: ESP IP Address
    ssid:
      name: ESP Connected SSID
    bssid:
      name: ESP Connected BSSID
    mac_address:
      name: ESP Mac Wifi Address
    scan_results:
      name: ESP Latest Scan Results
    dns_address:
      name: ESP DNS Address

Anything in the logs that might be useful for us?

[W][wifi_esp8266:479]: Event: Disconnected ssid='WIFI_SSID' reason='Probe Request Unsuccessful'
[W][wifi:588]: Error while connecting to network.
[W][wifi:624]: Restarting WiFi adapter...
[I][wifi:274]: WiFi Connecting to 'NotSoSmart'...
[W][wifi_esp8266:482]: Event: Disconnected ssid='WIFI_SSID' bssid=BSSID reason='Association Expired'
[W][wifi:588]: Error while connecting to network.
[W][wifi:624]: Restarting WiFi adapter...
[I][wifi:274]: WiFi Connecting to 'NotSoSmart'...
[W][wifi_esp8266:482]: Event: Disconnected ssid='WIFI_SSID' bssid=BSSIDreason='Association Expired'
[W][wifi:588]: Error while connecting to network.

Additional information

No response

github-actions[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mawoka-myblock commented 8 months ago

It shouldn't be closed, since it's not resolved.