|
发表于 2024-9-13 13:56:34
|
显示全部楼层
我的做法是新建一个自定义卷帘, cover.curtain更换为你现有原始窗帘的entity id。
cover:
- platform: template
covers:
livingroom_curtain:
friendly_name: "Livingroom Curtain"
unique_id: curtain_living
open_cover:
service: cover.close_cover
target:
entity_id: cover.curtain
close_cover:
service: cover.open_cover
target:
entity_id: cover.curtain
stop_cover:
service: cover.stop_cover
target:
entity_id: cover.curtain
position_template: "{{100 - state_attr('cover.curtain', 'current_position') | int }}"
value_template: >-
{% if is_state('cover.curtain', 'closed') %}
open
{% elif is_state('cover.curtain', 'open') %}
closed
{% else %}
{{ states('cover.curtain') }}
{% endif %}
set_cover_position:
service: cover.set_cover_position
data:
position: "{{100-position}}"
entity_id: cover.curtain |
|