Skip to content

Commit 11c46be

Browse files
committed
Add diagnostic service
1 parent 46ec725 commit 11c46be

5 files changed

Lines changed: 618 additions & 1 deletion

File tree

DIAGNOSTIC_SERVICE.md

Lines changed: 304 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,304 @@
1+
# 🔧 Built-In Diagnostic Service
2+
3+
**Having connection issues?** Use our built-in diagnostic service to test your connection **before** installing the integration!
4+
5+
---
6+
7+
## ✨ What It Does
8+
9+
The diagnostic service:
10+
11+
* ✅ Tests TCP connection to your adapter
12+
* ✅ Reads key registers for your inverter model
13+
* ✅ Validates responses are correct
14+
* ✅ Shows results as a notification
15+
* ✅ Logs detailed output
16+
***No Terminal or SSH needed!**
17+
18+
---
19+
20+
## 🚀 How to Use
21+
22+
### Step 1: Install the Integration Files
23+
24+
You don't need to *configure* the integration, just have the files installed:
25+
26+
1. **Download** the latest release
27+
2. **Extract** to `/config/custom_components/growatt_modbus/`
28+
3. **Restart** Home Assistant
29+
30+
The diagnostic service will be available immediately!
31+
32+
### Step 2: Run the Diagnostic
33+
34+
1. Go to **Developer Tools****Services**
35+
2. Search for **"Growatt Modbus: Run Diagnostic Test"**
36+
3. Fill in the form:
37+
* **IP Address:** Your RS485-TCP adapter IP (e.g., `192.168.1.100`)
38+
* **Port:** Usually `502`
39+
* **Slave ID:** Usually `1` (check inverter display)
40+
* **Inverter Series:** Select your model from dropdown
41+
* **Send Notification:** Leave checked
42+
4. Click **"Call Service"**
43+
44+
### Step 3: Check Results
45+
46+
**Option A: Notification (if enabled)**
47+
48+
* A persistent notification will appear in the top-right
49+
* Shows test results and troubleshooting advice
50+
* Click to expand full details
51+
52+
**Option B: Logs**
53+
54+
* Go to **Settings****System****Logs**
55+
* Search for `growatt_modbus`
56+
* View detailed test results
57+
58+
---
59+
60+
## 📊 Example Results
61+
62+
### ✅ All Tests Passed
63+
64+
```
65+
🔌 Growatt Diagnostic: MIN 7000-10000TL-X
66+
67+
✅ All tests passed (6/6)
68+
69+
Results:
70+
• ✅ Connected to 192.168.1.147:502
71+
• ✅ Register 3000 (Status): Normal
72+
• ✅ Register 3003 (PV1 Voltage): 284.50 V
73+
• ✅ Register 3007 (PV2 Voltage): 289.00 V
74+
• ✅ Register 3011 (PV3 Voltage): 291.20 V
75+
• ✅ Register 3026 (AC Voltage): 240.10 V
76+
77+
✅ Next Steps:
78+
Your inverter is responding correctly!
79+
You can now install the integration.
80+
```
81+
82+
### ⚠️ Partial Success
83+
84+
```
85+
🔌 Growatt Diagnostic: SPH 3000-10000
86+
87+
⚠️ Partial success (3/6)
88+
89+
Results:
90+
• ✅ Connected to 192.168.1.100:502
91+
• ✅ Register 0 (Status): Normal
92+
• ✅ Register 3 (PV1 Voltage): 285.30 V
93+
• ✅ Register 7 (PV2 Voltage): 0.00 V
94+
• ❌ Register 38 (AC Voltage): Read error
95+
• ❌ Register 1013 (Battery Voltage): Read error
96+
• ❌ Register 1014 (Battery SOC): Read error
97+
98+
⚠️ Troubleshooting:
99+
Some registers failed. Try:
100+
• Test during daytime (inverter on)
101+
• Check if correct model selected
102+
• Wait for inverter to fully boot
103+
```
104+
105+
### ❌ All Tests Failed
106+
107+
```
108+
🔌 Growatt Diagnostic: MIN 7000-10000TL-X
109+
110+
❌ All tests failed (0/6)
111+
112+
Results:
113+
• ✅ Connected to 192.168.1.147:502
114+
• ❌ Register 3000 (Status): Read error
115+
• ❌ Register 3003 (PV1 Voltage): Read error
116+
• ❌ Register 3007 (PV2 Voltage): Read error
117+
• ❌ Register 3011 (PV3 Voltage): Read error
118+
• ❌ Register 3026 (AC Voltage): Read error
119+
120+
❌ Troubleshooting:
121+
No registers responded. Check:
122+
• Wiring (try swapping A/B)
123+
• Slave ID (try 1, 2, or 3)
124+
• Inverter is powered on
125+
• Baud rate is 9600
126+
```
127+
128+
---
129+
130+
## 🎯 What Gets Tested
131+
132+
### MIN 3000-6000TL-X
133+
134+
* Status register
135+
* PV1 & PV2 voltage
136+
* AC voltage
137+
* AC frequency
138+
139+
### MIN 7000-10000TL-X
140+
141+
* Status register
142+
* PV1, PV2, PV3 voltage
143+
* AC voltage
144+
145+
### SPH 3000-10000 (Hybrid)
146+
147+
* Status register (base range)
148+
* PV1 & PV2 voltage
149+
* AC voltage
150+
* Battery voltage
151+
* Battery SOC
152+
153+
### MID 15000-25000TL3-X (Three-phase)
154+
155+
* Status register
156+
* PV1 voltage
157+
* Grid voltages (R, S phases)
158+
* Grid frequency
159+
160+
### MOD 6000-15000TL3-XH (Three-phase hybrid)
161+
162+
* Status register
163+
* PV1 voltage
164+
* AC voltage (R phase)
165+
* Battery voltage
166+
* Battery SOC
167+
168+
---
169+
170+
## 🐛 Troubleshooting
171+
172+
### "Service not found"
173+
174+
* Integration files not installed correctly
175+
* Restart Home Assistant after installing files
176+
* Check `/config/custom_components/growatt_modbus/` exists
177+
178+
### "Connection refused"
179+
180+
* Adapter not listening on port 502
181+
* Check adapter web interface settings
182+
* Verify TCP Server or Modbus Gateway mode
183+
184+
### "Timeout" errors
185+
186+
* Inverter is offline (try during daytime)
187+
* Wrong IP address
188+
* Network connectivity issue
189+
190+
### All registers fail but connection succeeds
191+
192+
* Wrong slave ID (try 1, 2, 3)
193+
* RS485 wiring incorrect (swap A/B)
194+
* Wrong inverter model selected
195+
* Baud rate mismatch (should be 9600)
196+
197+
### Some registers work, others don't
198+
199+
* Normal if inverter is offline (night time)
200+
* Some values may be 0V during standby
201+
* Battery registers won't work on non-hybrid models
202+
* Try again during daytime with sun
203+
204+
---
205+
206+
## 🔄 Testing Different Settings
207+
208+
You can run the diagnostic multiple times with different settings:
209+
210+
**Test different slave IDs:**
211+
212+
```yaml
213+
host: 192.168.1.100
214+
slave_id: 1 # Try 1, then 2, then 3
215+
```
216+
217+
**Test different models:**
218+
219+
```yaml
220+
inverter_series: min_7000_10000_tl_x # Try different profiles
221+
```
222+
223+
**Test without notification:**
224+
225+
```yaml
226+
notify: false # Results only in logs
227+
```
228+
229+
---
230+
231+
## ✅ Next Steps After Success
232+
233+
Once your diagnostic passes:
234+
235+
1. **Configure the integration:**
236+
* Go to **Settings** → **Devices & Services**
237+
* Click **Add Integration**
238+
* Search for **Growatt Modbus**
239+
* Select your inverter model
240+
* Enter the same connection details
241+
2. **Check your sensors:**
242+
* Verify all expected sensors appear
243+
* Compare values with inverter display
244+
* Add to Energy Dashboard if desired
245+
3. **Configure options:**
246+
* Set scan interval (default 30s)
247+
* Enable grid power inversion if needed
248+
* Adjust connection timeout if necessary
249+
250+
---
251+
252+
## 📝 Reporting Issues
253+
254+
If diagnostic fails, include this info when reporting:
255+
256+
1. **Full notification text** or log output
257+
2. **Inverter model** (exact model number)
258+
3. **Adapter type** (EW11, USR-W630, etc.)
259+
4. **Time of day** you tested
260+
5. **Inverter display shows** (voltage, status, etc.)
261+
262+
Post in [GitHub Issues](https://github.com/0xAHA/Growatt_ModbusTCP/issues) with this information!
263+
264+
---
265+
266+
## 🎨 Advanced: Automation Example
267+
268+
You can even automate diagnostics! Run tests automatically:
269+
270+
```yaml
271+
automation:
272+
- alias: "Test Inverter Connection at Sunrise"
273+
trigger:
274+
- platform: sun
275+
event: sunrise
276+
offset: "+00:30:00" # 30 min after sunrise
277+
action:
278+
- service: growatt_modbus.run_diagnostic
279+
data:
280+
host: "192.168.1.100"
281+
port: 502
282+
slave_id: 1
283+
inverter_series: "min_7000_10000_tl_x"
284+
notify: true
285+
```
286+
287+
---
288+
289+
## 💡 Tips
290+
291+
* **Test during daytime** - Inverter needs to be powered on
292+
* **Wait 30 seconds** after wiring changes before testing
293+
* **Try all slave IDs** - Some inverters use 2 or 3 instead of 1
294+
* **Check adapter LEDs** - Activity lights should blink during test
295+
* **Compare with display** - Values should match inverter screen
296+
* **Test twice** - First test might fail as inverter wakes up
297+
298+
---
299+
300+
**Questions?** Ask in [GitHub Discussions](https://github.com/0xAHA/Growatt_ModbusTCP/discussions)
301+
302+
**Found a bug?** Report in [GitHub Issues](https://github.com/0xAHA/Growatt_ModbusTCP/issues)
303+
304+
*Made with 🔧 and ☕ for easier troubleshooting from the comfort of your HA UI!*

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,23 @@ Contributions welcome! Here's how:
579579
- ✅ Tested options configuration changes
580580
- ✅ Reviewed logs for errors/warnings
581581

582+
### 🔧 Built-In Diagnostic Service
583+
584+
**NEW!** Test your connection using our built-in service - no Terminal needed!
585+
586+
1. **Install** the integration files (don't need to configure yet)
587+
2. **Restart** Home Assistant
588+
3. Go to **Developer Tools****Services**
589+
4. Search for **"Growatt Modbus: Run Diagnostic Test"**
590+
5. Fill in your connection details
591+
6. Click **"Call Service"**
592+
7. Check the notification for results!
593+
594+
See [DIAGNOSTIC_SERVICE.md](DIAGNOSTIC_SERVICE.md) for full instructions.
595+
596+
**Alternatively:** Use our [standalone Python script](DIAGNOSTIC_TOOL.md) if you prefer command-line testing.
597+
598+
582599
### Help Us Test More Models! 🧪
583600

584601
We need community members with different inverter models to validate the untested profiles. Currently only **MIN 7000-10000TL-X** is tested with real hardware!

custom_components/growatt_modbus/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from .const import DOMAIN
1313
from .coordinator import GrowattModbusCoordinator
14+
from .diagnostic import async_setup_services
1415

1516
_LOGGER = logging.getLogger(__name__)
1617

@@ -22,6 +23,10 @@
2223
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
2324
"""Set up the Growatt Modbus integration."""
2425
hass.data.setdefault(DOMAIN, {})
26+
27+
# Set up diagnostic service
28+
await async_setup_services(hass)
29+
2530
return True
2631

2732

0 commit comments

Comments
 (0)