-
Notifications
You must be signed in to change notification settings - Fork 3
/
esp8266-wifi-dongle-limiter-Web.Local.yaml
240 lines (211 loc) · 6.44 KB
/
esp8266-wifi-dongle-limiter-Web.Local.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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
substitutions:
name: soyosource-wifi-dongle-limiter
hostname: soyo
device_description: "Monitor and control the WiFi version of the Soyosource GTN using the OEM WiFi dongle and control the power output on demand via RS485"
external_components_source: github://syssi/esphome-soyosource-gtn-virtual-meter@main
tx_pin_rs485: GPIO5
rx_pin_rs485: GPIO14
esphome:
name: ${hostname}
comment: ${device_description}
project:
name: "syssi.esphome-soyosource-gtn-virtual-meter"
version: 2.1.0
esp8266:
board: esp12e
external_components:
- source: ${external_components_source}
refresh: 0s
- source:
type: local
path: components
components: [ soyosource_virtual_meter ]
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
web_server:
port: 80
#logger:
# baud_rate: 0
# level: INFO
logger:
# level: DEBUG
level: INFO
logs:
api.service: WARN
ota: WARN
# sensor: DEBUG
sensor: WARN
# 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: GPIO1
rx_pin: GPIO3
- id: uart_1
baud_rate: 4800
tx_pin: ${tx_pin_rs485}
rx_pin: ${rx_pin_rs485}
debug:
direction: BOTH
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: 1100
zero_output_on_min_power_demand: false
# 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: -50
# 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_WIFI_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: "PV"
2: "Battery Constant Power"
17: "PV Limit"
18: "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"
total_energy:
name: "${name} total energy"
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"