-
Notifications
You must be signed in to change notification settings - Fork 0
/
automations.yaml
166 lines (166 loc) · 4.36 KB
/
automations.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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# SOME automations for DomBusEVSE module
- id: '1686869578501'
alias: EVMaxCurrentAutomation
trigger:
- platform: state
entity_id:
- input_number.evmaxcurrent
condition: []
action:
- service: modbus.write_register
data:
hub: dombus1
address: 9001
slave: 227
value: '{{ states(''input_number.evmaxcurrent'') | int }}'
mode: single
- id: '1686869578502'
alias: EVMaxGridPowerAutomation
trigger:
- platform: state
entity_id: input_number.evmaxgridpower
action:
- service: modbus.write_register
data:
hub: dombus1
address: 9002
slave: 227
value: '{{ states(''input_number.evmaxgridpower'') | int }}'
mode: single
- id: '1686869578503'
alias: EVStartPowerAutomation
trigger:
- platform: state
entity_id: input_number.evstartpower
action:
- service: modbus.write_register
data:
hub: dombus1
address: 9003
slave: 227
value: '{{ states(''input_number.evstartpower'') | int }}'
mode: single
- id: '1686869578504'
alias: EVStopTimeAutomation
trigger:
- platform: state
entity_id: input_number.evstoptime
action:
- service: modbus.write_register
data:
hub: dombus1
address: 9004
slave: 227
value: '{{ states(''input_number.evstoptime'') | int }}'
mode: single
- id: '1686869578505'
alias: EVAutoStartAutomation
trigger:
- platform: state
entity_id: input_number.evautostart
action:
- service: modbus.write_register
data:
hub: dombus1
address: 9005
slave: 227
value: '{{ states(''input_number.evautostart'') | int }}'
mode: single
- id: '1686869578506'
alias: EVMaxPower2
trigger:
- platform: state
entity_id: input_number.evmaxpower2
action:
- service: modbus.write_register
data:
hub: dombus1
address: 9006
slave: 227
value: '{{ states(''input_number.evmaxpower2'') | int }}'
mode: single
- id: '1686869578507'
alias: EVMaxPowerTimeAutomation
trigger:
- platform: state
entity_id: input_number.evmaxpowertime
action:
- service: modbus.write_register
data:
hub: dombus1
address: 9007
slave: 227
value: '{{ states(''input_number.evmaxpowertime'') | int }}'
mode: single
- id: '1686869578508'
alias: EVMaxPowerTime2Automation
trigger:
- platform: state
entity_id: input_number.evmaxpowertime2
action:
- service: modbus.write_register
data:
hub: dombus1
address: 9008
slave: 227
value: '{{ states(''input_number.evmaxpowertime2'') | int }}'
mode: single
- id: '1686869578509'
alias: EVWaitTimeAutomation
trigger:
- platform: state
entity_id: input_number.evwaittime
action:
- service: modbus.write_register
data:
hub: dombus1
address: 9009
slave: 227
value: '{{ states(''input_number.evwaittime'') | int }}'
mode: single
- id: "evstatenameautomation"
alias: "Automation that updates EVStateName entity when EVState changes"
trigger:
- platform: state
entity_id: sensor.evstate
action:
- service: input_select.select_option
data:
entity_id: input_select.evstatename
option: >
{% set slist = state_attr('input_select.evstatename','options') %}
{% set item = states.sensor.evstate.state|int %}
{{slist[item]}}
- id: "evmodenameautomation"
alias: "Automation that updates EVModeName entity when EVMode changes"
trigger:
- platform: state
entity_id: sensor.evmode
action:
- service: input_select.select_option
data:
entity_id: input_select.evmodename
option: >
{% set slist = state_attr('input_select.evmodename','options') %}
{% set item = states.sensor.evmode.state|int %}
{{slist[item]}}
- id: "evmodenameautomationrev"
alias: "Automation that updates EVMode from EVModeName when button EVStateSet is pushed"
trigger:
- platform: state
entity_id: input_button.evmodeset
action:
- service: modbus.write_register
data:
hub: dombus1
address: 3
slave: 227
value: >
{% set slist = state_attr('input_select.evmodename','options') %}
{% set itemname = states.input_select.evmodename.state %}
{% set itemnum = 0 %}
{% for name in slist %}
{% if name == itemname %}
{{ loop.index0 }}
{% endif %}
{% endfor %}