Help with automation with blueprints conditional actions

Can I use an automation blueprint with an extra action? I thought the following with this blueprint would work (to turn off the switch.fan only when the kitchen lights are off).

  alias: Synchronize Kitchen
  description: ''
  use_blueprint:
    path: adchevrier/synchronize-the-on-off-state-of-2-entities.yaml
    input:
      entity_1: switch.kitchen_copy
      entity_2: switch.kitchen
  action:
    - service: homeassistant.turn_{{ trigger.to_state.state }}
       data:
         entity_id: '{% if trigger.to_state.state == "off" %} "switch.fan" {% endif %}'

But it doesn’t seem to. How can I implement this extra automation while keeping the synchronization blueprint active?

(Also, can someone tell me how to update the automations after editing the file automations.yaml directly? Currently, I am having to restart HomeAssistant every time I make a change to update my automations).

Don’t know about blueprints, but your extra automation will fail, if target state if not ‘off’ (entity_id becomes empty)

Ehr … use the Automations Editor in the Settings tab?

@m0wlheld, thanks! How would I fix the automation so that this particular action is only taken conditionally? I cannot use condition since that would prevent the automation from triggering all together.

Thanks. I know I can use the editor but I prefer to edit the file directly with my own YAML editor. I am just looking for a way to tell HomeAssistant to reload the automation from the file.

Conditions can also be part of an action. You can combine multiple service calls and conditions in a single action, and they will be processed in the order you put them in. If the result of a condition is false, the action will stop there so any service calls after that condition will not be executed.

There is an appropriate action at the server control tab, maybe you have to enabled extended mode on your user account first.

1 Like

Ah brilliant. I will test it with the blueprint.

I don’t see an option in server control. So I suspect I have to enable “extended mode” as you said. But googling “home assistant extended mode” is not producing anything relevant. Where would I enable such a mode?

Click your account icon in the lower left. Don‘t know the exact label of that button, in German it’s „Erweiteter Modus“

1 Like