Automation created by package unavailable

If I create the following automation in automation.yaml it works fine. I can subsequently edit it in the UI. But if I move the same code into a package, the automation shows up as “unavailable” in the UI. Why?

###
### ZZZ Test room heating control 	
###

automation:
  - id: zzz_test_room_heating_control
    alias: ZZZ Test room heating control
    description: Controls the heating for the ZZZ Test room using the ZZZ Test room heating schedule calendar
    use_blueprint:
      path: AndySymons/heating_x2.yaml
      input:
        thermostat_controls:
        - zzz_test_room_west_trv
        - zzz_test_room_east_trv
        away_switch: input_boolean.away
        door_or_window_open_sensors: []
        room_occupancy_sensors: []
        room_calendar: calendar.zzz_test_room_heating_schedule
        manual_temperature: input_number.zzz_test_room_heating_manual_temperature
        required_temperature: input_number.zzz_test_room_heating_required_temperature
        setting_reason: input_text.zzz_test_room_heating_setting_reason
        door_or_window_open_timer: timer.zzz_test_room_heating_door_or_window_open_timer
        unoccupancy_timer: timer.zzz_test_room_heating_room_unoccupancy_timer
        warmup_timer: timer.zzz_test_room_heating_warmup_timer
        manual_override_timer: timer.zzz_test_room_heating_manual_override_timer
        echoblock_timer: timer.zzz_test_room_heating_echoblock_timer
        minimum_thermostat_temperature: 5
        maximum_thermostat_temperature: 30
        away_temperature: 5
        background_temperature: 5
        door_or_window_open_period: 00:02:00
        unoccupancy_period: 00:30:00
        warmup_period: 02:00:00
        manual_override_period: 02:00:00

A quick search on google seems to indicate that blueprints can’t be created manually using yaml outside of the UI. Which are then stored in the automations.yaml file.

I don’t use blueprints so I could be completely wrong about that. But your posted experience seems to validate that belief.

No, that is not correct (in the present version of Home Assistant).

The current version of the Heating X2 Code Generator uses Mail Merge to create all the automations needed for a heating installation – one automation per room – each using the Heating X2 blueprint. They each have a unique id, so that they can be edited in he UI.

The YAML code is precisely the same as that posted above. If I paste it into automations.yaml it is fine, but inside a package (only) it shows up in the UI as ‘unavailable’ and it looks like a sensor rather than the usual list of Blueprint inputs. The only thing that can be edited is the entity name.

I am not sure if this is a bug or a ‘feature’ in packages.

I don’t use blueprints, but I think packages are 'literal` (i.e. they cannot contain macro style elements) and so cannot be part of something else. If you were to put the completed blueprint output into the package it should be OK.

  1. What do you mean by ‘macro style elements’?
  2. What do you mean by ‘complete blueprint output’?

Sorry if I have not explained myself properly; it will be easier for me to answer q2 first.

The automation code you posted is not a complete automation; it is the input that goes to the blueprint generator which in turn then creates the real automation (that will contain trigger: & condition: & action: elements etc).

same answer as q1; the code is not a complete/real automation but the input necessary to generate a complete automation. I think the package can only process the true automation.

1 Like

Ok, I understand now. Thanks. :+1:
However, my conclusion has to be that packages do not suit my purpose :man_shrugging:

I might be wrong here - that was just my thinking given I don’t use blueprints. Someone else may yet chime in.