Component took a long time for an operation

Hi All,

So, I’m no stranger to home automation & BMS Systems. I’ve been using Openhab for around 3 years & have had my far number of issues. I like the fact it is so customisable with all the various devices out there but not over impressed with the setting up of a device [ Its more complicated than it could be ]… So, I’ve been looking for a different backend server for all of my IOT & BMS devices & stumbled across Home Assistant… I’ve setup Home Assistant, ESPHome & Node Red & have for about a week been trialling. I will need to trial this for a couple of months before I make a decision whether or not to onboard all my sensors & devices as I have a few closed protocol BMS Controllers I need to write code for.

Although it’s a great bit of kit I have run into a will with ESPHome & a Dallas 18B20 test sensor, it does not affect the running of the code but spams my log.

------[ Test Device Details ]------

------[ What I’m trying to achieve ]------

I’m trying to setup one of my ESP82266 IOT devices as a thermostat, to control heating relay only [At the moment].

I have managed to get the Dallas 18B20 sensor to connect to the Home Assistant using ESPHome module using sensor: code. I can confirm it gives a readout in both the log & temperature card, I have managed to integrate the digital thermostat using the climate: code & have intergraded the heating relay using the switch: code… this all works fine and functions how I expect.

My issue is every 15 second when the software reads the sensor I get a warning spam the log. See below

[17:16:01][W][component:204]: Component Dallas took a long time for an operation (0.06 s).
[17:16:01][W][component:205]: Components should block for at most 20-30ms.

I’m assuming this is referring that the sensor is reacting slow to respond. Is there any way I can fix this? or is this a treat of the sensor type?.

