Automation blueprint works but generating errors

Hi guys, got my first automation blueprint. It works (4 automation created and working) but in log I see
this error:

HA 2022.10.3

Logger: homeassistant.components.automation
Source: components/automation/__init__.py:246
Integration: Automatizace (documentation, issues)
First occurred: 17:40:50 (1 occurrences)
Last logged: 17:40:50

Blueprint Control TRVs - generated invalid automation with inputs OrderedDict([('heating', 'input_boolean.livingroom_heating'), ('target_valves', 'climate.livingroom_valve_1')]): expected a dictionary for dictionary value @ data['action'][0]['else'][0]['target']. Got None expected a dictionary for dictionary value @ data['action'][0]['then'][0]['target']. Got None
blueprint:
  name: "Control TRVs - "
  description: "open/close"
  domain: automation
  input:
    heating:
      name: Heating input
      description: This sensor trigger boiler
      selector:
        entity:
          domain: input_boolean
    target_valves:
      name: Target TRVs
      description: This TRVs will be open/close
      selector:
        target:
          entity:
            domain: climate
  
trigger:
  - platform: state
    entity_id: !input heating
action:
- if:
  - condition: state
    entity_id: !input heating
    state: 'on'
  then:
  - service: climate.set_temperature
    data:
      temperature: 30
    target: !input target_valves
  else:
  - service: climate.set_temperature
    data:
      temperature: 10
    target: !input target_valves

Bug or did I something wrong?

And second minor problem is that if I create automation over this blueprint in web UI it not show up in automations tab(even page refresh not works, only restart HA), but if I open mobile app automations are there and it works correctly when I create automation same way in mobile app.

Try this:

blueprint:
  name: "Control TRVs - "
  description: "open/close"
  domain: automation
  input:
    heating:
      name: Heating input
      description: This sensor trigger boiler
      selector:
        entity:
          domain: input_boolean
    target_valves:
      name: Target TRVs
      description: This TRVs will be open/close
      selector:
        target:
          entity:
            domain: climate
  
trigger:
  - platform: state
    entity_id: !input heating
action:
- if:
  - condition: state
    entity_id: !input heating
    state: 'on'
  then:
  - service: climate.set_temperature
    data:
      temperature: 30
    target:
      entity_id: !input target_valves
  else:
  - service: climate.set_temperature
    data:
      temperature: 10
    target:
      entity_id: !input target_valves

Same result and it destroyed all automations using this blueprint, only one persist

EDIT: I don’t know if you see that, but I want to be able select more than one TRV and only one input_boolean so entity_id doesn’t make sence cause I thing it’s only for one statement not an Array.

BTW I did create this automation manully at first time, then copy&paste and add blueprints attributes and input variables.

Then I think you are missing some blank spaces in some place…
I don’t have my computer now, so I will be limited to replicate exactly your blueprint, but when I try to create the same in the automation UI, I get this (it is incomplete, just to see the spaces on the actions):

mode: single
trigger: []
condition: []
action:
  - if:
      - condition: state
        entity_id: automation.01_test
        state: "on"
    then:
      - service: climate.set_temperature
        data:
          temperature: 40
        target:
          entity_id:
            - climate.bathroom_thermostat
            - climate.kitchen_thermostat
    else:
      - service: climate.set_temperature
        data:
          temperature: 30
        target:
          entity_id:
            - climate.bathroom_thermostat
            - climate.bedroom_thermostat

This is how it should be with the right indentation:

blueprint:
  name: "Control TRVs - "
  description: "open/close"
  domain: automation
  input:
    heating:
      name: Heating input
      description: This sensor trigger boiler
      selector:
        entity:
          domain: input_boolean
    target_valves:
      name: Target TRVs
      description: This TRVs will be open/close
      selector:
        target:
          entity:
            domain: climate

mode: single

trigger:
  - platform: state
    entity_id: !input heating

condition: []

action:
  - if:
      - condition: state
        entity_id: !input heating
        state: "on"
    then:
      - service: climate.set_temperature
        data:
          temperature: 30
        target: !input target_valves
    else:
      - service: climate.set_temperature
        data:
          temperature: 10
        target: !input target_valves

Yes, that’s helped. I checked source in editor printing white chars and there’s not space/tab mix. But indent of rows below action section was probably wrong. Thanks

1 Like

I’m glad to hear that.