-
Notifications
You must be signed in to change notification settings - Fork 4
/
script.yaml
61 lines (61 loc) · 2.08 KB
/
script.yaml
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
alias: Anpassung Wechselrichter Leistung
sequence:
- if:
- condition: state
entity_id: binary_sensor.wechselrichter_reachable
state: "on"
alias: Wechselrichter erreichbar
alias: "-"
then:
- variables:
altes_limit: >-
{{
states('number.wechselrichter_limit_nonpersistent_absolute') |
float(1) }}
grid_sum: >-
{{ states('sensor.stromzahler_aktuelle_leistung') | float(1)
}}
maximum_wr: "{{ 600 | float(1) }}"
minimum_wr: "{{ 50 | float(1) }}"
setpoint: "{{ (grid_sum + altes_limit - 5.0) | float(1) }}"
alias: Variablen definieren
- if:
- condition: template
value_template: "{{ setpoint > maximum_wr }}"
alias: Neues Limit > 600 W
then:
- service: number.set_value
data:
value: "{{ maximum_wr }}"
target:
entity_id: number.wechselrichter_limit_nonpersistent_absolute
alias: Setze Limit auf 600 W
else:
- if:
- condition: template
value_template: "{{ setpoint < minimum_wr}}"
alias: Neues Limit < 50
then:
- service: number.set_value
data:
value: "{{ minimum_wr }}"
target:
entity_id: number.wechselrichter_limit_nonpersistent_absolute
alias: Setze Limit auf 50 W
else:
- if:
- condition: template
value_template: "{{ setpoint != altes_limit }}"
alias: Neues Limit != Altes Limit
then:
- service: number.set_value
data:
value: "{{ setpoint | float(1) }}"
target:
entity_id: number.wechselrichter_limit_nonpersistent_absolute
alias: Setzte neues Limit
alias: "-"
alias: "-"
alias: "-"
mode: single
icon: mdi:vector-link