Hi All,
Can’t seem to get my head around this.
I have a garage door with positions. I’m trying to have the cards coloured based on the position of the door. The icons change between open and closed which is fine, but i would like to have it so that after a button is pushed, it flashes until the door reaches requested position.
type: 'custom:button-card'
name: 25%
entity: cover.garage_door_controller_control_2
tap_action:
action: call-service
service: cover.set_cover_position
service_data:
entity_id: cover.garage_door_controller_control_2
position: 25
pedolsky
(Pedolsky)
May 22, 2021, 10:16am
2
Hi scoobee81,
there‘s a nice example in the docs that can be modified:
state:
- value: 25
operator: '!='
styles:
card:
- animation: blink 2s ease infinite
Thanks - Can you posssibly link me to where it is in the docs? I can’t seem to be able to find it.
I’ve used what you suggested and i can get it to flash.
But what i need is for it to flash while the door is moving and stop when the correct position in highlighted with a tollerance of +/- 5
pedolsky
(Pedolsky)
May 22, 2021, 12:04pm
4
Sure:
—> topics „operator on state“ & „blink“
And yes - sorry! - the example above works only with state, forgot about that. I quickly tested the following code with one of my covers:
state:
- operator: template
value: |
[[[
if (entity.attributes.current_position != 25) return ' ';
]]]
styles:
card:
- animation: blink 2s ease infinite
Ok, so i’ve got the door working properly now.
The state of the door changes to ‘closing’ or ‘opening’ depending on whats happening.
I’ve created an input number for the request value.
What i’m trying to achieve.
Push button 25%
Button 25% will flash green while the door is moving
Once the door reached 25% it the light will turn solid green.
pedolsky
(Pedolsky)
May 24, 2021, 6:23pm
6