How to debug rest sensor that encounters: Updating rest sensor took longer than the scheduled update interval

I have Fully Kiosk Browser running and associated a rest sensor as follows in my configuration.yaml:
sensor:

  - platform: rest
    name: Lenovo Device Info
    resource: http://192.168.1.57:2323/?cmd=deviceInfo&type=json&password=mypasswd
    json_attributes:
      - screenBrightness
      - batteryLevel
      - ip4
      - isScreenOn
      - deviceID
    value_template: 'OK'

After (re)starting ha, it works fine for a while, but after a couple of hours it starts failing. I.e. initially I get:
2022-02-14 11:27:29 DEBUG (MainThread) [homeassistant.components.rest.sensor] Data fetched from resource: {“deviceName”:“QCOM-BTD”,“packageName”:“de.ozerov.fully”,“batteryLevel”:47,“isPlugged”:false,“SSID”:"",“BSSID”:“02:00:00:00:00:00”,“Mac”:"",“ip4”:“192.168.1.57”,“ip6”:“FE80::55CB:8019:B852:C822”,“hostname4”:“192.168.1.57”,“hostname6”:“fe80::55cb:8019:b852:c822%wlan0”,“wifiSignalLevel”:7,“isMobileDataEnabled”:false,“screenOrientation”:270,“screenBrightness”:20,“screenLocked”: …etc…

But at a given moment I get:
2022-02-14 11:42:39 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.lenovo_device_info is taking over 10 seconds
2022-02-14 11:47:29 WARNING (MainThread) [homeassistant.components.sensor] Updating rest sensor took longer than the scheduled update interval 0:05:00
2022-02-14 11:52:29 WARNING (MainThread) [homeassistant.components.sensor] Updating rest sensor took longer than the scheduled update interval 0:05:00
2022-02-14 11:57:29 WARNING (MainThread) [homeassistant.components.sensor] Updating rest sensor took longer than the scheduled update interval 0:05:00
and it keeps going on like this. I need to restart ha to get it working again. My version is 2021.12.7

How can I know what is going wrong. I added this to my configuration, but it gives no additional info in my logfile:

logger:
  default: warn
  logs:
    homeassistant.components.rest.sensor: debug

When I login in my docker container using “docker exec -it homeassistant bash” and I do curl ‘http://192.168.1.57:2323/?cmd=deviceInfo&type=json&password=mypasswd’, it returns correct results.

To how to find out what is going wrong? The annoying thing as well is that, once this issue appears, some lovelace cards (based on a camera) don’t work anymore.

Thanks for your ideas or suggestions.

1 Like