If anyone has a Samsung flex duo oven and need to automate turning off their lower oven, here's the solution

The standard HA integration with Smartthings has a Stop button entity, but that only turns off the upper or whole oven (if the oven divider is removed). I have a notification that goes to my phone if I leave the oven on, and a “turn off oven” option on the notification. This triggers an action automation, for both that stop button entity, and a rest_command in my configuration.yaml.

You’ll need to generate an API key from Smartthings, or use your existing one; you can do that here

Once you have the API key, you’ll need your device ID for the oven. I got that by running this command in command prompt:

curl -H "Authorization: Bearer YOUR_API_TOKEN" https://api.smartthings.com/v1/devices

With your API key and Device ID, you can create the rest_command in configuration.yaml:

rest_command:
  stop_cavity_01:
    url: "https://api.smartthings.com/v1/devices/YOUR DEVICE ID/commands"
    method: POST
    headers:
      Authorization: "Bearer YOUR_API_TOKEN"
      Content-Type: "application/json"
    payload: >
      {
        "commands": [
          {
            "component": "cavity-01",
            "capability": "ovenOperatingState",
            "command": "stop"
          }
        ]
      }

This rest_command turns off only the lower oven. Enjoy!