------[ My Code Snippet ]------
[ALL SECURITY & PASSWORD INFO HAVE BEEN REDACTED [SSID CONTASINS GEO LOCATION]

#################################################################################################
############################ Network, Recovery & Security Code Below ############################
#################################################################################################

# MCU / Board Type
esp8266:
  board: esp01_1m

# Enable Home Assistant API
api:
  encryption:
    key: !secret esp8266dev

# Enable logging
logger:

# Hostnames
esphome:
  name: **[REDACTED]**-esp8266-dev
  friendly_name: **[REDACTED]**-esp8266-dev

# WiFi & Revovery Credentials
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password   

# Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "**[REDACTED]**-esp8266-dev-fix-me"
    password: !secret wifi_password
captive_portal:

# Enable OTA Password
ota:
  password: !secret system_pass

# Local Webserver    
web_server:
  port: 80
  auth:
    username: !secret web_server_username
    password: !secret system_pass




#################################################################################################
######################################## Main Code Below ########################################
#################################################################################################

# Setup of Dallas 18B20 sensor module
dallas:
  - pin: 2
    update_interval: 15s

# Setting details of Dallas 18B20 Sensor 
sensor:
  - platform: dallas
    address: 0x74031840c357ff28
    disabled_by_default: false
    force_update: false
    name: "00 - DTS - 00"
    unit_of_measurement: °C
    accuracy_decimals: 1
    device_class: temperature
    state_class: measurement
    resolution: 12
    id: dts_0

# Addition of digital Thermostat for temperature control (Heat activation Only)
climate:
  - platform: thermostat
    name: "00 - DTS - TC - 00"
    sensor: dts_0
    min_heating_off_time: 15s
    min_heating_run_time: 15s
    min_idle_time: 15s
    heat_action:
      - switch.turn_on: relay_3
    idle_action:
      - switch.turn_off: relay_3
    default_preset: DEV
    preset:
      - name: DEV
        default_target_temperature_low: 20 °C

# Setting up of switch output to relay
switch:
  - platform: gpio
    pin: 15
    name: "03 - RL - 03"
    id: relay_3

------[ LOG of ESP8266 ]------

INFO ESPHome 2023.8.2
INFO Reading configuration /config/esphome/**[REDACTED]**-esp8266-dev.yaml...
INFO Starting log output from **[REDACTED]**-esp8266-dev.local using esphome API
INFO Successfully connected to **[REDACTED]**-esp8266-dev.local
[17:58:52][I][app:102]: ESPHome version 2023.8.2 compiled on Sep  2 2023, 15:53:57
[17:58:52][C][wifi:543]: WiFi:
[17:58:52][C][wifi:379]:   Local MAC: 98:**[REDACTED]**:FE
[17:58:52][C][wifi:380]:   SSID:**[REDACTED]**
[17:58:52][C][wifi:381]:   IP Address: 1**[REDACTED]**2
[17:58:52][C][wifi:382]:   BSSID: **[REDACTED]**
[17:58:52][C][wifi:384]:   Hostname: '**[REDACTED]**-esp8266-dev'
[17:58:52][C][wifi:386]:   Signal strength: -52 dB ▂▄▆█
[17:58:52][C][wifi:390]:   Channel: 11
[17:58:52][C][wifi:391]:   Subnet: 2**[REDACTED]**.0
[17:58:52][C][wifi:392]:   Gateway: 1**[REDACTED]**4
[17:58:52][C][wifi:393]:   DNS1: 1**[REDACTED]**3
[17:58:52][C][wifi:394]:   DNS2: 0**[REDACTED]**0
[17:58:52][C][logger:301]: Logger:
[17:58:52][C][logger:302]:   Level: DEBUG
[17:58:52][C][logger:303]:   Log Baud Rate: 115200
[17:58:52][C][logger:305]:   Hardware UART: UART0
[17:58:52][C][switch.gpio:068]: GPIO Switch '03 - RL - 03'
[17:58:52][C][switch.gpio:090]:   Restore Mode: always OFF
[17:58:52][C][switch.gpio:031]:   Pin: 15
[17:58:52][C][dallas.sensor:075]: DallasComponent:
[17:58:52][C][dallas.sensor:076]:   Pin: 2
[17:58:52][C][dallas.sensor:077]:   Update Interval: 15.0s
[17:58:52][D][dallas.sensor:082]:   Found sensors:
[17:58:52][D][dallas.sensor:084]:     0x7**[REDACTED]**8
[17:58:52][C][dallas.sensor:089]:   Device '00 - DTS - 00'
[17:58:52][C][dallas.sensor:089]:     Device Class: 'temperature'
[17:58:52][C][dallas.sensor:089]:     State Class: 'measurement'
[17:58:52][C][dallas.sensor:089]:     Unit of Measurement: '°C'
[17:58:52][C][dallas.sensor:089]:     Accuracy Decimals: 1
[17:58:52][C][dallas.sensor:097]:     Address: 0x7**[REDACTED]**8
[17:58:52][C][dallas.sensor:098]:     Resolution: 12
[17:58:52][C][thermostat.climate:1272]: Thermostat '00 - DTS - TC - 00'
[17:58:52][C][thermostat.climate:1277]:   Start-up Delay Enabled: NO
[17:58:52][C][thermostat.climate:1291]:   Heating Parameters:
[17:58:52][C][thermostat.climate:1292]:     Deadband: 0.5°C
[17:58:52][C][thermostat.climate:1293]:     Overrun: 0.5°C
[17:58:52][C][thermostat.climate:1299]:     Minimum Off Time: 15s
[17:58:52][C][thermostat.climate:1300]:     Minimum Run Time: 15s
[17:58:52][C][thermostat.climate:1313]:   Minimum Idle Time: 15s
[17:58:52][C][thermostat.climate:1314]:   Supports AUTO: NO
[17:58:52][C][thermostat.climate:1315]:   Supports HEAT/COOL: NO
[17:58:52][C][thermostat.climate:1316]:   Supports COOL: NO
[17:58:52][C][thermostat.climate:1317]:   Supports DRY: NO
[17:58:52][C][thermostat.climate:1318]:   Supports FAN_ONLY: NO
[17:58:52][C][thermostat.climate:1319]:   Supports FAN_ONLY_ACTION_USES_FAN_MODE_TIMER: NO
[17:58:52][C][thermostat.climate:1321]:   Supports FAN_ONLY_COOLING: NO
[17:58:52][C][thermostat.climate:1326]:   Supports FAN_WITH_HEATING: NO
[17:58:52][C][thermostat.climate:1328]:   Supports HEAT: YES
[17:58:52][C][thermostat.climate:1329]:   Supports FAN MODE ON: NO
[17:58:52][C][thermostat.climate:1330]:   Supports FAN MODE OFF: NO
[17:58:52][C][thermostat.climate:1331]:   Supports FAN MODE AUTO: NO
[17:58:52][C][thermostat.climate:1332]:   Supports FAN MODE LOW: NO
[17:58:52][C][thermostat.climate:1333]:   Supports FAN MODE MEDIUM: NO
[17:58:52][C][thermostat.climate:1334]:   Supports FAN MODE HIGH: NO
[17:58:53][C][thermostat.climate:1335]:   Supports FAN MODE MIDDLE: NO
[17:58:53][C][thermostat.climate:1336]:   Supports FAN MODE FOCUS: NO
[17:58:53][C][thermostat.climate:1337]:   Supports FAN MODE DIFFUSE: NO
[17:58:53][C][thermostat.climate:1338]:   Supports FAN MODE QUIET: NO
[17:58:53][C][thermostat.climate:1339]:   Supports SWING MODE BOTH: NO
[17:58:53][C][thermostat.climate:1340]:   Supports SWING MODE OFF: NO
[17:58:53][C][thermostat.climate:1341]:   Supports SWING MODE HORIZONTAL: NO
[17:58:53][C][thermostat.climate:1342]:   Supports SWING MODE VERTICAL: NO
[17:58:53][C][thermostat.climate:1343]:   Supports TWO SET POINTS: NO
[17:58:53][C][thermostat.climate:1345]:   Supported PRESETS: 
[17:58:53][C][thermostat.climate:1353]:   Supported CUSTOM PRESETS: 
[17:58:53][C][thermostat.climate:1357]:     Supports DEV: YES
[17:58:53][C][thermostat.climate:946]:       DEV Is Default: YES
[17:58:53][C][thermostat.climate:953]:       DEV Default Target Temperature Low: 20.0°C
[17:58:53][C][thermostat.climate:1360]:   On boot, restore from: MEMORY
[17:58:53][C][captive_portal:088]: Captive Portal:
[17:58:53][C][web_server:161]: Web Server:
[17:58:53][C][web_server:162]:   Address: **[REDACTED]**-esp8266-dev.local:80
[17:58:53][C][mdns:112]: mDNS:
[17:58:53][C][mdns:113]:   Hostname: **[REDACTED]**-esp8266-dev
[17:58:53][C][ota:093]: Over-The-Air Updates:
[17:58:53][C][ota:094]:   Address: **[REDACTED]**-esp8266-dev.local:8266
[17:58:53][C][ota:097]:   Using Password.
[17:58:53][C][api:138]: API Server:
[17:58:53][C][api:139]:   Address: **[REDACTED]**-esp8266-dev.local:6053
[17:58:53][C][api:141]:   Using noise encryption: YES
[17:59:01][D][dallas.sensor:143]: '00 - DTS - 00': Got Temperature=26.0°C
[17:59:01][D][sensor:093]: '00 - DTS - 00': Sending state 26.00000 °C with 1 decimals of accuracy
[17:59:01][D][climate:378]: '00 - DTS - TC - 00' - Sending state:
[17:59:01][D][climate:381]:   Mode: OFF
[17:59:01][D][climate:383]:   Action: OFF
[17:59:01][D][climate:395]:   Custom Preset: DEV
[17:59:01][D][climate:401]:   Current Temperature: 26.00°C
[17:59:01][D][climate:407]:   Target Temperature: 20.00°C
[17:59:01][W][component:204]: Component dallas took a long time for an operation (0.06 s).
[17:59:01][W][component:205]: Components should block for at most 20-30ms.

any help would be appreciated.

The Dallas sensor is quite slow, but it’s known issue and you can just ignore the warnings (or set the log level):

Hi @zenzay42

Thank you for your rapid reply…

I thought this may be the case. The Dallas 18B20’s are only a temporary setup until I can find a more accurate sensor.

I did indeed forget to go hunting through the GitHub issues page.