Blueprint : optional Input

Hello Everybody,

I try to create my first blueprint for control my radiators.

One in with climate and other with light (qubino)

I put in input this :

input:
    climate_target:
      name: xxxxxxxxxxxxxx
      description: xxxxxxxxxxxxxxxxxxxxx
      selector:
        entity:
          domain: climate
    is_fil_pilote:
      name: xxxxxxxxxxxxxxxxxxxxxxxx
      description: xxxxxxxxxxxxxxxxxxxxxxx
      default: false
      selector:
        boolean:
    
   # heater qubino
    heater_wire:
      name: xxxxxxxxxxxxxxxxxxx
      description: xxxxxxxxxxxxxxxxxxxxx 
      selector:
        entity:
          domain: light

Then for me the input climate_target is optional if i toggle is_fil_pilote and choose the input heater_wire.

But when i want to save my automation depending of this blueprint, i have this error :

Missing imput climate_target

But i dont need it in the case i choose a qubino heater.

Is anybody has an idea to workaround please?
I found with an input like this

input:
  climate_target:
   name: climate
   default: climate.default

But i m not sure that the great solution.

The default can be an empty dict:
default: {}

I used this for a light. The choose ensure you only call the service if it’s not empty/None

blueprint:
  input:
    light_target:
      name: Light
      default: {}
      selector:
        target:
          entity:
            domain: light

variables:
  light_target: !input light_target

action:
  - choose:
      - conditions: "{{ light_target }}"
        sequence:
          - service: homeassistant.turn_off
            target: !input light_target
1 Like