Cover template YAML

Hi all;

I have some Flair vents in my house and I need to create a template helper to support the close_cover / open_cover actions. I did this once for my ratdgo garage but that script came pre-built so now I’m trying to wonder, for these vents, where to get the State and actions from. I’m not savvy enough to figure out where I can find the data for them.

show us the device page for the flair vents with all it’s entities

I managed to find all this:


So I know some of this will be relevant, but then I open the Template Helper and saw all this:

And that really threw me for a loop!

What are all those controls? One is a button, the other is a select, not sure what the last one is. But going to need that information. What happens when you press the button? What happens when you select an activity?

This is what I’ve clobbered together based on some AI stuff and looking at the Developer tools:

cover:
template:
  cover:
      flair_vent_template:
        device_class: damper
        friendly_name: "Living Room Vent Template"
        position_template: "{{ state_attr('cover.dining_room_vent', 'current_position') }}"
        open_cover:
        action: cover.open_cover_tilt
        target:
          entity_id: cover.dining_room_vent
      close_cover:
        action: cover.close_cover_tilt
        target:
          entity_id: cover.dining_room_vent
      set_cover_position:
        action: cover.set_cover_tilt_position
        target:
          entity_id: cover.dining_room_vent
        data:
          tilt_position: "{{ position }}"

I got some of the info from here:

None of that makes sense though. Why are you creating a cover if you already have one? None of it appears to point to any of the entities in the first screenshot.

That is a fantastic question. The problem I’m having is the integration works great if I make a scene for example, but adding the cover to a dashboard I get this:

Which I assumed was where I needed the template to make those commands work. The ratdgo garage door did the same thing. It’s also likely why the vents do not respond when Bridged to HomeKit (which is what my wife uses at home).

There is no cover here

so where are you getting this cover from?

That looks like an select entity (Activity status), a button entity (Clear hold), a climate entity (Room) and a sensor entity (Temperature holding until).

It’s how they show up:

I know the device type is “damper” but they self-assign themselves as cover. Nor have I seen a damper control anywhere.

Either one or the other screenshot is wrong and only you can determine that. Either vent is your entity, or the device you showed is not correct. Regardless, I need to see the actual entities that are created on this device.

Something like this?

click back here

Then click the 3 dots on your cover, click details, take a screenshot. Then click back. Click the 3 dots again and click device info and take a screenshot of that.

Thanks for all the help btw


Your cover only supports tilt. So you’d use that feature in the UI.

image

I see, so that leads me to ask:

  1. How do I add tilt to the UI? If I add it by entity it automatically creates a cover and gives me the error.
  2. How would I be able to bridge this to HomeKit? Because it also wants to bridge out as a Cover.

I guess my idea was to create a Cover Template to assign instructions (like tilt to 0 and tilt to 100) as Closed and Open

via yaml that would be

template:
  cover:
    - device_class: damper
      name: "Living Room Vent Template"
      position: "{{ state_attr('cover.dining_room_vent', 'current_tilt_position') }}"
      open_cover:
        action: cover.open_cover_tilt
        target:
          entity_id: cover.dining_room_vent
      close_cover:
        action: cover.close_cover_tilt
        target:
          entity_id: cover.dining_room_vent
      set_cover_position:
        action: cover.set_cover_tilt_position
        target:
          entity_id: cover.dining_room_vent
        data:
          tilt_position: "{{ position }}"

Perfect. I’ll give this a shot. Thanks!

Okay I did this for all my vents but now I’m getting this error:

cover:
template:
  cover:
    device_class: damper
    name: "Dining Room Vent Template"
    position: "{{ state_attr('cover.dining_room_vent', 'current_position') }}"
    open_cover:
      action: cover.open_cover_tilt
      target:
        entity_id: cover.dining_room_vent
    close_cover:
      action: cover.close_cover_tilt
      target:
        entity_id: cover.dining_room_vent
    set_cover_position:
      action: cover.set_cover_tilt_position
      target:
        entity_id: cover.dining_room_vent
      data:
        tilt_position: "{{ position }}"

That’s not what I posted. You’ve added extra keys and the position template isn’t what I wrote.

What I posted goes in configuration.yaml.

Oh weird. Hm okay I just deleted everything and now it hasn’t given me an log issue, although the UI is still giving me the same error: