Erro cover.set_cover_position

@jgracio, você chegou a encontrar como controlar a posição desta cover? Esto enfrentando o memso problema mas consegui entender porque da mensagem de erro. Ao criar a cover no configuration.yaml eu precisei especificar o que será feito quando o serviço de posição for chamado:

- platform: template
    covers:
      cover_1:
        friendly_name: "Persiana Quarto"
        open_cover:
          service: script.cover_1_up
        close_cover:
          service: script.cover_1_down
        stop_cover:
          service: script.cover_1_pause
        set_cover_position:
          service: script.cover_1_position

Com isso o erro não ocorre mais, poém ainda não encontrei um exemplo de script que possa buscar a posição inicial e controlar o tempo de abertura ou fechamento para envio do comando de pausa no momento correto.
Você encontrou alguma coisa?

Just got it!

cover:
  - platform: template
    covers:
      cover_1:
        friendly_name: "Persiana Quarto"
        open_cover:
          service: script.open_cover
        close_cover:
          service: script.close_cover
        stop_cover:
          service: script.stop_cover
        set_cover_position:
          service: script.set_cover_position
          data_template:
            position_set: '{{ position }}'
            position_previous: 'input_number.cover_1_position'
            entity_id: 'cover.cover_1'
            opening_time: 10
            closing_time: 10

input_number:
  cover_1_position:
    name: Cover 1 Position
    unit_of_measurement: '%'
    min: 0
    max: 100
    step: 10

script:
 dummy:
    sequence:
  stop_cover:
    alias: "Stop Cover"
    sequence:
      - data:
          { "host": !secret ip_rmpro_quarto,
            "packet": [ "sgAaA60UFAcGFBQHBhQGFAYVFAYUBwYUBxQTCAYUEwcHFBQGBxQGFBMIEwcUBxMHBxQGFBMHBxQHFBMHEwgGFBMHFAcGFQYUBxMHFAYUBxQGFAYVEwcGFQYUBhUGFAYUBxQGFAcUBhQHFBQHBhQGFAcUEwcUBxMHFAcTBxQHEwcUBgcUFAYUHK0VEggGFBQHBhQGFQYUEwgTBwYUBxQUBgcUEwgGFBMHBxQGFRMHEwcUBxMHBxQGFBMIBhQHFBMHEwgGFBQHEwcGFQYUBhUGFAYVBhQGFAcUEwcHFAYUBxQGFQYUBhQHFAYUBhUGFBQHBhQHFAYUFAYUBxQHEwcTCBMHEwgTBwYUFAcTHK0VEwcGFBQHBhQGFQYUFAcTBwcUBhQTCAYUEwgGFBQHBhQHFBMHEwgTBxMIBhQGFBQHBhUGFBQGFAcGFRMGFAcHEwcUBhUGFAcUBhQGFQYUFAcGFAcUBhQGFAcUBhUGFAcTBxQGFRMHBhQGFQYVEwcTBxQHEwcUBxMHEwgTBwYVEwcTHK0VFAYHFBMHBhUGFAYVEwcUBgcUBhUTBwYUFAcGFBQHBhQGFRMHFAcTBxQHBhQGFRMHBhUGFBMHFAcGFRMHFAYHFAYUBxQHEwcUBhQHFAYUFAcGFAcUBhQHFAYUBhUGFAcTBxQHFBMHBhQHFAYVEwcTBxQHFAYUBxMHFAcTBwcUEwcTHa0TFQYHFBMHBxQGFAcUEwcUBgcUBhUTBwYUFAcHFBMHBhQHFBQGFAcTBxQHBhQGFRMHBxQGFBQHEwcHFBMHEwgGFAYVBhQHFAYUBhQHFAcTFAcGFAcUBhQHFAYUBxQGFAcUBhQHFBMHBxQGFAYVEwcTBxQHFAYUBxMHFAcTBwcUEwcTHa0UEwcGFRMHBhUGFAcUEwcTCAYUBxQTBwYUFAcGFRIIBhQHFBQGFAcTBxMIBhQHFBMHBxQGFBMIEwcHExQHFAYHFAYUBxQHFAYUBhQHFAYUFAcGFAcUBhQHFAYUBxQGFQUVBhQGFRMHBhUGFAYUFAcTCBMHEwgTBxMHFAcTBwcUEwcTAAXcAAAAAAAAAAAAAAAAAAA=" ]}
        service: broadlink.send
  close_cover:
    alias: "Close Cover"
    sequence:
      - data:
          { "host": !secret ip_rmpro_quarto,
            "packet": [ "sgAaA64UEwcGFRMHBhUGFAYUFAcTBwcUBhQUBwYVEwYHFBQHBhUGExQHFAcTBxMHBxQGFRMHBhUGFBMIEggGFBQHEwcHFAYUBxQGFAcUBhQHFAYUFAcGFAcTBxQGFQYUBhUGFAYVBhQUBgcUBhQHFAcTFAcTBwcUBhQGFRMHFAcTBwcUEwcTHK4UEwcHExQHBhUGFAYUFAcUBgcUBhQUBwYUFAcGFBMIBhUGFBMHFAcTBxMIBhQ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YUFAcGFQYUBhQGFQYUBhUGFAcUBhUFFQYUBxQTBwcUEwcTCBMHEwgTBwYUBxQTCAYUEwcUHKwVEwgGFBMHBxQGFQUVEwcUBwYUBxQTBwYVEwcGFRMHBhUGFBMIEwcTBxQHBhUGFBMHBxQGFBQHEwcGFRMHFAcGFAcUBhQHFAYUBhUGFAYUFAcHFAYUBhUGFAYUBxQGFAcUBhUGFAYUBxQTBwcUEwcTCBMHFAcTBwcUBhQUBwYUEwcUHK0UEwgGFBMHBxQGFAcUEwcUBwYVBhQTBwcUEwcHFBMHBxQGFRMHEwcUBhQHBhUGFBMHBxQGFBQHEwgFFRMHFAcGFAcUBhQHFAYUBxQGFAcUEwcHEwcUBhUGFAYUBxQGFQYUBxQGFAYVBhQTCAYUEwcUBxMHFAcTBwcUBhQTCAYUFAYUHK0UFAcGFBMIBhQHFAYUEwcUBwcUBhQUBgcUEwcHFBMHBxQGFBQHEwcTCBMHBhUGFBQHBhQGFRMHEwcHFBQHEwcGFAcUBhQHFAYUBxQGFAcUEwcHFAYUBxQGFAcTBxQHFAYUBxQGFAYUBxQTCAYUEwgSCBMHFAcTBwcUBhQUBwYUFAcTAAXcAAAAAAAA" ]}
        service: broadlink.send
  set_cover_position:
    sequence:
      - service_template: >
          {% if position_set | float  == 0 %}
            cover.close_cover
          {% elif position_set | float == 100 %}
            cover.open_cover
          {% elif position_set | float == states(position_previous) | float %}
            script.dummy
          {% elif position_set | float > states(position_previous) | float %}
            cover.open_cover
          {% elif position_set | float < states(position_previous) | float %}
            cover.close_cover
          {% endif %}
        data_template:
          entity_id: "{{ entity_id }}"
      - delay:
          seconds: >
            {% if position_set | float == 0 %}
              {{ ( states(position_previous) | float / 100 * closing_time | round ) | int }}
            {% elif position_set | float == 100 %}
              {{ ( ( 100 - states(position_previous) | float ) / 100 * opening_time | round ) | int }}
            {% elif position_set | float > states(position_previous) | float %}
              {{ (( position_set | float - states(position_previous) | float ) / 100 * opening_time | round ) | int }}
            {% elif position_set | float < states(position_previous) | float %}
              {{ (( states(position_previous) | float - position_set | float ) / 100 * closing_time | round ) | int }}
            {% endif %}
      - service_template: >
          {% if position_set | float == 0 %}
            cover.close_cover
          {% elif position_set | float == 100 %}
            cover.open_cover
          {% elif position_set | float > states(position_previous) | float %}
            cover.stop_cover
          {% elif position_set | float < states(position_previous) | float %}
            cover.stop_cover
          {% endif %}
        data_template:
          entity_id: "{{ entity_id }}"
      - service: input_number.set_value
        data_template:
          entity_id: "{{ position_previous }}"
          value: "{{ position_set }}"

Olá pessoal.

Instalei recentemente um estore eletrico e está a ser controlado apenas pelo HA.
O equipamento que lá instalei foi o shelly 2.5 e está tudo OK.

Tenho esta automação:

automation:

  - alias: 'Abrir Persiana Santiago 7:30h'
    trigger:
    - platform: time  
      at: '07:30:00'
    condition:
    - condition: time
      weekday:
        - mon  # Segunda
        - tue  # Terça
        - wed  # Quarta
        - thu  # quinta
        - fri  # sexta
    action:
    - entity_id: cover.persiana_santiago
      service: cover.open_cover
      
  - alias: 'Fechar Persiana Santiago 19:00h'
    trigger:
    - platform: time  
      at: '19:00:00'
    condition:
    - condition: time
      weekday:
        - mon  # Segunda
        - tue  # Terça
        - wed  # Quarta
        - thu  # quinta
        - fri  # sexta
    action:
    - entity_id: cover.persiana_santiago
      service: cover.close_cover

A automação acima abre/fecha por completo, mas também pretendia uma automação que abrisse/ fechasse 50%.

Já tentei várias soluções mas não funcionam…

Alguém tem algo parecido implementado?

Obrigado
Cumps

Eu para execuções com base em horas ou dias, acho que criar automações manualmente é uma perca de tempo.

Há bastante tempo que passei a usar o https://github.com/nielsfaber/scheduler-component em conjunto com o https://github.com/nielsfaber/scheduler-card e passei tudo que é baseado em horários/calendário para aqui.

Permite abre/fechar estores, definir posição, … escolher horários, dias, esquemas…
Na iluminação permite definir a intensidade com que vai ligar ligar…
Tudo fácil de configurar no Frontend Card. Instalação simples via HACS.

Experimenta, penso que vai servir para o pretendido.

1 Curtiu

@Peixeiro obrigado pela dica e pela passagem de conhecimento…

Já está a funcionar…

Um abraço

1 Curtiu

Copyright © 2017-2021. Todos os direitos reservados
CPHA.pt - info@cpha.pt


FAQ | Termos de Serviço/Regras | Política de Privacidade