Binary sensor, not refreshed

Hello forum.
I set to GPIO as input and my shell script works instantly. But I need that will do the same on HA.

This is the sensor

binary_sensor:
  - platform: command_line
    name: mute
    command: "/var/lib/hass/custom_scripts/test_pin.sh 16"
    scan_interval:
      2
  - platform: command_line
    name: doorbell
    command: "/var/lib/hass/custom_scripts/test_pin.sh 18"
    scan_interval:
      2

For further information on my setup, see this discussion.