Skip to content

Commit bbdab7a

Browse files
committed
- Added new service definitions for controlling charge and discharge time slots.
- Enhanced existing service schemas for better validation and clarity
1 parent 99edceb commit bbdab7a

File tree

8 files changed

+600
-86
lines changed

8 files changed

+600
-86
lines changed

.github/copilot-instructions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Home Assistant Integration Development Instructions
22

3-
- Generate Python code for a Home Assistant integration
3+
- Generate high quality Python code for a Home Assistant integration
44
- Keep the integration as simple as possible
5+
- Don't use any third-party libraries
56
- Don't generate docstrings
67
- Add type hints for all functions and methods

README.md

Lines changed: 129 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,44 @@ Doesn't support sensors, switches, or other entities yet - only basic read and c
66

77
See [issue tracker](https://github.com/mkuthan/solis-cloud-control/issues) for further plans.
88

9-
## Read Inverter Settings
9+
## Local run
1010

11-
Storage Mode
11+
Configure Solis Cloud Control API credentials in `secrets.yaml`:
1212

1313
```yaml
14-
action: solis_cloud_control.read
15-
data:
16-
cid: 636
14+
solis_api_key: "YOUR_API_KEY_HERE"
15+
solis_token: "YOUR_TOKEN_HERE"
16+
solis_inverter_sn: "YOUR_INVERTER_SN_HERE"
1717
```
1818
19-
Charge Time Slot 1
19+
Install dependencies (once):
20+
21+
```bash
22+
uv sync
23+
```
24+
25+
Run the integration locally:
26+
27+
```bash
28+
./scripts/run
29+
```
30+
31+
## Read inverter settings
32+
33+
Storage Mode
2034

2135
```yaml
2236
action: solis_cloud_control.read
2337
data:
24-
cid: 5946
38+
cid: 636
2539
```
2640
27-
Charge Time Slot 1 Switch
41+
Charge Time Slot 1
2842
2943
```yaml
3044
action: solis_cloud_control.read
3145
data:
32-
cid: 5916
46+
cid: 5946
3347
```
3448
3549
Charge Time Slot 1 Current
@@ -56,33 +70,71 @@ data:
5670
cid: 5964
5771
```
5872
59-
Discharge Time Slot 1 Switch
73+
Discharge Time Slot 1 Current
6074
6175
```yaml
6276
action: solis_cloud_control.read
6377
data:
64-
cid: 5922
78+
cid: 5967
6579
```
6680
67-
Discharge Time Slot 1 Current
81+
Discharge Time Slot 1 Battery SOC
6882
6983
```yaml
7084
action: solis_cloud_control.read
7185
data:
72-
cid: 5967
86+
cid: 5965
7387
```
7488
75-
Discharge Time Slot 1 Battery SOC
89+
## High-level inverter control
90+
91+
Set Self-Use Mode - Battery Reserve On, Grid Charging Off:
7692
7793
```yaml
78-
action: solis_cloud_control.read
94+
action: solis_cloud_control.set_storage_mode
7995
data:
80-
cid: 5965
96+
storage_mode: Self Use
97+
battery_reserve: "ON"
98+
allow_grid_charging: "OFF"
99+
```
100+
101+
Set charge time slot:
102+
103+
```yaml
104+
action: solis_cloud_control.set_charge_time_slot
105+
data:
106+
time_slot: "11:00-13:00"
107+
current: "90"
108+
battery_soc: "80"
81109
```
82110
83-
## Control Storage Mode
111+
Set discharge time slot:
112+
113+
```yaml
114+
action: solis_cloud_control.set_discharge_time_slot
115+
data:
116+
time_slot: "11:00-13:00"
117+
current: "90"
118+
battery_soc: "80"
119+
```
120+
121+
Disable charge time slot:
122+
123+
```yaml
124+
action: solis_cloud_control.disable_charge_time_slot
125+
```
126+
127+
Disable discharge time slot:
128+
129+
```yaml
130+
action: solis_cloud_control.disable_discharge_time_slot
131+
```
132+
133+
## Low-level inverter control
134+
135+
### Control storage mode
84136
85-
Self-Use Mode - No Grid Charging, Backup Mode On
137+
Self-Use Mode - Battery Reserve On, Grid Charging Off:
86138
87139
```yaml
88140
action: solis_cloud_control.control
@@ -91,11 +143,69 @@ data:
91143
value: "17"
92144
```
93145
94-
Feed-In Priority Mode - No Grid Charging, Backup Mode On:
146+
Feed-In Priority Mode - Battery Reserve On, Grid Charging Off:
95147
96148
```yaml
97149
action: solis_cloud_control.control
98150
data:
99151
cid: 636
100152
value: "80"
101153
```
154+
155+
### Control charge time slot
156+
157+
Set Charge Time Slot 1:
158+
159+
```yaml
160+
action: solis_cloud_control.control
161+
data:
162+
cid: 5946
163+
value: "11:00-13:00"
164+
```
165+
166+
Set Charge Time Slot 1 Current:
167+
168+
```yaml
169+
action: solis_cloud_control.control
170+
data:
171+
cid: 5948
172+
value: "90"
173+
```
174+
175+
Set Charge Time Slot 1 Battery SOC:
176+
177+
```yaml
178+
action: solis_cloud_control.control
179+
data:
180+
cid: 5928
181+
value: "80"
182+
```
183+
184+
### Control discharge time slot
185+
186+
Set Discharge Time Slot 1:
187+
188+
```yaml
189+
action: solis_cloud_control.control
190+
data:
191+
cid: 5964
192+
value: "11:00-13:00"
193+
```
194+
195+
Set Discharge Time Slot 1 Current:
196+
197+
```yaml
198+
action: solis_cloud_control.control
199+
data:
200+
cid: 5967
201+
value: "90"
202+
```
203+
204+
Set Discharge Time Slot 1 Battery SOC:
205+
206+
```yaml
207+
action: solis_cloud_control.control
208+
data:
209+
cid: 5965
210+
value: "80"
211+
```

0 commit comments

Comments
 (0)