Add service selector for blueprints

Add a service selector for blueprints for automations where the desired service might change from case to case.

For example, I have a blueprint which is for zigbee buttons. I take in the “Press Service” as just text right now

    press_service:
      name: Press Service
      description: Service to call for example script.turn_on, light.turn_off, media_player.media_pause. There isn't a selector for service so this is just plain text.
      selector:
        text: {}

Then that gets used in the automation reacting to the button press

    sequence:
    - service: !input 'press_service'
      target: !input 'press_entity'

It would be nice if it would be a selector so when creating an automation from the blueprint you can be sure you’ve entered the service correctly.

Use the action selector https://www.home-assistant.io/docs/blueprint/selectors/#action-selector

1 Like

Awesome! Didn’t read the action selector documentation as the name seemed unrelated. Thanks!!

I’m trying to make a script where users can select a pre- and post-run action via an action selector.

How did you get the selected action to execute in your script?

Edit: Found it, sort of: Use input (fields) in script as sequences - #9 by nwithan8

I want to support the original request because the action selector is not suitable in my case.

I want to send notifications from the blueprint automation to a service identified by an input.
The service itself is defined in configurations.yaml as defined by The Home Assistant documentation.

I just want the notify service named as the input, but notify is not a domain currently supported.

The workaround is to put it in as text and use a template in the service call, but that is going to produce obscure errors if I make a typo in the text. I just want it as a selector, like all the other inputs – choose it from a list of notification services.