summaryrefslogtreecommitdiff
path: root/python-solaredge-local.spec
blob: 58afca715b47456686c769be72af673a5d56668a (plain)
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
%global _empty_manifest_terminate_build 0
Name:		python-solaredge-local
Version:	0.2.3
Release:	1
Summary:	API wrapper to communicate locally with SolarEdge Inverters
License:	MIT License
URL:		https://github.com/drobtravels/solaredge-local
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/51/96/c24bc40ba8848ba2bc3c9894edcf46579dd6a36d39b73ab378d44eac7790/solaredge_local-0.2.3.tar.gz
BuildArch:	noarch


%description
# SolarEdge Local

**Warning**

Recent firmware versions disable local access.  Some units may continue to work, but many users are reporting it is no longer available.  See [this issue](https://github.com/jbuehl/solaredge/issues/124) and [this issue](https://github.com/drobtravels/solaredge-local/issues/24) for additional details.  Please check if you can access your inverter via a web browser before attempting to use this library.


The goal if this respository is to provide information about using the local API available on some solar edge inverters.  This is a WIP based on my observations and may contain inaccuracies.  Pull Requests or Issues are encouraged to correct any mistakes or add additonal informatoin.

### Relevant Models

The fastest way to check your inverter will support this library and to enter the IP address of your inverter in the browser and see if the administration page is displayed.

The local API is available for specific firmware versions running on [SExxxxH-US models with SetApp](https://www.solaredge.com/sites/default/files/se-hd-wave-single-phase-inverter-with-setapp-datasheet-na.pdf) as well as European three phase inverters SEXXK-XXXTXBXX4 models with SetApp like [SE3K-E10K](https://www.solaredge.com/sites/default/files/se-three-phase-inverter-setapp-ds.pdf), [SE12.5K-SE27.6K](https://www.solaredge.com/sites/default/files/se-three-phase-inverter-setapp-datasheet.pdf) and [SE33.3K](https://www.solaredge.com/sites/default/files/se-three-phase-inverter-for-277-480-grid-setapp-datasheet.pdf). Same goes for Australian inverters [SE2500H->SE10000H](https://www.solaredge.com/sites/default/files/se-single-phase-HD-wave-inverter-setapp-datasheet-aus.pdf). 
Please check carefully the datasheets if in the section "Additional Features", sub-section "Inverter Commissioning" is present the following line "With the SetApp mobile application using built-in Wi-Fi access point for local connection".  You should 

More inforation on SetApp could be found [here](https://www.solaredge.com/us/products/installer-tools/setapp). These models have no LED screen and are provisioned ONLY via a phone app during commissioning.
Check also the [SetApp FAQ](https://www.solaredge.com/sites/default/files/solaredge-setapp-faqs-eng.pdf) for more info.
For convenience it is reported here one Q&A:

> Q: Can the new app be used for already installed inverters?
>
> A: Only SolarEdge inverters with a new communication board (no display) can be activated or configured via SetApp.

These new inverters have a [CPU number](https://www.solaredge.com/setapp-inverters-firmware) starting with 04.

You can check by finding the IP address of your inverter and visiting it in a browser.  If it supports the local API, you'll see the SolarEdge logo and a "Commissioning" menu.

If you do not have the local API available, see [this repository](https://github.com/jbuehl/solaredge) as an alternative.

### Using the Python wrapper

For convinience, a python API wrapper, [solaredge_local](https://pypi.org/project/solaredge-local/) is available.  **Only python 3 is supported**

To install: `pip3 install solaredge-local`

To use:

```
from solaredge_local import SolarEdge
client = SolarEdge("http://<inverter ip address>")
client.get_status()  # Provides general energy and other overview information
client.get_maintenance() # Provides optimizer level information and other details
client.get_information() # Provides software versions and error log list.
client.get_power_control() # Provides power control information and other details.
```

### API Endpoints

* AppConfigs: "web/v1/app_configs"
* Region: "web/v1/region"
* Region_Country: "web/v1/region/country"
* Region_Language: "web/v1/region/language"
* Pairing: "web/v1/pairing"
* Pairing_Request: "web/v1/pairing/request"
* Communication: "web/v1/communication"
* Communication_Server: "web/v1/communication/server"
* Communication_Lan: "web/v1/communication/lan"
* Communication_Rs485_SlaveDetect: "web/v1/communication/rs485/<id>/slave_detect"
* Communication_Rs485_Protocol: "web/v1/communication/rs485/<id>/protocol"
* Communication_Rs485_DeviceId: "web/v1/communication/rs485/<id>/deviceid"
* Communication_Rs485_Modbus: "web/v1/communication/rs485/<id>/modbus"
* Communication_Rs485_Modbus_AddDevice: "web/v1/communication/rs485/<id>/modbus/add_device"
* Communication_Rs485_Modbus_RemoveDevice: "web/v1/communication/rs485/<id>/modbus/remove_device"
* Communication_Wifi: "web/v1/communication/wifi"
* Communication_Wifi_Wps: "web/v1/communication/wifi/wps"
* Communication_Wifi_Connect: "web/v1/communication/wifi/connect"
* Communication_Cellular: "web/v1/communication/cellular"
* Communication_Zigbee_Defaults: "web/v1/communication/zigbee/defaults"
* Communication_Zigbee_ModuleConfigs: "web/v1/communication/zigbee/module_configs"
* Communication_Zigbee_OpMode: "web/v1/communication/zigbee/op_mode"
* Communication_Gpio_Pri: "web/v1/communication/gpio/pri"
* Communication_ModbusTcp: "web/v1/communication/modbus_tcp"
* PowerControl: "web/v1/power_control"
* PowerControl_GridControl: "web/v1/power_control/grid_control"
* PowerControl_EnergyManager_LimitControl: "web/v1/power_control/energy_manager/limit_control"
* PowerControl_EnergyManager_EnergyControl: "web/v1/power_control/energy_manager/energy_control"
* PowerControl_EnergyManager_StorageControl: "web/v1/power_control/energy_manager/storage_control"
* PowerControl_ReactivePower: "web/v1/power_control/reactive_power"
* PowerControl_ActivePower: "web/v1/power_control/active_power"
* PowerControl_Wakeup: "web/v1/power_control/wakeup"
* PowerControl_Advanced: "web/v1/power_control/advanced"
* PowerControl_Reset: "web/v1/power_control/reset"
* PowerControl_Rrcr: "web/v1/power_control/rrcr"
* Maintenance: "web/v1/maintenance"
* Maintenance_DateTime: "web/v1/maintenance/date_and_time"
* Maintenance_ResetCounters: "web/v1/maintenance/reset_counters"
* Maintenance_ResetFactory: "web/v1/maintenance/reset_factory"
* Maintenance_Afci: "web/v1/maintenance/afci"
* Maintenance_AfciTest: "web/v1/maintenance/afci/test"
* Maintenance_Inverters_SelfTest: "web/v1/maintenance/inverters/<position>/self_test"
* Maintenance_Standby: "web/v1/maintenance/standby"
* Maintenance_GridProtectionLogin: "web/v1/maintenance/grid_protection/login"
* Maintenance_GridProtection: "web/v1/maintenance/grid_protection"
* Maintenance_UpgradeUsb: "web/v1/maintenance/fw_upgrade/usb"
* Information: "web/v1/information"
* Status: "web/v1/status"
* Status_ServerCommTest: "web/v1/status/server_comm_test"

The Status endpoint appears to the most useful for realtime production data.
Optimizer level data is available from the Maintenance API endpoint.


## Using the API

All endpoints I have explored so far appear to be a GET, and responses use [Protocol Buffers](https://developers.google.com/protocol-buffers/).  There is no authentication.

### View Raw Response

You can see the raw data by doing the following (assuming you have the protoocal buffers CLI tool installed)

```
curl -s http://<inverter ip>/web/v1/status | protoc --decode_raw
```

Many numbers appear to be 32 bit floating point.

The proto definitions required to fully parse the responses are available in  javascript if you choose "view source" in the developer tools of your browser.

### View Parsed response

If there is a corresponding `.proto` file in [message_types](/message_types), you can view the parsed response from the API.  Each proto file correspond to the name of an API endpoint. These are very much a WIP and may be incomplete.  These can be created by choosing "view source" in the developer tools of your browser, and searching for text like `proto.web_status.<apiNameInCamelCase>.toObject`

Here is an example for the status API:

```
curl -s http://<inverter ip>/web/v1/status | protoc --decode Status message_types/status.proto
```

### Updating Protocol Buffer response

To add or change the Protocol Buffer defintions, please do the following

1. Manually change the `message_types/*.proto` files as required
2. Test the file using `curl` as described in [View Parsed Response](#view-parsed-response)
3. Update the generated `*_pb2.py` files for each file changed by running a command like:

    ```
    protoc -I=message_types --python_out=solaredge_local message_types/<filename_changed>.proto
    ```
4. Commit the generated updates




%package -n python3-solaredge-local
Summary:	API wrapper to communicate locally with SolarEdge Inverters
Provides:	python-solaredge-local
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-solaredge-local
# SolarEdge Local

**Warning**

Recent firmware versions disable local access.  Some units may continue to work, but many users are reporting it is no longer available.  See [this issue](https://github.com/jbuehl/solaredge/issues/124) and [this issue](https://github.com/drobtravels/solaredge-local/issues/24) for additional details.  Please check if you can access your inverter via a web browser before attempting to use this library.


The goal if this respository is to provide information about using the local API available on some solar edge inverters.  This is a WIP based on my observations and may contain inaccuracies.  Pull Requests or Issues are encouraged to correct any mistakes or add additonal informatoin.

### Relevant Models

The fastest way to check your inverter will support this library and to enter the IP address of your inverter in the browser and see if the administration page is displayed.

The local API is available for specific firmware versions running on [SExxxxH-US models with SetApp](https://www.solaredge.com/sites/default/files/se-hd-wave-single-phase-inverter-with-setapp-datasheet-na.pdf) as well as European three phase inverters SEXXK-XXXTXBXX4 models with SetApp like [SE3K-E10K](https://www.solaredge.com/sites/default/files/se-three-phase-inverter-setapp-ds.pdf), [SE12.5K-SE27.6K](https://www.solaredge.com/sites/default/files/se-three-phase-inverter-setapp-datasheet.pdf) and [SE33.3K](https://www.solaredge.com/sites/default/files/se-three-phase-inverter-for-277-480-grid-setapp-datasheet.pdf). Same goes for Australian inverters [SE2500H->SE10000H](https://www.solaredge.com/sites/default/files/se-single-phase-HD-wave-inverter-setapp-datasheet-aus.pdf). 
Please check carefully the datasheets if in the section "Additional Features", sub-section "Inverter Commissioning" is present the following line "With the SetApp mobile application using built-in Wi-Fi access point for local connection".  You should 

More inforation on SetApp could be found [here](https://www.solaredge.com/us/products/installer-tools/setapp). These models have no LED screen and are provisioned ONLY via a phone app during commissioning.
Check also the [SetApp FAQ](https://www.solaredge.com/sites/default/files/solaredge-setapp-faqs-eng.pdf) for more info.
For convenience it is reported here one Q&A:

> Q: Can the new app be used for already installed inverters?
>
> A: Only SolarEdge inverters with a new communication board (no display) can be activated or configured via SetApp.

These new inverters have a [CPU number](https://www.solaredge.com/setapp-inverters-firmware) starting with 04.

You can check by finding the IP address of your inverter and visiting it in a browser.  If it supports the local API, you'll see the SolarEdge logo and a "Commissioning" menu.

If you do not have the local API available, see [this repository](https://github.com/jbuehl/solaredge) as an alternative.

### Using the Python wrapper

For convinience, a python API wrapper, [solaredge_local](https://pypi.org/project/solaredge-local/) is available.  **Only python 3 is supported**

To install: `pip3 install solaredge-local`

To use:

```
from solaredge_local import SolarEdge
client = SolarEdge("http://<inverter ip address>")
client.get_status()  # Provides general energy and other overview information
client.get_maintenance() # Provides optimizer level information and other details
client.get_information() # Provides software versions and error log list.
client.get_power_control() # Provides power control information and other details.
```

### API Endpoints

* AppConfigs: "web/v1/app_configs"
* Region: "web/v1/region"
* Region_Country: "web/v1/region/country"
* Region_Language: "web/v1/region/language"
* Pairing: "web/v1/pairing"
* Pairing_Request: "web/v1/pairing/request"
* Communication: "web/v1/communication"
* Communication_Server: "web/v1/communication/server"
* Communication_Lan: "web/v1/communication/lan"
* Communication_Rs485_SlaveDetect: "web/v1/communication/rs485/<id>/slave_detect"
* Communication_Rs485_Protocol: "web/v1/communication/rs485/<id>/protocol"
* Communication_Rs485_DeviceId: "web/v1/communication/rs485/<id>/deviceid"
* Communication_Rs485_Modbus: "web/v1/communication/rs485/<id>/modbus"
* Communication_Rs485_Modbus_AddDevice: "web/v1/communication/rs485/<id>/modbus/add_device"
* Communication_Rs485_Modbus_RemoveDevice: "web/v1/communication/rs485/<id>/modbus/remove_device"
* Communication_Wifi: "web/v1/communication/wifi"
* Communication_Wifi_Wps: "web/v1/communication/wifi/wps"
* Communication_Wifi_Connect: "web/v1/communication/wifi/connect"
* Communication_Cellular: "web/v1/communication/cellular"
* Communication_Zigbee_Defaults: "web/v1/communication/zigbee/defaults"
* Communication_Zigbee_ModuleConfigs: "web/v1/communication/zigbee/module_configs"
* Communication_Zigbee_OpMode: "web/v1/communication/zigbee/op_mode"
* Communication_Gpio_Pri: "web/v1/communication/gpio/pri"
* Communication_ModbusTcp: "web/v1/communication/modbus_tcp"
* PowerControl: "web/v1/power_control"
* PowerControl_GridControl: "web/v1/power_control/grid_control"
* PowerControl_EnergyManager_LimitControl: "web/v1/power_control/energy_manager/limit_control"
* PowerControl_EnergyManager_EnergyControl: "web/v1/power_control/energy_manager/energy_control"
* PowerControl_EnergyManager_StorageControl: "web/v1/power_control/energy_manager/storage_control"
* PowerControl_ReactivePower: "web/v1/power_control/reactive_power"
* PowerControl_ActivePower: "web/v1/power_control/active_power"
* PowerControl_Wakeup: "web/v1/power_control/wakeup"
* PowerControl_Advanced: "web/v1/power_control/advanced"
* PowerControl_Reset: "web/v1/power_control/reset"
* PowerControl_Rrcr: "web/v1/power_control/rrcr"
* Maintenance: "web/v1/maintenance"
* Maintenance_DateTime: "web/v1/maintenance/date_and_time"
* Maintenance_ResetCounters: "web/v1/maintenance/reset_counters"
* Maintenance_ResetFactory: "web/v1/maintenance/reset_factory"
* Maintenance_Afci: "web/v1/maintenance/afci"
* Maintenance_AfciTest: "web/v1/maintenance/afci/test"
* Maintenance_Inverters_SelfTest: "web/v1/maintenance/inverters/<position>/self_test"
* Maintenance_Standby: "web/v1/maintenance/standby"
* Maintenance_GridProtectionLogin: "web/v1/maintenance/grid_protection/login"
* Maintenance_GridProtection: "web/v1/maintenance/grid_protection"
* Maintenance_UpgradeUsb: "web/v1/maintenance/fw_upgrade/usb"
* Information: "web/v1/information"
* Status: "web/v1/status"
* Status_ServerCommTest: "web/v1/status/server_comm_test"

The Status endpoint appears to the most useful for realtime production data.
Optimizer level data is available from the Maintenance API endpoint.


## Using the API

All endpoints I have explored so far appear to be a GET, and responses use [Protocol Buffers](https://developers.google.com/protocol-buffers/).  There is no authentication.

### View Raw Response

You can see the raw data by doing the following (assuming you have the protoocal buffers CLI tool installed)

```
curl -s http://<inverter ip>/web/v1/status | protoc --decode_raw
```

Many numbers appear to be 32 bit floating point.

The proto definitions required to fully parse the responses are available in  javascript if you choose "view source" in the developer tools of your browser.

### View Parsed response

If there is a corresponding `.proto` file in [message_types](/message_types), you can view the parsed response from the API.  Each proto file correspond to the name of an API endpoint. These are very much a WIP and may be incomplete.  These can be created by choosing "view source" in the developer tools of your browser, and searching for text like `proto.web_status.<apiNameInCamelCase>.toObject`

Here is an example for the status API:

```
curl -s http://<inverter ip>/web/v1/status | protoc --decode Status message_types/status.proto
```

### Updating Protocol Buffer response

To add or change the Protocol Buffer defintions, please do the following

1. Manually change the `message_types/*.proto` files as required
2. Test the file using `curl` as described in [View Parsed Response](#view-parsed-response)
3. Update the generated `*_pb2.py` files for each file changed by running a command like:

    ```
    protoc -I=message_types --python_out=solaredge_local message_types/<filename_changed>.proto
    ```
4. Commit the generated updates




%package help
Summary:	Development documents and examples for solaredge-local
Provides:	python3-solaredge-local-doc
%description help
# SolarEdge Local

**Warning**

Recent firmware versions disable local access.  Some units may continue to work, but many users are reporting it is no longer available.  See [this issue](https://github.com/jbuehl/solaredge/issues/124) and [this issue](https://github.com/drobtravels/solaredge-local/issues/24) for additional details.  Please check if you can access your inverter via a web browser before attempting to use this library.


The goal if this respository is to provide information about using the local API available on some solar edge inverters.  This is a WIP based on my observations and may contain inaccuracies.  Pull Requests or Issues are encouraged to correct any mistakes or add additonal informatoin.

### Relevant Models

The fastest way to check your inverter will support this library and to enter the IP address of your inverter in the browser and see if the administration page is displayed.

The local API is available for specific firmware versions running on [SExxxxH-US models with SetApp](https://www.solaredge.com/sites/default/files/se-hd-wave-single-phase-inverter-with-setapp-datasheet-na.pdf) as well as European three phase inverters SEXXK-XXXTXBXX4 models with SetApp like [SE3K-E10K](https://www.solaredge.com/sites/default/files/se-three-phase-inverter-setapp-ds.pdf), [SE12.5K-SE27.6K](https://www.solaredge.com/sites/default/files/se-three-phase-inverter-setapp-datasheet.pdf) and [SE33.3K](https://www.solaredge.com/sites/default/files/se-three-phase-inverter-for-277-480-grid-setapp-datasheet.pdf). Same goes for Australian inverters [SE2500H->SE10000H](https://www.solaredge.com/sites/default/files/se-single-phase-HD-wave-inverter-setapp-datasheet-aus.pdf). 
Please check carefully the datasheets if in the section "Additional Features", sub-section "Inverter Commissioning" is present the following line "With the SetApp mobile application using built-in Wi-Fi access point for local connection".  You should 

More inforation on SetApp could be found [here](https://www.solaredge.com/us/products/installer-tools/setapp). These models have no LED screen and are provisioned ONLY via a phone app during commissioning.
Check also the [SetApp FAQ](https://www.solaredge.com/sites/default/files/solaredge-setapp-faqs-eng.pdf) for more info.
For convenience it is reported here one Q&A:

> Q: Can the new app be used for already installed inverters?
>
> A: Only SolarEdge inverters with a new communication board (no display) can be activated or configured via SetApp.

These new inverters have a [CPU number](https://www.solaredge.com/setapp-inverters-firmware) starting with 04.

You can check by finding the IP address of your inverter and visiting it in a browser.  If it supports the local API, you'll see the SolarEdge logo and a "Commissioning" menu.

If you do not have the local API available, see [this repository](https://github.com/jbuehl/solaredge) as an alternative.

### Using the Python wrapper

For convinience, a python API wrapper, [solaredge_local](https://pypi.org/project/solaredge-local/) is available.  **Only python 3 is supported**

To install: `pip3 install solaredge-local`

To use:

```
from solaredge_local import SolarEdge
client = SolarEdge("http://<inverter ip address>")
client.get_status()  # Provides general energy and other overview information
client.get_maintenance() # Provides optimizer level information and other details
client.get_information() # Provides software versions and error log list.
client.get_power_control() # Provides power control information and other details.
```

### API Endpoints

* AppConfigs: "web/v1/app_configs"
* Region: "web/v1/region"
* Region_Country: "web/v1/region/country"
* Region_Language: "web/v1/region/language"
* Pairing: "web/v1/pairing"
* Pairing_Request: "web/v1/pairing/request"
* Communication: "web/v1/communication"
* Communication_Server: "web/v1/communication/server"
* Communication_Lan: "web/v1/communication/lan"
* Communication_Rs485_SlaveDetect: "web/v1/communication/rs485/<id>/slave_detect"
* Communication_Rs485_Protocol: "web/v1/communication/rs485/<id>/protocol"
* Communication_Rs485_DeviceId: "web/v1/communication/rs485/<id>/deviceid"
* Communication_Rs485_Modbus: "web/v1/communication/rs485/<id>/modbus"
* Communication_Rs485_Modbus_AddDevice: "web/v1/communication/rs485/<id>/modbus/add_device"
* Communication_Rs485_Modbus_RemoveDevice: "web/v1/communication/rs485/<id>/modbus/remove_device"
* Communication_Wifi: "web/v1/communication/wifi"
* Communication_Wifi_Wps: "web/v1/communication/wifi/wps"
* Communication_Wifi_Connect: "web/v1/communication/wifi/connect"
* Communication_Cellular: "web/v1/communication/cellular"
* Communication_Zigbee_Defaults: "web/v1/communication/zigbee/defaults"
* Communication_Zigbee_ModuleConfigs: "web/v1/communication/zigbee/module_configs"
* Communication_Zigbee_OpMode: "web/v1/communication/zigbee/op_mode"
* Communication_Gpio_Pri: "web/v1/communication/gpio/pri"
* Communication_ModbusTcp: "web/v1/communication/modbus_tcp"
* PowerControl: "web/v1/power_control"
* PowerControl_GridControl: "web/v1/power_control/grid_control"
* PowerControl_EnergyManager_LimitControl: "web/v1/power_control/energy_manager/limit_control"
* PowerControl_EnergyManager_EnergyControl: "web/v1/power_control/energy_manager/energy_control"
* PowerControl_EnergyManager_StorageControl: "web/v1/power_control/energy_manager/storage_control"
* PowerControl_ReactivePower: "web/v1/power_control/reactive_power"
* PowerControl_ActivePower: "web/v1/power_control/active_power"
* PowerControl_Wakeup: "web/v1/power_control/wakeup"
* PowerControl_Advanced: "web/v1/power_control/advanced"
* PowerControl_Reset: "web/v1/power_control/reset"
* PowerControl_Rrcr: "web/v1/power_control/rrcr"
* Maintenance: "web/v1/maintenance"
* Maintenance_DateTime: "web/v1/maintenance/date_and_time"
* Maintenance_ResetCounters: "web/v1/maintenance/reset_counters"
* Maintenance_ResetFactory: "web/v1/maintenance/reset_factory"
* Maintenance_Afci: "web/v1/maintenance/afci"
* Maintenance_AfciTest: "web/v1/maintenance/afci/test"
* Maintenance_Inverters_SelfTest: "web/v1/maintenance/inverters/<position>/self_test"
* Maintenance_Standby: "web/v1/maintenance/standby"
* Maintenance_GridProtectionLogin: "web/v1/maintenance/grid_protection/login"
* Maintenance_GridProtection: "web/v1/maintenance/grid_protection"
* Maintenance_UpgradeUsb: "web/v1/maintenance/fw_upgrade/usb"
* Information: "web/v1/information"
* Status: "web/v1/status"
* Status_ServerCommTest: "web/v1/status/server_comm_test"

The Status endpoint appears to the most useful for realtime production data.
Optimizer level data is available from the Maintenance API endpoint.


## Using the API

All endpoints I have explored so far appear to be a GET, and responses use [Protocol Buffers](https://developers.google.com/protocol-buffers/).  There is no authentication.

### View Raw Response

You can see the raw data by doing the following (assuming you have the protoocal buffers CLI tool installed)

```
curl -s http://<inverter ip>/web/v1/status | protoc --decode_raw
```

Many numbers appear to be 32 bit floating point.

The proto definitions required to fully parse the responses are available in  javascript if you choose "view source" in the developer tools of your browser.

### View Parsed response

If there is a corresponding `.proto` file in [message_types](/message_types), you can view the parsed response from the API.  Each proto file correspond to the name of an API endpoint. These are very much a WIP and may be incomplete.  These can be created by choosing "view source" in the developer tools of your browser, and searching for text like `proto.web_status.<apiNameInCamelCase>.toObject`

Here is an example for the status API:

```
curl -s http://<inverter ip>/web/v1/status | protoc --decode Status message_types/status.proto
```

### Updating Protocol Buffer response

To add or change the Protocol Buffer defintions, please do the following

1. Manually change the `message_types/*.proto` files as required
2. Test the file using `curl` as described in [View Parsed Response](#view-parsed-response)
3. Update the generated `*_pb2.py` files for each file changed by running a command like:

    ```
    protoc -I=message_types --python_out=solaredge_local message_types/<filename_changed>.proto
    ```
4. Commit the generated updates




%prep
%autosetup -n solaredge-local-0.2.3

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-solaredge-local -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 0.2.3-1
- Package Spec generated