forked from SebastianHanz/ModBusGateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AlphaModbus.xaml
209 lines (207 loc) · 5.92 KB
/
AlphaModbus.xaml
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
modbus:
- name: "AlphaESS"
close_comm_on_error: false
type: tcp
host: 172.16.75.27
port: 11507
timeout: 4
close_comm_on_error: true
sensors:
- name: "AlphaESS Battery State"
data_type: uint16
address: 258
slave: 85
unique_id: alpha_soc
state_class: measurement
unit_of_measurement: '%'
device_class: battery
scale: 0.1
precision: 1
scan_interval: 30
- name: "AlphaESS Max Charge Power"
data_type: uint16
address: 300
slave: 85
unique_id: alpha_max_charge_power
state_class: measurement
device_class: power
unit_of_measurement: W
scan_interval: 120
- name: "AlphaESS Max Discharge Power"
data_type: uint16
address: 301
slave: 85
unique_id: alpha_max_discharge_power
state_class: measurement
device_class: power
unit_of_measurement: W
scan_interval: 120
- name: "AlphaESS Inverter Power"
data_type: int16
address: 294
slave: 85
scale: -1
unique_id: alpha_inverter_power
state_class: measurement
device_class: power
unit_of_measurement: W
scan_interval: 10
- name: "AlphaESS Min Cell Temperature"
data_type: int16
address: 269
slave: 85
unique_id: alpha_cell_temp_min
state_class: measurement
unit_of_measurement: '°C'
device_class: temperature
scale: 0.1
scan_interval: 120
precision: 1
- name: "AlphaESS Inverter Temperature"
data_type: uint16
address: 0x435
slave: 85
unique_id: alpha_inverter_temp
state_class: measurement
unit_of_measurement: '°C'
device_class: temperature
scale: 0.1
scan_interval: 120
precision: 1
- name: "AlphaESS Battery Charge Energy"
data_type: uint32
address: 288
slave: 85
unique_id: alpha_charge_energy
state_class: total_increasing
unit_of_measurement: 'kWh'
device_class: energy
scale: 0.1
scan_interval: 120
precision: 1
- name: "AlphaESS Battery Discharge Energy"
data_type: uint32
address: 290
slave: 85
unique_id: alpha_discharge_energy
state_class: total_increasing
unit_of_measurement: 'kWh'
device_class: energy
scale: 0.1
scan_interval: 120
precision: 1
- name: "AlphaESS Schedule Registers"
data_type: uint16
address: 2127
scan_interval: 60
slave: 85
unique_id: alpha_reg_schedules
slave_count: 10
count: 11
- name: "AlphaESS Grid Power"
address: 27
data_type: int32
slave: 85
unique_id: alpha_grid_power
state_class: measurement
device_class: power
unit_of_measurement: W
scan_interval: 10
- name: "AlphaESS Solar Power"
address: 155
data_type: int32
slave: 85
unique_id: alpha_solar_power
state_class: measurement
device_class: power
unit_of_measurement: W
scan_interval: 10
- name: "AlphaESS Dispatch Start"
address: 0x880
data_type: uint16
slave: 85
unique_id: alpha_dispatch_start
scan_interval: 10
- name: "AlphaESS Dispatch Power"
address: 0x881
data_type: int32
slave: 85
unique_id: alpha_dispatch_power
state_class: measurement
device_class: power
unit_of_measurement: W
scan_interval: 30
- name: "AlphaESS Dispatch SoC"
address: 0x886
data_type: uint16
slave: 85
unique_id: alpha_dispatch_soc
state_class: measurement
device_class: battery
unit_of_measurement: '%'
scan_interval: 30
scale: 0.4
- name: "AlphaESS Dispatch Duration"
address: 0x887
data_type: uint32
slave: 85
unique_id: alpha_dispatch_time
unit_of_measurement: 's'
scan_interval: 30
- name: "AlphaESS Dispatch Mode"
address: 0x885
data_type: uint16
slave: 85
unique_id: alpha_dispatch_mode
scan_interval: 30
switch:
- platform: template
switches:
alphaess_grid_charge:
friendly_name: "AlphaESS Grid Charge"
availability_template: "{{ is_state('sensor.alphaess_dispatch_start', '1') or is_state('sensor.alphaess_dispatch_start', '0') }}"
value_template: "{{ is_state('sensor.alphaess_dispatch_start', '1')}}"
icon_template: mdi:home-battery
turn_on:
# dispatch start
- service: modbus.write_register
data_template:
hub: "AlphaESS"
unit: 85
address: 0x880
value: [1]
# dispatch power
- service: modbus.write_register
data_template:
hub: "AlphaESS"
unit: 85
address: 0x881
value: [0,29000]
# dispatch soc
- service: modbus.write_register
data_template:
hub: "AlphaESS"
unit: 85
address: 0x886
value: [250]
# dispatch duration
- service: modbus.write_register
data_template:
hub: "AlphaESS"
unit: 85
address: 0x887
value: [0, 14400]
# dispatch mode
- service: modbus.write_register
data_template:
hub: "AlphaESS"
unit: 85
address: 0x885
value: [2]
turn_off:
- service: modbus.write_register
data_template:
hub: "AlphaESS"
unit: 85
address: 0x880
value: [0]