-
Notifications
You must be signed in to change notification settings - Fork 78
Invert current_position for shutters #7
Comments
What do you mean by not logical? |
OK, I see now. The component you linked is a Lovelace module, which allows for inverted display of the value. There's nothing to do in this component, as the values are always correct. If you want to use them inverted in Lovelace, you just have to use the custom:slider-entity-row module you just linked, with the patch applied of course. |
Originaly I see the slider like this: With the slider to the left when closed, but my logic tells me that if the blind is closed the slider should be to the right. I already invert the slider logical with a template.
But when you see the state its inverted too, you see open when its closed, and closed when its open. Its all about the slider, I want to see the slider in the right when its closed, like this, but with the correct state. In the two entities the blind its closed. |
I'm sorry this is not possible. You'd have to rewrite the entire logic of Home Assistant to achieve this. |
@keteflips I addressed the same need with the following solution (@nagyrobi maybe you'll want to add this trick to the readme file). I defined in awning_group_position:
name: Awnings position
min: 0
max: 100
step: 25
mode: slider
unit_of_measurement: '%'
icon: mdi:pan-horizontal Then I wrote a script that "converts" values shown by the slider (left = open, right =closed) to the values handled from cover objects (open=100, closed=0): all_covers_set_position:
alias: Set position for all awnings at the same time
sequence:
- service: cover.set_cover_position
entity_id: cover.cover1
data_template:
position: '{{ 100 - states("input_number.awning_group_position")|int }}'
- delay:
milliseconds: 500
- service: cover.set_cover_position
entity_id: cover.cover2
data_template:
position: '{{ 100 - states("input_number.awning_group_position")|int }}'
- delay:
milliseconds: 500
- service: cover.set_cover_position
entity_id: cover.cover3
data_template:
position: '{{ 100 - states("input_number.awning_group_position")|int }}' Finally I defined a simple automation calling the script when slider value changes: alias: Awnings - Set position
description: Change awnings position triggering 'awning_group_position' input number value
trigger:
- entity_id: input_number.awning_group_position
platform: state
condition: []
action:
- service: script.all_covers_set_position Of course you can configure/edit the script and the automation using the Lovelace UI instead of modifying directly the config files. If at home you have several covers to operate, you might want to define a "generic" script taking for instance a |
@keteflips see also this very new custom Lovelace card: hass-shutter-card. |
Done: #21 |
Please can you add invert logical for the position?
With shutters Its not logical to get current_position: 100 when the shutter its fully open.
In other components this option exists:
thomasloven/lovelace-slider-entity-row#134
Thanks.
The text was updated successfully, but these errors were encountered: