#I guess I m not clear why you re locked

1 messages · Page 1 of 1 (latest)

sullen narwhal
#

Maybe I'm not, but if so, please educate me.

#

cover.toggle probably calls cover.open or cover.close

I have to be able to call a single service with tap-action.

#

I can make it work if I was okay going to 100% open, but the Ikea blinds don't behave well when you let them go to 100%

ripe garden
#

Any control over calibrating their max open position?

sullen narwhal
#

Not within the device itself, you can set the lower-limit, but not upper

ripe garden
#

Hmmm, I'm not very well versed in covers, but if that's the case... I'd probably end up making a script. That way you can put your logic to toggle accordingly in there

sullen narwhal
#

Yeah, I figured the answer would be within scripts, but if there was a way to modify the way a service works, or possibly with templates, I thought that might be the right approach.

#

I was trying to extend this script:

  sequence:
    - condition: template
      value_template: "{{ states('media_player.kitchen') in ['paused', 'playing'] }}"
    - service: media_player.media_play_pause
      entity_id: media_player.kitchen```
ripe garden
#

The only way you could do that I'm aware of if effectively wrapping your existing cover with a template cover so you can define your own implementations... but that feels rather messy

sullen narwhal
#

Convert it into cover.open/close

#

Here's where I'm at:

  sequence:
  - condition: template
    value_template: "{{ states('cover.den_blinds_1') in ['closed', 'open'] }}"
  - service: cover.toggle
    entity_id: cover.den_blind_1```
#

I don't know this "scripting" language, if you can call it that. I need to know how to change the service called based on current state

#

So if I can call cover.close if state is open and cover.open (with a position payload of 95%) if state is closed, that's what I'm trying to accomplish.

#

actually, just reading it, I may have figured it out

#

Hmm, maybe not..I need the equivalent of an if..then...elseif..then

#

Found the docs

ripe garden
#

Yeah, you'll likely need a condition for either case

sullen narwhal
#
  - if:                                                                              
      - alias: "Cover is open"                                                       
        condition: state                    
        entity_id: cover.den_blind_1 
        state: "open"               
    then:                           
      - alias: "Close the blind"    
        service: cover.close        
        target:                     
          entity_id: cover.den_blind_1                              
    else:                                                                     
      - alias: "Open the blind"                                     
        service: cover.set_cover_position                           
        data:                                                       
          position: 95                                              
        target:                                                     
          device_id: cover.den_blind_1   ```