Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "reverse-position" option for formatting and secondary_info #135

Closed
myhomeiot opened this issue Nov 7, 2020 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@myhomeiot
Copy link

myhomeiot commented Nov 7, 2020

In home assistant cover position it's a value from 0 to 100 which shows how much cover/blind/awning is open, for example 100 mean fully open. For many users this representation it's not native and they prefer to see how much cover is closed, for example 0 for fully open and 100 for fully close. In order to do it we need to make sensor for every cover which will subtract current position from 100:

    cover_living_room_current_position:
      friendly_name: Cover Living Room Current Position
      unit_of_measurement: '%'
      icon_template: 'mdi:blinds'
      value_template: "{{ 100 - state_attr('cover.living_room', 'current_position') }}"

It's will be very useful to have this reverse-position option for formatting and secondary_info which will do this calculation (100 - current_position).

Update: HA secondary_info also support the tilt-position but I'm not sure if it's required reverse equivalent probably, it's will be good to have for consistency.

@benct
Copy link
Owner

benct commented Nov 12, 2020

This card also supports tilt-position so you could try, but I'm also not sure it will work. I'll have a look at adding a "reverse" option.

@benct benct added the enhancement New feature or request label Nov 12, 2020
@myhomeiot
Copy link
Author

This card also supports tilt-position so you could try, but I'm also not sure it will work. I'll have a look at adding a "reverse" option.

In my case tilt-position return empty value. And cover has only following properties:

current_position: 100
friendly_name: Living Room
supported_features: 7
icon: mdi:blinds

@benct
Copy link
Owner

benct commented Dec 23, 2021

Formatting option for (reversed) position added in version 4.4.0.

attribute: current_position
format: position

@benct benct closed this as completed Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants