forked from syssi/esphome-soyosource-gtn-virtual-meter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
esp8266-display-display-version-limiter-example.yaml
225 lines (196 loc) · 6.43 KB
/
esp8266-display-display-version-limiter-example.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
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
substitutions:
name: soyosource-gtn-display
device_description: "Monitor and control the Soyosource GTN (WiFi version) via the display port and control the power output on demand via RS485"
external_components_source: github://syssi/esphome-soyosource-gtn-virtual-meter@main
# The internal display port should be connected to these GPIOs using a JST XH 2.54mm, 4 Pin connector (RX, TX, GND, VCC)
# A optocoupler / optical isolator (f.e. ADUM1201) between the display port and the ESP is recommended if the ESP isn't powered by the display port!
tx_pin_ttl_wifi: GPIO4
rx_pin_ttl_wifi: GPIO5
tx_pin_rs485: GPIO14
rx_pin_rs485: GPIO12
esphome:
name: ${name}
comment: ${device_description}
min_version: 2024.6.0
project:
name: "syssi.esphome-soyosource-gtn-virtual-meter"
version: 2.2.0
esp8266:
board: d1_mini
external_components:
- source: ${external_components_source}
refresh: 0s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
platform: esphome
logger:
level: INFO
# If you use Home Assistant please remove this `mqtt` section and uncomment the `api` component!
# The native API has many advantages over MQTT: https://esphome.io/components/api.html#advantages-over-mqtt
mqtt:
broker: !secret mqtt_host
username: !secret mqtt_username
password: !secret mqtt_password
id: mqtt_client
# api:
uart:
- id: uart_0
baud_rate: 9600
tx_pin: ${tx_pin_ttl_wifi}
rx_pin: ${rx_pin_ttl_wifi}
- id: uart_1
baud_rate: 4800
tx_pin: ${tx_pin_rs485}
rx_pin: ${rx_pin_rs485}
soyosource_modbus:
- id: modbus0
uart_id: uart_1
# flow_control_pin: GPIO12
# Optional settings
#
# The name is used as prefix for some log messages and should
# help to distinguish between different instances/devices
name: firstfloor_inverter
soyosource_virtual_meter:
- id: virtualmeter0
soyosource_modbus_id: modbus0
# The state of this sensor (instantaneous power in watt) is used as source
power_id: powermeter0
# Optional settings
power_sensor_inactivity_timeout: 20s
power_demand_calculation: NEGATIVE_MEASUREMENTS_REQUIRED
min_power_demand: 0
max_power_demand: 900
zero_output_on_min_power_demand: true
# Split/distribute the power demand if you have multiple inverters attached to the same RS485 bus
power_demand_divider: 1
# A positive buffer value (10) tries to avoid exporting power to the grid (demand - 10 watts)
# A negative buffer value (-10) exports power to the grid (demand + 10 watts)
buffer: 10
# The operation_status_id sensor is expected here. Passing the operation_status won't work
# The state is used to suspend the limiter if the operation status of the inverter isn't 0x0 (normal)
operation_status_id: operation_status_id0
# The update interval is important and defaults to 3 seconds. If the demand is sent too frequently
# or rarely the interverter stops. TODO: Identify and validate the lower and upper update limit
update_interval: 3s
soyosource_display:
- id: display0
uart_id: uart_0
protocol_version: SOYOSOURCE_DISPLAY_VERSION
update_interval: 5s
binary_sensor:
- platform: soyosource_display
fan_running:
name: "${name} fan running"
limiter_connected:
name: "${name} limiter connected"
button:
- platform: soyosource_display
restart:
name: "${name} restart"
number:
- platform: soyosource_virtual_meter
soyosource_virtual_meter_id: virtualmeter0
buffer:
name: "${name} buffer"
initial_value: 10
restore_value: true
manual_power_demand:
name: "${name} manual power demand"
max_value: 900
max_power_demand:
name: "${name} max power demand"
initial_value: 600
max_value: 900
restore_value: true
power_demand_divider:
name: "${name} power demand divider"
initial_value: 1
restore_value: true
- platform: soyosource_display
start_voltage:
name: "${name} start voltage"
shutdown_voltage:
name: "${name} shutdown voltage"
# Maximum output power in limiter mode / Output power in constant power mode
output_power_limit:
name: "${name} output power limit"
start_delay:
name: "${name} start delay"
select:
- platform: soyosource_display
operation_mode:
name: "${name} operation mode"
optionsmap:
1: "Battery Constant Power"
2: "PV"
16: "Battery Limit"
sensor:
- platform: soyosource_virtual_meter
soyosource_virtual_meter_id: virtualmeter0
power_demand:
name: "${name} power demand"
- platform: soyosource_display
error_bitmask:
name: "${name} error bitmask"
operation_mode_id:
name: "${name} operation mode id"
operation_status_id:
name: "${name} operation status id"
id: operation_status_id0
battery_voltage:
name: "${name} battery voltage"
battery_current:
name: "${name} battery current"
battery_power:
name: "${name} battery power"
ac_voltage:
name: "${name} ac voltage"
ac_frequency:
name: "${name} ac frequency"
temperature:
name: "${name} temperature"
output_power:
name: "${name} output power"
# mqtt subscribe example
- id: powermeter0
internal: true
platform: mqtt_subscribe
name: "${name} instantaneous power consumption"
topic: "smartmeter/sensor/groundfloor/obis/1-0:16.7.0/255/value"
accuracy_decimals: 2
unit_of_measurement: W
device_class: power
filters:
- throttle_average: 15s
# # import smartmeter reading from homeassistant
# # requires the "api" component see above
# - platform: homeassistant
# id: powermeter0
# name: "${name} smartmeter instantaneous power"
# entity_id: sensor.firstfloor_smartmeter_instantaneous_power
# filters:
# - throttle_average: 15s
switch:
- platform: soyosource_virtual_meter
soyosource_virtual_meter_id: virtualmeter0
manual_mode:
name: "${name} manual mode"
restore_mode: RESTORE_DEFAULT_ON
emergency_power_off:
name: "${name} emergency power off"
restore_mode: RESTORE_DEFAULT_OFF
text_sensor:
- platform: soyosource_virtual_meter
soyosource_virtual_meter_id: virtualmeter0
operation_mode:
name: "${name} limiter operation mode"
- platform: soyosource_display
errors:
name: "${name} errors"
operation_mode:
name: "${name} operation mode"
operation_status:
name: "${name} operation status"