[solved] How to track command_line sensor that updates longer than interval

I got a lot of warnings in the log file from some of my command line sensors, but I have no idea which one. Any ideas how to track them? I’ve already set logger to debug but nothing seems to change in the log file:

configuration.yaml

logger:
  default: debug

sensors.yaml

- platform: command_line
  name: internet_speed_in
  command: "/Users/Cezex/.homeassistant/bin/bandwidth.php In 5"
  unit_of_measurement: mbps
  scan_interval: 11

- platform: command_line
  name: internet_speed_out
  command: "/Users/Cezex/.homeassistant/bin/bandwidth.php Out 5"
  unit_of_measurement: mbps
  scan_interval: 12

- platform: command_line
  name: ping_cezary
  command: "/Users/Cezex/.homeassistant/bin/presence.sh 192.168.1.20"
  scan_interval: 13

- platform: command_line
  name: ping_alek
  command: "/Users/Cezex/.homeassistant/bin/presence.sh 192.168.1.25"
  scan_interval: 14

- platform: command_line
  name: ping_agnieszka
  command: "/Users/Cezex/.homeassistant/bin/presence.sh 192.168.1.21"
  scan_interval: 15

I’ve put different scan_interval but it seems that HA ignores it (it shows update interval as 0:00:15 or 0:00:10):

2018-05-25 14:20:07 WARNING (MainThread) [homeassistant.components.sensor] Updating command_line sensor took longer than the scheduled update interval 0:00:15
2018-05-25 14:20:25 WARNING (MainThread) [homeassistant.components.sensor] Updating command_line sensor took longer than the scheduled update interval 0:00:10

I’ve checked and it take about 5s to run both of these command_line sensors.

Easiest way to track it is not to use a log file but rather start HA with a --debug parameter. Then you will be able to see which sensor is causing issues:

2018-05-27 22:37:52 INFO (SyncWorker_2) [homeassistant.components.sensor.command_line] Running command: /Users/Cezex/.homeassistant/bin/presence.sh 192.168.1.21
2018-05-27 22:37:55 WARNING (MainThread) [homeassistant.components.sensor] Updating command_line sensor took longer than the scheduled update interval 0:00:10