-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
esp8266-limiter-example.yaml
145 lines (124 loc) · 4.01 KB
/
esp8266-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
substitutions:
name: soyosource-gtn-virtual-meter
device_description: "Control the power output of a Soyosource GTN on demand via RS485"
external_components_source: github://syssi/esphome-soyosource-gtn-virtual-meter@main
tx_pin: GPIO1
rx_pin: GPIO3
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:
baud_rate: 0
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: 4800
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}
soyosource_modbus:
- id: modbus0
uart_id: uart_0
# 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 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
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
sensor:
- platform: soyosource_virtual_meter
soyosource_virtual_meter_id: virtualmeter0
power_demand:
name: "${name} power demand"
# 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"