Help updating rest sensor on demand

Hello, I am trying to get two rest sensors to update when flipping their light switch in home assistant. Currently the sensors do update but sometimes it will be a minute before the switch is correctly updated to the on or off position. I am hoping that I can somehow trigger the update when the switches are flipped but I am struggling to figure out how to accomplish that. I tried using a template with a service call, but I am not sure if I am doing things right. Below is what I have currently set in yaml which does update the sensor just not right away any help is appreciated!

switch:
  - platform: command_line
    switches:
      theater_on_off:
        command_on: "/usr/bin/curl -X PUT http://192.168.20.10:3000/v2/scenes/invoke?name=MovieScene_100"
        command_off: "/usr/bin/curl -X PUT http://192.168.20.10:3000/v2/scenes/invoke?name=MovieScene_0"
        command_state: "/usr/bin/curl -X GET http://192.168.20.10:3000/v2/devices"
        value_template: >
         {{ states("sensor.theater_light_status") != '0.00' }}
        friendly_name: Theater
  - platform: command_line
    switches:
      kitchen_on_off:
        command_on: "/usr/bin/curl -X PUT http://192.168.20.10:3000/v2/scenes/invoke?name=KitchenScene_100"
        command_off: "/usr/bin/curl -X PUT http://192.168.20.10:3000/v2/scenes/invoke?name=KitchenScene_0"
        command_state: "/usr/bin/curl -X GET http://192.168.20.10:3000/v2/devices"
        value_template: >
         {{ states("sensor.kitchen_light_status") != '0.00' }}
        friendly_name: Kitchen

sensor:
  - platform: rest
    resource: http://192.168.20.10:3000/v2/devices
    name: Theater Light Status
    value_template: '{{ value_json[0].parameters.powerinfo.measured }}'
    unit_of_measurement: Watts
  - platform: rest
    resource: http://192.168.20.10:3000/v2/devices
    name: Kitchen Light Status
    value_template: '{{ value_json[1].parameters.powerinfo.measured }}'
    unit_of_measurement: Watts

I solved this by using switch template and shell commands instead of command line and adding a lower scan interval in my sensor.

shell_command:
    theater_on: 'curl -X PUT http://192.168.20.10:3000/v2/scenes/invoke?name=MovieScene_100'
    theater_off: 'curl -X PUT http://192.168.20.10:3000/v2/scenes/invoke?name=MovieScene_0'
    kitchen_on: 'curl -X PUT http://192.168.20.10:3000/v2/scenes/invoke?name=KitchenScene_100'
    kitchen_off: 'curl -X PUT http://192.168.20.10:3000/v2/scenes/invoke?name=KitchenScene_0'

switch:
  - platform: template
    switches:
      theater_on_off:
        value_template: >
         {{ states("sensor.theater_light_status") != '0.00' }}
        turn_on:
           service: shell_command.theater_on
        turn_off:
           service: shell_command.theater_off
        friendly_name: Theater
  - platform: template
    switches:
      kitchen_on_off:
        value_template: >
         {{ states("sensor.kitchen_light_status") != '0.00' }}
        turn_on:
           service: shell_command.kitchen_on
        turn_off:
           service: shell_command.kitchen_off
        friendly_name: Kitchen

sensor:
  - platform: rest
    resource: http://192.168.20.10:3000/v2/devices
    scan_interval: 5
    name: Theater Light Status
    value_template: '{{ value_json[0].parameters.powerinfo.measured }}'
    unit_of_measurement: Watts
  - platform: rest
    resource: http://192.168.20.10:3000/v2/devices
    scan_interval: 5
    name: Kitchen Light Status
    value_template: '{{ value_json[1].parameters.powerinfo.measured }}'
    unit_of_measurement: Watts