Automation created using a blueprint not showing up in UI after creating

Hi,

I created a simple blueprint:

blueprint:
  name: TurnLightsOff
  domain: automation
  input:
    time_TurnLightsOff:
      name: time
      selector:
        time:
    target_light:
      name: Lights
      description: The lights to turn off.
      selector:
        target:
          entity:
            domain: light

trigger:
  platform: time
  at: !input time_TurnLightsOff

action:
  service: light.turn_off
  entity_id: !input target_light

  mode: single

And then I create a automation based on this blueprint:

- id: '1608233406423'
  alias: TurnLightsOff
  description: ''
  use_blueprint:
    path: appels/blueprinttest1.yaml
    input:
      time_TurnLightsOff: '22:00:00'
      target_light:
        area_id:
        - eetkamer
        - woonkamer

The automation is saved in the automations.yaml but it doesn’t show up in the automations UI.
Am I doing something wrong ?

1 Like

Maybe the inputs have to be in all lower case?

try changing:

time_TurnLightsOff:

to:

time_turnlightsoff:

I changed all the names to lowercase but it did not change anything.

I created a new blueprint in my environment and used your script. On my machine the blueprint is usable. Seems to be another problem with your environment and not with your blueprint itself.

Is there something in your log, which is giving some hints?

The blueprint is fine, I can use it when I create the automation in Lovelace.
Once the automation is created it exists in the automations.yaml but it doesn’t show up in Lovelace and it doens’t work.
The automations.yaml is also in the config file so it should load in Lovelace.
My setup is in a VM running Debian (Home Assistant Supervised). It’s a fresh setup since this isn’t my actual live setup.
I run an instance on a NUC which is running the previous version and works fine.

I just did a new install in another VM, exact same issue.
And when I create the automation without the blueprint, it shows up in Lovelace and it works.
So creating an automation using a blueprint is the issue here.

- id: '1608374976918'
  alias: TurnLightsOf
  description: ''
  use_blueprint:
    path: eappels/lightswitchontime.yaml
    input:
      input_time: '11:50:30'
      input_lights:
        area_id: bureau
- id: '1608375320591'
  alias: Test1
  description: ''
  trigger:
  - platform: time
    at: '11:55:30'
  condition: []
  action:
  - service: light.turn_off
    data: {}
    entity_id: light.bureau
  mode: single

These are the 2 animations that were created.
The top one with the blueprint which does not show in the Lovelace UI.
The second one was created in Lovelace and is showing in the UI.

Same issue here, HA 2020.12.0 (via docker). I can create an automation from a blueprint, I see it in get added to automations.yaml, but nothing is visible in the Automations UI. I just upgraded to 2020.12.1, and during startup I see the exception below. It looks like for one item in the blueprint, I hit “Add Action” and then removed the action, but it was stored with empty values in automations.yaml:

      flipped_face_1:
      - device_id: ''
        domain: ''
        entity_id: ''

This causes automations to be unhappy (below exception). Once I removed the blank bits, it shows up in Automations as expected. This might be a different issue than what @appels is seeing though, because I don’t see any invalid/empty fields in the blueprint automation.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_automation/__init__.py", line 81, in async_get_device_automation_platform
    integration = await async_get_integration_with_requirements(hass, domain)
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 47, in async_get_integration_with_requirements
    integration = await async_get_integration(hass, domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 491, in async_get_integration
    raise IntegrationNotFound(domain)
homeassistant.loader.IntegrationNotFound: Integration '' not found.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
    result = await task
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 169, in async_setup
    if not await _async_process_config(hass, config, component):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 512, in _async_process_config
    await async_validate_config_item(
  File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 74, in async_validate_config_item
    config
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 143, in async_validate_actions_config
    return await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 187, in async_validate_action_config
    choose_conf
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 143, in async_validate_actions_config
    return await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 158, in async_validate_action_config
    platform = await device_automation.async_get_device_automation_platform(
  File "/usr/src/homeassistant/homeassistant/components/device_automation/__init__.py", line 84, in async_get_device_automation_platform
    raise InvalidDeviceAutomationConfig(
homeassistant.components.device_automation.exceptions.InvalidDeviceAutomationConfig: Integration '' not found

Update on this issue:
So today I upgraded my live setup on the intel NUC and I tested my simple blueprint on there and it’s working. The created automation shows up in the UI and it works.

Hi there!

I was facing the same issue with my Home Assistant Docker container running the latest version. I noticed that untouched files containing blueprints remained visible in the automation list while blueprints that I edited, weren’t listed…

That made me realise it most likely had to do something with permissions. Turns out; that’s the case! A file containing a blueprint should only have read access. This can be accomplished by copying the permissions of one untouched file with the following command.

sudo chmod --reference=notify_leaving_zone.yaml sunset_light.yaml

Hope this helps someone. It at least was a huge relief to me that they worked again.

Kind regards,

Jochem

1 Like

this is a bug or it must be documented. i have the same issue

Hello,

Same issue for me, impossible to use blueprint.
When they don’t appear in the AUTOMATION UI, the automations doesnt work at all.

The permissions of the files are ok for me.

I had this. Just troubleshooted, and realised the error.

Automations created from blueprints (or the GUI in general) are created in automations.yaml

Which is fine if you include that. But if you do what I had, it gets ignored. I had the following in configuration.yaml:

automation: !include_dir_merge_list automations/

Which will merge all the files in automations BUT IGNORE automations.yaml in the main directory!!

I now have:

automation mine: !include_dir_merge_list automations/
automation ui: !include automations.yaml

Which works. Suddenly I have 20 extra test automations I created!

5 Likes

Thanks @walaj

I have already splitt my configuration like this. But i will try again.
This in my configuration.yaml

packages: !include_dir_named packages/

and in the directory packages this : my automation.yaml with

automation: !include ../automations.yaml
automation split: !include_dir_merge_list ../automations 

If you create an automation using the GUI (guided, or blueprint) is it written to automations.yaml?

if yes, but they don’t show in the GUI, then its not being included correctly…

In my case, yes, if I create an automation using a blueprint, I can find the automation in automations.yaml afterwards. However, if I use anything beyond the default “motion light” blueprint, the automation isn’t shown afterwards in the UI.
Getting to the point where I’ll just stick with automations and hope for a solution down the road.

Yes it is :wink: I try just now to be sure.
Strange behavior. maybe test with another platform trigger in the blueprint

So how to make automation created from blueprints visible in UI? New automations are in the end of automation.yaml file but invisible in UI and in the list of automations. How can I use them?

if the automation doesn’t show in HA/config/automation/dashboard then almost certainly automations.yaml isn’t being loaded - only written to.

check this post first if you haven’t already - Automation created using a blueprint not showing up in UI after creating

automation: !include_dir_merge_list automations/

This rule in my config was my issue.
Since I removed that one and merged all automations into 1 file, it works fine.
I have mixed feelings about it since now it’s all stored in one file and I can’t sepperate anymore.
Used to have automations grouped in ‘rooms’ which I can’t do anymore.
I’m using a naming system now to get sort of the same in the UI but it’s not ideal.
Would be cool if we could have some sort of way to group automations in the UI in future releases.

1 Like