Possibility to show current shutter-position?

Hi, I would like to have some kind of Cards where I can operate this device…
Showing the current position in a gauge, for example - or having a slider, like shown in the above screenshot (which is only available, if I click to the text from the first picture)

Christoph,
You have to ‘reply’ to someone so we know what question you are answering (OR include enough information for us to just follow it smoothly)

So given your response : -

<template state cover.rollladen_gross_wohnzimmer=open; current_position=23, model_type=HmIP-BROLL, rssi_device=-60, rssi_peer=-61, id=3014F711A0001118A9A59B4D, is_group=False, friendly_name=Rollladen groß Wohnzimmer, icon=hass:window-shutter-alert, supported_features=15 @ 2020-06-24T08:30:24.022154+02:00>

I assume that this was ‘supposed’ to be for me ?
So you entity_id is : - cover.rollladen_gross_wohnzimmer
This is the first time you have properly stated that

Now All devices (from different manufactures, ‘may’) have different attributes and options, so this is why everyone was asking these questions

So given this and @pedrorferreira 's excellent guess, you know you need to set up a sensor based on : - “{{ state_attr(‘cover.rollladen_gross_wohnzimmer’, ‘current_position’) }}”

Do you know how to create a sensor ?
From your post and your pictures it looks like you only use the GUI so I can’t help you with that. But I’m sure someone else here can.
Once you have that you can set up a card to display it. You can have a slider (or just a ‘percentage open’ box (typically not ‘percentage closed’)) to control it.

@pedrorferreira - can you help him with that ?
(though you may not know the GUI that well either :man_shrugging: :rofl: )

@Burningstone - I know the forum is supposed to be in English, but maybe you can PM him, explain normal forum rules/conventions, replies, tagging pasting code direct etc. (tall ask but your German is far better than … well pretty much ‘my anything’ ! :rofl: )
I’m guessing ‘doppless’ counts as a ‘capital’ and therefore not allowed in entity_id’s ?

I’d help more but I don’t actually have any ‘covers’ :roll_eyes:

Hi,

You can have something like this which is a slider under the entity:

Or you can create a simple entity card and add the ‘current_position’ as the Attribute:

type: entity entity: cover.shelly2_5_68e36f_roller_0 attribute: current_position

Additionally, let me see how to put that value on a gauge.

1 Like

Hi :slight_smile:
THanks everyone so far - and sorry, if I did not really provided the relevant information directly… still trying to figure out, where I need to go to get them - or, what exactly you mean … just started with using this software a few days ago… I am pretty sure, that this will get better within the next days :slight_smile:

about the reply thing: when I wrote the replies, I was a bit in a hurry… so my bad - sorry!

Now, I only need to figure out, how I can install the linked “slider-entity-row” … :smiley:
Will let you know, if I could bring it to work.

Thank you all again.

Saw this a few days ago. I don’t personally use it, but might help you out?

1 Like

No worries. We’re always learning Home Assistant with the help of everyone here in the forum.

To help with the custom cards you can install HACS, it makes everything easier.

Pedro,
Not sure about this.
I try to go “as vanilla as possible” so don’t use hacs etc.
(never ever had any problems with upgrades as a consequence)
Chris obviously prefers custom cards etc. so it may not be a problem for him.
So how does this work . (I’m assuming you have covers ? )
I assume you can’t just write a new value to the attribute so…
Do a comparison, drive up if lower, down if higher, stop when value reached ?
Why would someone need a custom component for that ?

Well the position is actually in the entity detail page already as a slide bar, to see and change the position. You click the shutter icon in the entity card and then this page comes up (You can see it in the first message…). IMHO there is no need to complicate things; it might be overkill and an extra load to home assistant and lovelace. I have 12 shutters and i do this way whenever i want to set a position easily… Just for 1 or 2 shutter this might be handy but if you have many shutters, lovelace screen will be too crowded.

Thanks for the education (everyday is a learning day :smiley: ) so if you wanted to set a cover to 40% at 09:30 what would that automation look like ?

https://www.home-assistant.io/integrations/cover/#service-coverset_cover_position says; ‘cover.set_cover_position’ service call is just the service that handles this. You gotta write an automation with a time trigger and service call action for this service with ‘position’ data with an Integer between 0 and 100.

You also can make a scene and then a sheduler to the scene.

Hi Mutt,

You don’t actually need any custom component to deal with shutters. I have 4 shutters managed by Shellys 2.5 and don’t have any custom component associated with it. As @febalci said, the current_position is an attribute to the cover entity and we can view it’s value when clicking on the entity itself.

On a automation it’s pretty simple, you just need to call the cover.set_cover_position service with the position (integer 0-100) you want to set it:

`action:

  • data:
    position: 30
    entity_id: cover.your_cover_entity
    service: cover.set_cover_position`

Hi,
Yes, I saw that the position slider is available within the attributes of this entity.
I just wondered why there is no option to use this within one of the existing cards - since the entity does provide this option - and you have the same “difference” also for other entities.

