Input button to run a script or activate a scene

:face_with_monocle: About this blueprint

Type of blueprint: AUTOMATION

What does it do?

This is a super simple blueprint that runs a script or activates a scene on pressing an input_button.

:gear: Configuration

Requirements

  • Nothing special.

Blueprint fields

  • Input button: Select here the input_button entity that will trigger the script/scene.

  • Script or scene: Choose a script or scene to be activated by the button.

:heavy_plus_sign: Other blueprints from the same author

:arrow_down: How to get this blueprint?

Click the badge to import this Blueprint:

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Or you can also:

  • Import this Blueprint by using the forum topic URL
  • Copy-paste the content of the following frame in a new file inside your configuration’s blueprint folder:
Blueprint YAML
blueprint:
  author: marc-romu
  domain: automation
  name: 'Input button: Run a script or activate a scene'
  description: >
    This is a super simple blueprint to make an 'input_button' entity to execute a script or activate a scene.
    
  input:
    input_button:
      name: Input button
      description: 'REQUIRED. Input button to set up.'
      selector:
        entity:
          filter:
            domain: input_button
    action:
      name: Script or scene
      description: 'REQUIRED. Script to execute or Scene to activate on pressing the button.'
      selector:
        entity:
          filter:
            domain:
              - script
              - scene

mode: single

trigger:
- platform: state
  entity_id: !input input_button

condition:

action:
- alias: "Activate the script/scene"
  service: homeassistant.turn_on
  target:
    entity_id: !input action

Changelog

  • 2023-11-27: First release date!