WTH Restful commands should support metadata

If you could specify the appropriate metadata for restful commands , similar to how services from integrations specify their metadata in services.yaml, then the experience of using these services in the UI would improve because the user would be presented with the appropriate parameters and UI controls to specify the values for those parameters instead of having to memorize those parameters and entire them using the YAML editor only.

Are you talking about adding selectors to rest command?

I’m talking about having a way to specify metadata for the restful command integration, similar to specifying inputs for blueprints, so that the Home Assistant UI could correctly prompt the user for the parameters of the command.

For example, if I have a restful command specified in configuration.yaml like this

rest_command:
  delta_dispense:
    url: "https://device.legacy.deltafaucet.com/api/device/dispense?deviceId={{ device_id }}&milliliters={{ milliliters }}"
    method: POST
    headers:
      authorization: !secret delta_bearer
      user-agent: 'Mozilla/5.0'
      accept: '*/*'
      content-length: 0

If I add this action to an automation, it has no idea that the inputs needed are device_id and milliliters, nor what type of values are appropriate for them. I have to remember the two parameter names and switch to yaml editing in order to specify them. It would be great if I could define the right metadata in the rest_command so that the UI would know to display a field for milliliters that accepts a number and a parameter for device_id that accepts a string.

Yes, that would be the selectors for the variables that are passed to the rest command via data.

IIRC we have this for python scripts, scripts.

It makes sense to add it to rest commands