-
Notifications
You must be signed in to change notification settings - Fork 0
/
smarthome_scene.html
122 lines (109 loc) · 5.19 KB
/
smarthome_scene.html
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
119
120
121
122
/**
* -----------------------------------------------------------------------------
* @package smartVISU
* @author Martin Gleiß
* @copyright 2012
* @license GPL [http://www.gnu.de]
* -----------------------------------------------------------------------------
*/
{% extends "smarthome.html" %}
{% block headline %}
<img class="icon" src='{{ icon0 }}time_automatic.svg' />SmartHomeNG - Szenen
{% endblock %}
{% block docu %}
<div class="preblock">
<span data-role="controlgroup" data-type="horizontal">
Szenen<br />
{{ basic.stateswitch('', 'Wohnzimmer.Szenen', 'midi', 0, 'scene_party.svg') }}
{{ basic.stateswitch('', 'Wohnzimmer.Szenen', 'midi', 1, 'scene_dinner.svg') }}
{{ basic.stateswitch('', 'Wohnzimmer.Szenen', 'midi', 2, 'scene_livingroom.svg') }}
{{ basic.stateswitch('', 'Wohnzimmer.Szenen', 'midi', 3, 'scene_cubby.svg') }}
{{ basic.stateswitch('', 'Wohnzimmer.Szenen', 'midi', 4, 'status_away_1.svg') }}
</span>
</div>
Als "Szenen" können Kombinationen von Schaltaktionen mit mehreren items festgelegt werden. Hierzu wird in der item-Definition eine Szene definiert und die Festlegung der zugehörigen Aktionen
mit passendem Dateinamen im folgenden Verzeichnis abgelegt<br>
<div class="linux">
<code>/usr/local/smarthome/scenes/</code>
</div>
Eine ausführliche Beschreibung der Konfiguration von Szenen findet sich <a href="https://www.smarthomeng.de/user/konfiguration/konfigurationsdateien/scenes.html" target="_blank">hier</a><br><br>
Unser item für die Beispielszene heißt "Wohnzimmer.Szenen". Die Festlegung der Aktionen muss dann in der Datei <span style="color:#D7DF01">Wohnzimmer.Szenen.yaml</span> erfolgen.<br>
In diese Datei schreiben wir von 0 (null) beginnend für jede Szenennummer die gewüschten Aktionen hinein: <br>
<textarea cols="50" rows="3" style="font-family:'Courier New'; font-size:12px">
0:
name: party #optional
actions:
- {item: Wohnzimmer.Spot1Schalten.Spot1Dimmen, value: 120}
- {item: Wohnzimmer.Spot2Schalten.Spot2Dimmen, value: 100}
- {item: Wohnzimmer.Rollo.Position, value: 150}
- {item: Wohnzimmer.RolloWest.Position, value: 200}
- {item: Wohnzimmer.Stehlampe, value: 1}
- {item: Wohnzimmer.Heizung.set, value: 1}
1:
name: dinner
actions:
- {item: Wohnzimmer.Spot1Schalten.Spot1Dimmen, value: 130}
- {item: Wohnzimmer.Stehlampe, value: 1}
- {item: Wohnzimmer.Rollo.Position, value: 200}
- {item: Wohnzimmer.RolloWest.Position, value: 200}
2:
name: normal
actions:
- {item: Wohnzimmer.Steckdose_TV, value: 1}
- {item: Wohnzimmer.Spot2Schalten.Spot2Dimmen, value: 100}
- {item: Wohnzimmer.Rollo.Position, value: 200}
- {item: Wohnzimmer.RolloWest.Position, value: 200}
3:
name: putzen
actions:
- {item: Wohnzimmer.Spot1Schalten, value: 1}
- {item: Wohnzimmer.Spot2Schalten, value: 1}
- {item: Wohnzimmer.Stehlampe, value: 1}
4:
name: abwesend
actions:
- {item: Wohnzimmer.Spot1Schalten, value: 0}
- {item: Wohnzimmer.Spot2Schalten, value: 0}
- {item: Wohnzimmer.Stehlampe, value: 0}
- {item: Wohnzimmer.Steckdose_TV, value: 0}
- {item: Wohnzimmer.RolloSued.Fahren, value: 1}
- {item: Wohnzimmer.RolloWest.Fahren, value: 1}
- {item: Wohnzimmer.Heizung.set, value: 3}
</textarea>
Kurzerklärung für die ersten Zeilen:<br>
<ul>
<li><i>0</i> = Szenennummer</li>
<li><i>name</i> = optionaler Name für die Szene</li>
<li><i>actions</i> = für die Szene auszuführende Vorgänge</li>
<li><i>Wohnzimmer.Spot1Schalten.Spot1Dimmen</i> = Item für die Szene</li>
<li><i>120</i> = Wert für das Item</li>
</ul>
<br>
Das Szenen-Item, welches wir verwenden, sieht wie folgt aus:<br>
<textarea cols="50" rows="3" style="font-family:'Courier New'; font-size:12px">
Wohnzimmer:
Szenen:
type: scene
visu_acl: rw
enforce_updates: yes
knx_dpt: 5
knx_listen: 7/2/0
</textarea>
Da wir hier innerhalb des Items auch eine GA verwenden, ist es somit auch möglich z.B. von einem Tastsensor die Szenen aufzurufen.
Je nachdem welchen Wert (hier von 0-4) man nun auf das Item bzw. die GA sendet, werden die entsprechenden Szenen aufgerufen. <br>
<textarea cols="50" rows="3" style="font-family:'Courier New'; font-size:12px">{% raw %}
<div class="preblock">
Szenen<br />
<span data-role="controlgroup" data-type="horizontal">
{{ basic.stateswitch('', 'Wohnzimmer.Szenen', 'midi', 0, 'scene_party.svg') }}
{{ basic.stateswitch('', 'Wohnzimmer.Szenen', 'midi', 1, 'scene_dinner.svg') }}
{{ basic.stateswitch('', 'Wohnzimmer.Szenen', 'midi', 2, 'scene_livingroom.svg') }}
{{ basic.stateswitch('', 'Wohnzimmer.Szenen', 'midi', 3, 'scene_cubby.svg') }}
{{ basic.stateswitch('', 'Wohnzimmer.Szenen', 'midi', 4, 'status_away_1.svg') }}
</span>
</div>
{% endraw %}
</textarea>
Es ist auch möglich Szenen zeitgesteuert aufzurufen - über crontab oder über die UZSU. Weiterhin ist es möglich Logiken und eval-Ausdrücke innerhalb einer Szene einzubinden.<br>
Mehr dazu findet man <a href="https://www.smarthomeng.de/user/konfiguration/szenen.html" target="_blank">hier</a>.
{% endblock %}