I mean, it would be just as for the other entities - where you can manually select if you want to use this feature in a card or not (by selecting the device…)

Now I have a way how this could work [unfortunately, I am still struggling a bit with the implementation] :slight_smile:
Thanks a lot!

As far as I know, you can’t create sensors from the GUI currently.

I only see the Doppel-S (double S) how we call it in Switzerland in the friendly name not in the entity_id, so there should be no issue.

There’s a guide on how to install lovelace plugins linked in the link that @pedrorferreira posted:

Hi, yes, I already saw it… but I am still getting an error and I am not yet sure, if (or better where) I’ve made a mistake… :smiley:

Did you restart HA? Can you please post the error?

1 Like

Okay, So here we go with a “vanilla yaml version”
To make it clear,I don’t have covers and don’t plan on having any soon but …
With gracious thanks to : -
@febalci @pedrorferreira for the inputs and @Burningstone just for his usual support :wink:
@Joca - I don’t use scenes, I use scripts for the equivalent, but thanks anyway

I have put the following together, please point out any mistakes
(I don’t have covers - so can’t test at all ) and I’ll correct them so that anyone coming across it doesn’t get side-swiped. (This is written for a package so cut and paste snippets if you don’t use them).

sensor:
  - platform: template
    sensors:
      s_cover_bed1_position:
        friendly_name: Bed 1 Cover Position
        value_template: "{{ state_attr(‘cover.bed1_cover’, ‘current_position’) }}"
        icon_template: >
          {% set posn = state_attr(‘cover.bed1_cover’, ‘current_position’) | int %}
          {% if posn == 0 %}
            mdi:window-shutter
          {% elif posn == 100 %}
            mdi:window-shutter-open
          {% else %}
            mdi:window-shutter-alert
          {% endif %}

input_datetime:
  id_cover_bed1_open:
    name: Bed1 Cover Opens At
    has_time: true
    icon: mdi:clock-start
  id_cover_bed1_close:
    name: Bed1 Cover Closes At
    has_time: true
    icon: mdi:clock-end

input_number:
  in_cover_bed1_posn_ctrl:
    name: Bed 1 Position Control
    min: 0
    max: 100
    step: 1
    mode: slider
    icon: mdi:rotate-right

automation:
  - alias: au_cover_bed1_posn_ctrl
    trigger:
      - platform: state
        entity_id: input_number.in_cover_bed1_posn_ctrl
    action:
      - service: cover.set_cover_position
        data_template:
          entity_id: cover.bed1_cover
          position: "{{ states('input_number.in_cover_bed1_posn_ctrl') | int }}"
  - alias: au_cover_bed1_open
    trigger:
      - platform: template
        value_template: "{{ states('sensor.time') == states('input_datetime.id_cover_bed1_open') [0:5] }}"
    action:
      - service: input_number.set_value
        entity_id: input_number.in_cover_bed1_posn_ctrl
        value: 90
  - alias: au_cover_bed1_close
    trigger:
      - platform: template
        value_template: "{{ states('sensor.time') == states('input_datetime.id_cover_bed1_close') [0:5] }}"
    action:
      - service: input_number.set_value
        entity_id: input_number.in_cover_bed1_posn_ctrl
        value: 0

The above requires sensor.time to have been set up
I’ve put some sample automations in (for time activation too) feel free to adapt

Two possible issues : -

  1. not sure how the position sensor updates I would guess that an attribute change of ‘cover.bed1_cover’ will trigger the update and the ‘watcher’ should be set from reading the template. There’s no other entities so not bothered setting the entity_id: header in the sensor
  2. “IF” someone, manually moves the cover then the ‘input_number.in_cover_bed1_posn_ctrl’ will get out of sync. (I could set an automation watcher on the position, checking that the automation hadn’t fired in the last ~45 seconds, if it hadn’t - wait ~45 seconds and then update the input number with the actual current position. What do you guys think ?

I hate having to build stuff like this without an actual device to work from, so this ‘may’ be my first and last attempt at doing so…

I swear :pray: no edits until someone feeds back a mistake (there’s bound to be at least one)
:beers:

2 Likes

Sorry if this isn’t prudent. I am new at this.

I am trying to create a card that shows the current position of a blind/cover using svg icons (open / 25 / 50 / 75 / closed), so that it animates when opening and closing, plus showing a decently accurate representation of how low the cover is at any moment. The generic icons for open / close is just boring, but what I want to do seems terribly difficult to achieve.

I have read many threads that touch upon it but none that give a complete explanation, so that we who are codeally challenged might understand. Do I have to create a sensor, or a sensor template, or an input_select? Why is it that the entity card can show the attribute current_position, but I cant get that in any other card, like cust button card – let alone actually use the value?

Keeping fingers crossed for some hallelujah answer!

I am using this card to animate the blinds. Maybe the code could help you