Warning Message - Updating Command Line Switch Internal Camera took longer than the scheduled update interval

Hi all,

I have a switch that runs a curl command line that was working fine, but I believe since the update to where commandline functionality is defined under it’s own integration it has been generating a warning in my HA log:

[homeassistant.components.command_line] Updating Command Line Switch Internal Camera took longer than the scheduled update interval 0:00:30

Before the upgrade I had the config defined under the switch integration , and it never generated a warning.

The curl command is running fine and responds within a second. The actual switch is also working fine, but I still get this warning message. I’m tempted to define a log filter to exclude that warning, but I’d rather identify the cause and implement a proper fix.

The config from my command_line.yaml file is:

- switch:
    name: "Internal Camera"
    command_on: !secret internal_camera_on 
    command_off: !secret internal_camera_off
    command_state: !secret internal_camera_status
    value_template: '{{ "profile=1" in value }}'

The secret entry is:
internal_camera_status: '/usr/bin/curl -X GET "http://192.168.1.4:8086/admin?user=home&pw=password"'

I have tried rebooting the host, but that didn’t solve it.

This is the same commandline as before and the switch works fine, I just keep getting loads of these warning message in my log file all the time.

Thanks,
J.

There might not be a cause as such.
You have just got a slightly slower integration that have moved the time over a limit for a warning.
You will get those warnings from time to time.
Sometimes it is due to other pieces of codes hogging resources, like for updates, especially the database updates can be heavy at times.

I also have the same warning spamming my logs, was not the case before and the manual curl command is instant
There is an issue that has been already logged : Updating Command Line ... took longer than the scheduled update interval · Issue #94713 · home-assistant/core · GitHub

+1
since the update i have a loooooooong list of those warnings

Same issue here:

Config:

command_line:
  - switch:
      name: dummy
      command_on: "echo -e '1' > sw-dummy.ini"
      command_off: "echo -e '0' > sw-dummy.ini"
      command_state: "cat sw-dummy.ini"
      value_template: "{{ value == '1' }}"

System info:

Version core-2023.6.2
Installation Type Home Assistant Container
Development false
Supervisor false
Docker true
User root
Virtual Environment false
Python Version 3.11.4
Operating System Family Linux
Operating System Version 5.15.0-75-generic
CPU Architecture x86_64

In the mean time I have opened a bug report:

fix doesn’t come with 23.06.3