Template blueprint appears to load but does not appear in list of blueprints

I’m trying to write my first template blueprint. Admittedly, this is using AI to create but the template does look correct to me. I have written many automation blueprints.

I am able to load the template without error but then it does not show up in the list of blueprints. I am assuming that these template sensors work similar to the automation ones where you open the template and create something from it by changing the defaults. Is that correct?

Here’s the code I am working with:
https://dpaste.org/JgcNp/raw

I am noticing that /config/blueprints/template/dpaste.org is empty. This is probably the problem. What might be the cause of it not writing? If I try to import again using the link above it tells me that the blueprint already exists. I tried overriding and it again appears to not download the BP but also gives no error

No, template blueprints are currently YAML only, they will not show up in the UI… there isn’t even a place for them to show up yet since it wouldn’t make sense for them to be under Automations or Scripts.

Using AI for this is only going to give you a headache. There are probably less than 20 examples of template entity blueprints publicly available, so AI will be in full-on, bullshit engine mode.

Issues:

  • Template blueprints do not use the legacy template sensor format… they have their own configuration format based on the more current template sensor configuration.
  • Inputs cannot be used directly in templates: Cookbook Article - "Get your input value into a template’
  • The entity key (sensor in the case) accepts a dictionary, not a list… that little dash you have on the next line will cause it to fail with an annoyingly vague error message once you configure an actual sensor.
  • Though it is not currently usable, the entity selector is not properly constructed. This probably won’t have any effect on the blueprint working, but it would cause the UI editor to fail, if it existed.
  • The entity should be binary sensor… using sensors with one-off custom states for binary outputs leads to a lot of confusion.
Example Blueprint for Template Binary Sensor
blueprint:
  name: Vibrating Appliance Status Sensor
  description: Creates a template sensor to monitor an appliance's status based on vibration count.
  domain: template
  input:
    vibration_sensor:
      name: Vibration Sensor
      description: Sensor entity to monitor for vibration count
      default: sensor.dryer_vibration_count
      selector:
        entity:
          filter:
            - domain: sensor
    vibration_threshold:
      name: Vibration Count Threshold
      description: Minimum vibration count to detect running state
      default: 5
      selector:
        number:
          min: 0
          max: 100
          mode: box
    icon:
      name: Icon
      description: Icon for the sensor
      selector:
        icon:
          placeholder: "mdi:tumble-dryer"
variables:
  vibration_sensor: !input vibration_sensor
  threshold: !input vibration_threshold
binary_sensor:
  state: "{{ states(vibration_sensor) | int(0) >= threshold }}"
  availability: "{{ has_value(vibration_sensor) }}"
  icon: !input icon
  device_class: vibration
Sensor Configuration based on above
template:
  - name: Washing Machine Active
    use_blueprint: 
      path: relative_path_to/your_blueprint.yaml
      input:
        vibration_sensor: sensor.washer_vibration_count
        vibration_threshold: 50
        icon: "mdi:washing-machine"

That is a problem… But why are you trying to import a blueprint that you, ostensibly, wrote? Just add it manually.

Guess I’m not understanding what the point of template blueprints is then. Is it not to import and provide an interface for making changes?

Should I not be getting an error on import or something? I’ll put in some efforts to simplify and see if I can get it to load. Is there a good spot to find the template blueprint examples you mentioned?

Thanks for the tips

Template blueprints are in their infancy and there are many months worth of changes needed to get them in the UI.

1 Like

As I see it, the point of blueprints is to make it easier for users to setup and share configurations. Especially where similar automations, scripts, or template entities may be needed multiple times on a given HA instance.

This is the same process that Automation and Script blueprints went through. The YAML-only version came first, issues were ironed out, and features were added. Then, once they were relatively stable, the UI editor was added. IIRC, it was something like 18 months between those two things happening. Template blueprints are like 8 month old and are still undergoing a significant amount of development by a very small group of contributors. AFAIK, it is the plan that there will be a UI, but it doesn’t exist yet.

From my experience, the error will come when you actually configure an instance of a sensor using the blueprint. As it is now, the blueprint is just a file in a folder somewhere that nothing is trying to use.

I have added a few basic blueprint with configuration examples to the Blueprint Exchange with the template-entity tag

1 Like

Thank you both for the information. This is more of an issue with my thinking this was further along than it is currently.

What I am trying to do is to make an easy to configure template sensor that can be used to monitor a vibration sensor that can determine appliance working states for washer/dryer/dishwasher/etc. The template would be repeatable for all of these different devices with some slight modifications needed to the input variables. Blueprints could make it easy to deploy multiple of these if desired.

Really I’m just wanting to make life easier on the less experienced. Record a YT video, supply links for import, enjoy sort of thing. Can definitely work with doing this as helper but not quite as easy.

A question about a future feature, would it be super difficult to allow for YAML input/edit in the helper creation? That could possibly make what I am trying to do easier as well if user can copy/paste and then modify.