-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathsolis-esphome-emw3080.yaml
166 lines (146 loc) · 3.73 KB
/
solis-esphome-emw3080.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
#
# solis-esphome-emw3080.yaml -- Ginlong Solis Inverter ESPhome definition for EMW3080 MCUs.
#
# The hardware described in this file (MCU and GPIO) corresponds to that of the Solis S3 WiFi stick.
#
# (C) 2023-2024 Hajo Noerenberg
#
# Usage:
# 1. Depending on your type of device (INV, ESINV or EPM),
# include modbus definition in 'packages' section below
# 2. Compile and upload
# https://docs.libretiny.eu/docs/projects/esphome/#build-upload
#
#
# http://www.noerenberg.de/
# https://github.com/hn/ginlong-solis
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3.0 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.txt>.
#
esphome:
name: solis-emw3080
friendly_name: Ginlong Solis Inverter
platformio_options:
board_build.mcu: rtl8710bn
board_build.f_cpu: 125000000L
platform_packages:
- framework-arduino-api @ https://github.com/hn/ArduinoCore-API#RingBufferFix
rtl87xx:
board: generic-rtl8710bx-4mb-980k
framework:
version: latest
logger:
packages:
# Uncomment exactly one line depending on your device type
#inv: !include common/solis-modbus-inv.yaml
#esinv: !include common/solis-modbus-esinv.yaml
#epm: !include common/solis-modbus-epm.yaml
# Uncomment for optional INV inverter addon
#inv-acr10r-1ph: !include common/solis-modbus-inv-addon-acr10r-1ph.yaml
time:
- platform: homeassistant
id: network_time
api:
encryption:
key: !secret api_encryption_key
ota:
- platform: esphome
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "Ginlong Solis Inverter"
password: !secret wifi_ap_password
captive_portal:
interval:
- interval: 1s
then:
if:
condition:
wifi.connected:
then:
if:
condition:
switch.is_off: led_green_net
then:
- switch.turn_on: led_green_net
else:
if:
condition:
switch.is_on: led_green_net
then:
- switch.turn_off: led_green_net
script:
- mode: restart
id: modbus_activity
then:
- switch.turn_on: led_orange_com
- if:
condition:
api.connected:
then:
- switch.turn_on: wdt_reset
uart:
id: modbus_uart
tx_pin: PA23
rx_pin: PA18
baud_rate: 9600
modbus:
flow_control_pin: PA19
send_wait_time: 300ms
id: modbus_hw
modbus_controller:
- id: modbus_master
address: 0x1
modbus_id: modbus_hw
setup_priority: -10
button:
- platform: factory_reset
name: Restart with factory default settings
id: reset_all
- platform: restart
name: Reboot device
switch:
- platform: gpio
restore_mode: ALWAYS_OFF
pin: PA12
id: led_orange_com
on_turn_on:
- delay: 500ms
- switch.turn_off: led_orange_com
- platform: gpio
restore_mode: ALWAYS_OFF
pin: PA05
id: led_green_net
- platform: gpio
pin: PA00
id: wdt_reset
on_turn_on:
- delay: 100ms
- switch.turn_off: wdt_reset
binary_sensor:
- platform: gpio
pin:
number: PA08
inverted: true
id: button_reset
on_click:
min_length: 5s
max_length: 300s
then:
- button.press: reset_all
sensor:
- platform: wifi_signal
name: "WiFi Signal"