Commit Graph

580 Commits

Author SHA1 Message Date
Thomas Basler
f2a08ba503 Rename FLD_PCT to FLD_PF and assign UNIT_NONE 2022-10-31 00:43:07 +01:00
Thomas Basler
f741fea333 Move serial number formatting to inverter class 2022-10-29 11:22:56 +02:00
Thomas Basler
f21dd351ef Optimize performance by removing not required string constructors 2022-10-29 11:22:56 +02:00
Thomas Basler
c999197dae Optimize performance by passing strings as const reference 2022-10-29 11:22:56 +02:00
Thomas Basler
3a0ba86c9c HASS Auto Discovery: Publish binary sensor reachable and producing 2022-10-29 11:22:56 +02:00
Thomas Basler
6403521e31 HASS Auto Discovery: Publish numbers to set limit 2022-10-29 11:22:56 +02:00
Thomas Basler
96170c08b8 HASS Auto Discovery: Publish buttons for on/off/restart 2022-10-29 11:22:56 +02:00
Thomas Basler
64e4656dbe Simplify creation of HASS device info 2022-10-29 11:22:56 +02:00
Thomas Basler
a7f571a581 HASS: Move create of device object so separate method 2022-10-29 11:22:56 +02:00
Thomas Basler
359d513cfd Generate DTU ID dynamicly based on ESP chipID 2022-10-20 22:25:51 +02:00
Thomas Basler
4193abe942 Fix typo 2022-10-20 22:07:06 +02:00
Thomas Basler
ca51aab236 Move getChipId to separate class 2022-10-20 21:55:41 +02:00
Thomas Basler
f32b561627 Show detected max power in dev info dialogue 2022-10-19 22:16:30 +02:00
Thomas Basler
678f165350 Fix warning: missing initializer for member 2022-10-19 22:16:29 +02:00
Thomas Basler
cc7df7c302 Removed senseless checks
uint can never by smaller than 0
2022-10-18 21:43:12 +02:00
Thomas Basler
d37543fd95 Show current limit in header of live view 2022-10-14 19:16:37 +02:00
Thomas Basler
cf727d4ff9 Added API to change the access point password 2022-10-13 19:44:16 +02:00
Thomas Basler
d2feac7a00 Migrate config from binary blob to json 2022-10-12 19:46:21 +02:00
Thomas Basler
e762abd18f Show RF chip type in SystemInfoView 2022-10-12 00:17:40 +02:00
Thomas Basler
0a577f8002 Allow a maximum limit of 100 if limit type is relative 2022-10-11 23:28:22 +02:00
Thomas Basler
072a7c7a3d Fix #213: Check if topic ends with slash
If this is not the case the subscription to the command topics will fail
2022-10-11 23:04:43 +02:00
Thomas Basler
7ec070f6f9 Fix #212: Only check ssid if in wifi mode 2022-10-11 23:04:43 +02:00
Thomas Basler
283eae295b Show absolute limit in limit dialogue 2022-10-10 19:20:19 +02:00
Thomas Basler
88ad6495d1 Implemented inverter restart via web ui 2022-10-09 13:48:35 +02:00
Thomas Basler
da0998c809 Implement inverter restart by mqtt topic 2022-10-09 13:16:06 +02:00
Thomas Basler
20b799b630 webapp: Show NRF24 connection status 2022-10-06 23:29:17 +02:00
Thomas Basler
c33c73fe01 webapi: Rename limit to limit_relative 2022-10-06 23:29:14 +02:00
Thomas Basler
9e907b0ca7 Publish limit_absolute for known models 2022-10-06 23:29:13 +02:00
Thomas Basler
9b68eb6beb webapp: Show model name 2022-10-06 18:35:04 +02:00
Thomas Basler
a893701b6d Fixed warning regarding switch statement 2022-10-05 18:53:35 +02:00
Thomas Basler
112664f42f Simplify inverterEdit method
Replaced for loop with unused variable by .size() method
2022-10-05 18:37:34 +02:00
Thomas Basler
9c4076d3d5 Fix handling of strncpy on inverter delete 2022-10-05 18:27:35 +02:00
Thomas Basler
7ff0f111af Rename firmware_version to config_version 2022-10-05 18:23:04 +02:00
Thomas Basler
2447d57301 Fixed printf format strings 2022-10-04 23:33:09 +02:00
Thomas Basler
2eafd69276 Show only valid device info data in webapp 2022-10-04 22:15:50 +02:00
Thomas Basler
3816320f1e Implemented WebAPI to get status of last power command 2022-10-04 18:48:21 +02:00
Thomas Basler
14bad84031 Added WebAPI to control inverter power 2022-10-04 18:12:55 +02:00
Thomas Basler
eec04de044 Added MQTT Topic to turn inverter on and off 2022-10-04 18:12:55 +02:00
Thomas Basler
66453b0854 Return correct formatted HwVersion 2022-10-03 13:58:50 +02:00
Thomas Basler
76bf5ec69b Fix cpplint: Replace strtok by strtok_r 2022-10-02 12:37:55 +02:00
Thomas Basler
747335f23f Publish hostname via mqtt 2022-10-01 12:32:31 +02:00
Thomas Basler
bd17ca5199 webapp: Add "Not Producing" indicator 2022-10-01 12:20:31 +02:00
Thomas Basler
00b1ff84be Rename age_critical to rechable in web api
Also use new method to determine whether the inverter is reachable
2022-10-01 10:48:17 +02:00
Thomas Basler
4fe2111173 Implemented MQTT topics reachable and producing per inverter 2022-10-01 10:47:19 +02:00
Thomas Basler
3d68f502c4 Rename MQTT topic settings/limit to status/limit_relative 2022-10-01 01:45:10 +02:00
Thomas Basler
dcaadf26a9 WebAPI: Add status of last set limit command 2022-10-01 00:42:29 +02:00
Thomas Basler
a5e68ef096 Fixed several issues in the web api to set the limit 2022-09-30 18:34:30 +02:00
Thomas Basler
0af809e4ea Do not appy settings if mqtt was retained and topic was non-persistent 2022-09-30 18:34:30 +02:00
Thomas Basler
ace5c33518 Set PowerLimit on mqtt request 2022-09-30 18:34:30 +02:00
Thomas Basler
eb261908af Perform topic parsing 2022-09-30 18:34:30 +02:00
Thomas Basler
ba2d6ab6d1 Implement callback to subscribe to topics 2022-09-30 18:34:30 +02:00
Thomas Basler
d57a5f7ea6 Added web api to set limit 2022-09-30 18:34:30 +02:00
Thomas Basler
290932519c Fix #160: Increase output buffer for inverter list 2022-09-24 10:28:05 +02:00
Thomas Basler
89e5f7e393 Added API to set and get the current time 2022-09-20 19:44:24 +02:00
Thomas Basler
950b211fd5 Set getLocalTime timeout to 0 to prevent watchdog triggers
This happens especially when no WiFi is configured and the user enters the NTP info page
2022-09-19 20:45:44 +02:00
Thomas Basler
e61d47b8a2 Added webapi endpoints to download/upload end delete configuration 2022-09-17 01:46:14 +02:00
Thomas Basler
22ac3faff1 Removed not required variables 2022-09-16 18:21:54 +02:00
Thomas Basler
271c71e064 Replace ESPAsyncWebServer
Use fork from yubox-node-org instead of originial from me-no-dev
Maybe that fixes several issues with the websockets
2022-09-15 19:26:45 +02:00
Thomas Basler
327b4f97a4 Use reinterpret_cast<char*>(...) instead C-style cast 2022-09-15 19:00:07 +02:00
Thomas Basler
4bfb986846 Use reinterpret_cast<uint8_t*>(...) instead C-style cast 2022-09-15 18:59:51 +02:00
Thomas Basler
de33b9ff88 Do not use namespace using-directives. Use using-declarations instead. 2022-09-13 21:35:51 +02:00
Thomas Basler
66c28a2e6e Replace strcpy by strlcpy 2022-09-13 21:20:08 +02:00
Thomas Basler
6fdc27ddae Replace sprintf by snprintf 2022-09-13 21:00:54 +02:00
Stefan Kreutter
cb00537284 fixed compile error
src/NetworkSettings.cpp: In member function 'void NetworkSettingsClass::setHostname()':
src/NetworkSettings.cpp:254:42: error: no matching function for call to 'ETHClass::setHostname(String)'
         if (ETH.setHostname(getHostname())) {
                                          ^
ETH.h:83:14: note: candidate: 'bool ETHClass::setHostname(const char*)'
         bool setHostname(const char * hostname);
2022-09-13 19:09:15 +02:00
Thomas Basler
9674e32c0c Return only the eventlog of one inverter
- Fix #131
- Prevent large responses in case of many inverters + many log entries
2022-09-12 18:48:18 +02:00
Thomas Basler
2f43acbde7 Publish current inverter limit settings via mqtt 2022-09-09 20:18:00 +02:00
Thomas Basler
46367c4fa9 Added webapi to fetch current inverter limit 2022-09-09 18:43:21 +02:00
Thomas Basler
99a34d0901 Publish WiFi RSSI via mqtt 2022-09-08 19:24:22 +02:00
Thomas Basler
86f01e5cc4 webapp: Show complete generated hostname in network info view 2022-09-06 18:45:32 +02:00
Thomas Basler
f5328100b6 Fixed hostname generation and hostname assignment 2022-09-06 18:44:26 +02:00
Thomas Basler
31e56f6c2b Code hardening: introduce const keyword 2022-09-05 21:41:45 +02:00
Thomas Basler
83ca402306 Merge branch 'pr114' 2022-09-05 20:10:08 +02:00
battifreund
b4137d4da9 Option for expire_after 2022-08-31 23:35:28 +02:00
Thomas Basler
dbf692d90b Fix #92: Expiration time depends on the amount of inverters 2022-08-27 13:07:00 +02:00
Martin Dummer
c7448d460a src/Configuration.cpp: fix homeassistant discovery config
On a fresh installed openDTU esp32, the mqtt discovery prefix
topic does not match the default value of homeassistant, due to a wrong
assignment in src/Configuration.cpp.
This patch fixes it.

Signed-off-by: Martin Dummer <martin.dummer@gmx.net>
2022-08-27 12:11:31 +02:00
Hacks
7f354fb7de corrected buffer usage 2022-08-27 11:43:47 +02:00
Thomas Basler
26268479fb Fix #96 and #95 : Reworked handling of inverter editing 2022-08-24 02:53:34 +02:00
Thomas Basler
1456974616 Fix #76: Null Pointer exception when adding a inverter with unkonwn serial number 2022-08-16 19:47:51 +02:00
Thomas Basler
304afb758a Added additional debug output during the initialization of the hoymiles interface 2022-08-14 13:49:05 +02:00
Thomas Basler
217fddf405 Added small dialog to show inverter info (firmware version etc.) 2022-08-11 16:42:50 +02:00
Thomas Basler
991838ae2c Added reactive power output and display 2022-08-10 20:40:26 +02:00
Thomas Basler
e040328d61 Added mqtt publish for hardware version and part number 2022-08-10 20:13:07 +02:00
Thomas Basler
f566a8c522 Implemented parser methods and publish to mqtt 2022-08-10 19:03:02 +02:00
Thomas Basler
35a72acf34 Fix #71: Extend mqtt hostname from 31 characters to 128 characters 2022-08-10 18:59:30 +02:00
Thomas Basler
80f7ba86d7 Fix #70: MQTT Messages where published even if no broker connection was established 2022-08-10 18:42:12 +02:00
helgeerbe
4435fbcdad Add support for MQTT TLS
To support TLS its necessary to use another MQTT library.
The new lib is a drop-in replacement for the async-mqtt-client.
2022-08-06 00:14:44 +02:00
Thomas Basler
3789183ca3 Fix #45: Dont allow spaces in MQTT topics 2022-08-03 21:23:22 +02:00
Thomas Basler
857e4a3671 Remove RequestType and place handling of response in the command class 2022-08-03 18:50:34 +02:00
Thomas Basler
3f8ee18de9 Added api endpoint to get livedata in json format with get request 2022-07-20 20:54:57 +02:00
Thomas Basler
184183e979 Move websocket stuff to liveview class 2022-07-20 19:36:07 +02:00
Thomas Basler
608912e9f3 Show network status (WiFi/Ethernet) in network info view 2022-07-20 19:21:31 +02:00
Thomas Basler
a17e668c8c Don't output unknown network events 2022-07-19 22:12:21 +02:00
Thomas Basler
c022b8696b Implemented serveal global network functions which are independent of the medium (wifi / ethernet) 2022-07-19 21:53:04 +02:00
Thomas Basler
69959db93c Output IP to serial console 2022-07-19 21:27:36 +02:00
Thomas Basler
c7aa22ce6c Renamed WifiSettings to NetworkSettings and implemented first ethernet initialization 2022-07-19 21:27:36 +02:00
Thomas Basler
526137da98 Publish HASS config when deleting, editing or adding a inverter 2022-07-18 23:34:32 +02:00
Thomas Basler
1124a9aaa1 Implemented first version of Home Assistant Auto Discovery 2022-07-18 22:28:03 +02:00
Thomas Basler
db0e0c67ce Simplify MqttPublishing
* Moved all fields to an array
* Moved target topic generation to separate method
2022-07-18 19:13:58 +02:00
Thomas Basler
bb52d24c25 Implemented public getPrefix method to get the mqtt topic prefix 2022-07-18 19:08:38 +02:00
Thomas Basler
37aac48a19 Change License to GPLv2 as the RF24 lib uses GPL-2.0-only 2022-07-15 18:05:58 +02:00
Thomas Basler
5bb9acdbc6 Refactored Hoymiles Lib: Move statistics parser into separate class 2022-07-12 18:27:56 +02:00
Thomas Basler
96e66dde47 Changed order of properties in live view 2022-07-11 20:35:14 +02:00
Thomas Basler
c2a7f487f1 Updated structure of eventlog json 2022-07-09 11:34:44 +02:00
Thomas Basler
4f4dcfda0b Moved some strings to flash 2022-07-08 18:57:03 +02:00
Thomas Basler
997c54edb4 Added field to live view which shows amount of eventlog events 2022-07-08 18:54:52 +02:00
Thomas Basler
f7eb54fa41 First version of webapi for event log 2022-07-08 18:22:35 +02:00
Thomas Basler
c28087ec86 Fix #21: Display DC power in Live Data overview 2022-07-07 19:05:50 +02:00
Thomas Basler
8b939f9418 Rename variables to match code style 2022-07-06 19:25:30 +02:00
Axel Hinrichs
401e6739cd [WebApi] rate limit ws cleanup (1/s) 2022-07-05 23:42:07 +02:00
Axel Hinrichs
48f540dad1 [WebApi_webapp] app.js caching via ETag 2022-07-04 16:50:34 +02:00
Thomas Basler
712be3fc15 Code cleanup 2022-07-01 23:38:51 +02:00
Thomas Basler
cf273c93e7 Fixed 404 error when pressing refresh in webapp 2022-07-01 23:32:11 +02:00
Thomas Basler
b454f0c01f Renamed topic again 2022-07-01 18:38:34 +02:00
Thomas Basler
d5f32d8325 Fixes (#8). Power values on CH0 are published twice
The larger value was DC the smaller one AC. Now the values are published to different topics
2022-07-01 18:36:43 +02:00
Thomas Basler
d17d7f7082 Enhance inverter edit
* Edit procedure was replaced by a modal window
* Allows setting of max power of the 4 strings
2022-06-24 23:08:04 +02:00
Thomas Basler
bce3fc78e8 Renamed field names which are used for mqtt and web ui 2022-06-24 18:03:44 +02:00
Thomas Basler
2de865037c Renamed functions
getValue --> getChannelFieldValue
hasValue --> hasChannelFieldValue
getUnit --> getChannelFieldUnit
getName --> getChannelFieldName
2022-06-24 17:53:37 +02:00
Thomas Basler
183b919ae6 Rename data folder to webapp_dist 2022-06-22 23:16:45 +02:00
Thomas Basler
eec4334fa5 Send inverter max channel power via web api 2022-06-22 21:44:55 +02:00
Thomas Basler
f42696d14c Fix change of inverter serial
Because of the inverter type depends on the serial number it's a must to remove and add the inverter of the serial was changed. setSerial doesn't make sense anymore. Move the serial to the constructor
2022-06-22 21:32:37 +02:00
Thomas Basler
746aa087ac Set MaxChannel Power on startup and in webapi 2022-06-22 21:12:45 +02:00
Thomas Basler
10974ade3e Adjust config
* Allow wifi  passwords length of 64 chars
* Added max channel power
2022-06-22 21:00:44 +02:00
Thomas Basler
3b9d117b4d Show current git hash in web gui 2022-06-20 20:56:50 +02:00
Thomas Basler
670c2d6762 Show detected inverter type in webapp 2022-06-18 01:51:18 +02:00
Thomas Basler
17cc2a475d Rename websocket from ws to livedata
Allows devServer to proxy websockets as well...
2022-06-18 01:14:31 +02:00
Thomas Basler
46d88c6520 Improoved websocket handling 2022-06-17 13:29:21 +02:00
Thomas Basler
1281893314 webapi: publish data age and critical status 2022-06-16 15:32:55 +02:00
Thomas Basler
7e0807bda6 Added cnfig parameter to set mqtt publish interval 2022-06-16 14:57:12 +02:00
Thomas Basler
af00158e14 First version of very simple websocket api 2022-06-16 01:44:42 +02:00
Thomas Basler
1ea2990fe9 Remove not supported field 2022-06-16 01:18:39 +02:00
Thomas Basler
77ffe1385c Fixed serial number source 2022-06-16 00:55:09 +02:00
Thomas Basler
fc80c8d8ff Remove not required include 2022-06-15 23:46:37 +02:00
Thomas Basler
92abfdfaa6 Separated WebApi into different files 2022-06-15 23:46:22 +02:00
Thomas Basler
cae47a142a Implemented periodic called loop method in webapi 2022-06-15 22:53:05 +02:00
Thomas Basler
bab5beb170 Move strings from RAM to Flash 2022-06-15 22:21:50 +02:00
Thomas Basler
226a57b328 Fix config default values on empty config file 2022-06-15 22:17:16 +02:00
Thomas Basler
c9e603b2de Replace EVERY_N_SECONDS with millis
EVERY_N_SECONDS is not updated without a reboot of the controller
2022-06-15 22:15:02 +02:00
Thomas Basler
b893257696 Format config partition if mount failed 2022-06-15 22:07:30 +02:00
Thomas Basler
e3ded34020 Publish inverter stats only if values are updated 2022-06-15 21:50:49 +02:00
Thomas Basler
0cc80126fa Added first implementation of mqtt publishing 2022-06-15 21:37:25 +02:00
Thomas Basler
98fa8be90e Publish messages with qos = 0 to speed up process 2022-06-15 21:11:08 +02:00
Thomas Basler
b597e907de Fixed issue in webapi that a inverter serial has to be read as hex 2022-05-31 19:26:26 +02:00
Thomas Basler
891b2b2917 Fix encoding header for favicon 2022-05-30 23:20:15 +02:00
Thomas Basler
90fe3df3fb Integrate Hoymiles library into main application 2022-05-30 21:57:21 +02:00
Thomas Basler
774ab91531 Fixed typo 2022-05-27 01:19:09 +02:00
Thomas Basler
e47e5c0197 Extend webapi to change dtu settings 2022-05-27 01:00:18 +02:00
Thomas Basler
e3ef1fa9a0 Added several DTU config settings 2022-05-26 23:17:45 +02:00
Thomas Basler
35d8a76763 Implemented firmware upgrade api 2022-05-23 23:26:19 +02:00
Thomas Basler
da82f1fbbd Fix total sketch size
See https://github.com/espressif/arduino-esp32/issues/3501
2022-05-22 23:18:30 +02:00
Thomas Basler
68c451aa82 Serve webapp from flash instead of LITTLEFS
This allows a web based firmware update by just replacing one bin file
2022-05-22 22:42:06 +02:00
Thomas Basler
ba0aa20211 Added config and webapi to manage inverters 2022-05-04 21:54:38 +02:00
Thomas Basler
2748e2e97d Show uptime in webgui 2022-04-28 21:56:11 +02:00
Thomas Basler
0338b8babc Added lwt stuff to webapi 2022-04-22 20:59:22 +02:00
Thomas Basler
0d48d72691 Replaced hard coded lwt values by dynymic ones 2022-04-21 23:43:44 +02:00
Thomas Basler
8e6a39b3a0 Added connection and retain status to webapi 2022-04-21 23:17:02 +02:00
Thomas Basler
8895fa95e0 First version of mqtt connection handling 2022-04-21 23:15:45 +02:00
Thomas Basler
f84158d419 Implemented saving of mqtt settings 2022-04-21 22:20:45 +02:00
Thomas Basler
a338b2d669 Basic implementation of mqtt webapi 2022-04-18 15:28:25 +02:00
Thomas Basler
50fa7e2abf First basic class structure for mqtt handling 2022-04-18 15:19:26 +02:00
Thomas Basler
5653d0f835 Upgraded to latest Beta build system
This one is using esp32-arduino 2.0.3
2022-04-18 03:38:07 +02:00
Thomas Basler
79b8477317 Added timezone description to webapi 2022-04-18 01:42:45 +02:00
Thomas Basler
000cd8b6dc Implemented additional timezone description 2022-04-18 01:33:46 +02:00
Thomas Basler
2ce5b5ad9e Added functionality to save ntp settings 2022-04-18 00:19:11 +02:00
Thomas Basler
1f692f241f Implemented first readonly version of ntp settings 2022-04-17 23:13:36 +02:00
Thomas Basler
821b9b16d1 Fixed [E][WiFiUdp.cpp:160] endPacket(): could not send data: 22 error 2022-04-17 22:07:08 +02:00
Thomas Basler
297f229c12 Implemented WebAPI to set wifi credentials 2022-04-17 21:40:47 +02:00
Thomas Basler
d88199cebe Added correct response 2022-04-17 04:03:05 +02:00
Thomas Basler
080471d801 Changed default ip to 192.168.4.1 2022-04-16 19:04:38 +02:00
Thomas Basler
06837320f7 WIP: Extended WebAPI to handle network config 2022-04-15 13:14:43 +02:00
Thomas Basler
4048e737e8 Added additional system information 2022-04-14 12:44:56 +02:00
Thomas Basler
dde6a5c5aa Fixed case of include for littlefs 2022-04-13 23:05:32 +02:00
Thomas Basler
868f0cf3a5 Added second API endpoint which returns system info 2022-04-13 00:01:23 +02:00
Thomas Basler
b58788ded5 Added API endpoint which shows network info 2022-04-12 23:53:58 +02:00
Thomas Basler
6deeec7b97 Use index.html instead of index.htm 2022-04-12 00:19:45 +02:00
Thomas Basler
82c3a914ab First version of WebApi 2022-04-11 19:44:51 +02:00
Thomas Basler
94719be928 Implemented handling of WiFi settings 2022-04-10 17:37:54 +02:00
Thomas Basler
8b7f2a14b6 Added configuration handling 2022-04-10 16:57:24 +02:00
Thomas Basler
893bd0c0d4 Initialize UART and FS 2022-04-09 13:08:51 +02:00
Thomas Basler
641f8813fa Apply default code formatting 2022-04-09 11:05:58 +02:00
Thomas Basler
54dc566473 Initial commit 2022-04-09 11:05:14 +02:00