-
Notifications
You must be signed in to change notification settings - Fork 6
/
CoverControlButton.yml
118 lines (96 loc) · 3.55 KB
/
CoverControlButton.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#
# Home Assistant Automation Blueprint
#
# CoverControl by Single Switch
#
# Revision 1.1
# Modified by Johan Schelin, Mar. 2021
#
# TODO IN COMING VERSIONS
# - ADD A TIMER SO THE BUTTONS DOESN'T STAY PUSHED
# - ADD A THREE-CONTROL-BUTTON VARIANT
# - ADD A DOUBLE COVER CONTROL VARIANT TO CONTROL TWO BLINDS FROM SAME BUTTON
blueprint:
name: Dual Relay blinds control
description: '# Dual Relay Blinds/Shades control
Allows control of blinds, shades or other cover-like mechanisms that are driven
by an interlocking dual relay device, where only one relay can be on at a time.
These devices are readily availalble from multiple manufacturers.
The dual relay device also needs an inching function for the best functionality.
That way the switch entities will turn themselves off when idle, and you can save
button presses or switch clicks.
The motor for your blinds needs to stop at set points automatically. This is the
case with most cheap DC tube motors for shades you would order online.
## Configuration requires 4 entities:
+ One switch entity for up/open
+ One switch entity for down/close
+ An input_boolean for the current state/last move (on is up/open, off is down/closed).
+ An entity which will act as a momentary switch to open, close, or stop the blinds.
A switch or input_boolean is recommended.
## Function:
+ If the relays are both off, the shades will move in the oposite direction from
their last move, and the state boolean will be updated.
+ If either the up switch or down switch is on, it will turn both off '
domain: automation
input:
up_entity:
name: Up/Open
description: The switch entity that raises/opens your shades.
selector:
entity:
domain: light
down_entity:
name: Down/Close
description: The switch entity that lowers/closes your shades.
selector:
entity:
domain: light
blinds_switch_entity:
name: Control Entity
description: Switch, input_boolean, or other entity with on and off states which
will act as a momentary button to open, close, and stop your blinds.
selector:
entity: {}
state_boolean:
name: State Boolean
description: You must create and specify an input_boolean to store the state
of your shade/blind.
selector:
entity:
domain: input_boolean
source_url: https://community.home-assistant.io/t/switch-as-toggle-to-control-shades-blinds/289662
variables:
upe: !input 'up_entity'
dne: !input 'down_entity'
bsw: !input 'blinds_switch_entity'
sbl: !input 'state_boolean'
trigger:
- platform: state
entity_id: !input 'blinds_switch_entity'
from: 'off'
to: 'on'
action:
- service: homeassistant.turn_off
entity_id: !input 'blinds_switch_entity'
- service: light.turn_on
data_template:
entity_id: '{% if states(upe) == ''off'' and states(dne) == ''off'' and states(sbl)
== ''off''%} {{ upe }} {% else %} none {% endif %}
'
- service: light.turn_on
data_template:
entity_id: '{% if states(upe) == ''off'' and states(dne) == ''off'' and states(sbl)
== ''on''%} {{ dne }} {% else %} none {% endif %}
'
- service: light.turn_off
data_template:
entity_id: '{% if states(upe) == ''on'' or states(dne) == ''on'' %} {{ upe }},
{{ dne }} {% else %} none {% endif %}
'
- delay: 0.5
- service: input_boolean.toggle
data_template:
entity_id: '{% if states(upe) == ''on'' or states(dne) == ''on'' %} {{ sbl }}
{% else %} none {% endif %}
'
mode: queued