Change output in automation

New user, still working to get my head around all the terminology. I’ve successfully set up a sensor to monitor the status of my garage door, and an automation to monitor that status and report any change to a remote system.

My problem is the door status is “open” and “closed”, but my remote system needs “on” and “off”. I have tried multiple permutations of IF / ELSE in different places in this code and nothing has worked, most times the automation fails to run.

Any help is greatly appreciated.

sensor:
      platform: mqtt
      name: "Garage Door"
      state_topic: "garadget/Garage/status"
      value_template: "{{ value_json.status }}"

automation:
  - alias: "garage_door_status"
    trigger:
      platform: state
      entity_id: sensor.garage_door
    action:
      service: shell_command.send_to_x

shell_command:
    send_to_x: 'curl http://10.1.1.5/garage/{{ states("sensor.garage_door") }}'

When your door can only be opened or closed a binary sensor would be better since the state can only be “on” or “off”.

binary_sensor:
  - platform: mqtt
    name: "Garage Door"
    state_topic: "garadget/Garage/status"
    payload_on: "open"
    payload_off: "closed"
shell_command:
    send_to_x: 'curl http://10.1.1.5/garage/{{ states("binary_sensor.garage_door") }}'