sillyfrog / Automate-Pulse-v2

Rollease Acmeda Automate Pulse Hub v2 integration for Home Assistant
Apache License 2.0
37 stars 8 forks source link

Grouping blinds #2

Closed nickdos closed 3 years ago

nickdos commented 3 years ago

I've got a set of blinds in a room that I want to behave as a single blind. I've created a group via config:

over:
  - platform: group
    name: Lounge blinds
    entities:
      - cover.lounge_1
      - cover.lounge_2

This works as expected but I don't get the custom icons showing in LoveLace.

image

Is there a work-around to get the group to look like other blinds in the UI. I'm thinking a template entity or custom-ui plugin might do this but wanted to see if someone has already done it before reinventing the wheel...

nickdos commented 3 years ago

Had a chance to play around and I've got it working with the following code. Hope this might help someone else...

cover:
  - platform: group
    name: Lounge blinds
    entities:
      - cover.lounge_1
      - cover.lounge_2
  - platform: template
    covers:
      lounge_room_blinds_template:
        device_class: blind
        friendly_name: "Lounge blinds"
        value_template: "{{ states('cover.lounge_blinds') }}"
        open_cover:
          service: cover.open_cover
          target:
            entity_id: cover.lounge_blinds
        close_cover:
          service: cover.close_cover
          target:
            entity_id: cover.lounge_blinds
        stop_cover:
          service: cover.stop_cover
          target:
            entity_id: cover.lounge_blinds
        set_cover_position:
          service: cover.set_cover_position
          target:
            entity_id: cover.lounge_blinds
          data_template:
            position: "{{ position }}"
        icon_template: "{% if is_state_attr('cover.lounge_blinds','current_position',100) %} mdi:blinds-open {% else %} mdi:blinds {% endif %}"