Commit Graph

380 Commits

Author SHA1 Message Date
Thomas Basler
7c33688167 Use same line ending in printf as in println
This prevents mistakes in the webconsole
2023-01-04 18:48:33 +01:00
helgeerbe
e49bbe0faf Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-12-27 14:17:24 +01:00
Thomas Basler
5bc264f4d2 Introduce numeric error codes in power webapi 2022-12-24 00:01:55 +01:00
Thomas Basler
03ed626da6 Introduce numeric error codes in security webapi 2022-12-24 00:01:55 +01:00
Thomas Basler
6ad7e971b4 Introduce numeric error codes in ntp webapi 2022-12-24 00:01:55 +01:00
Thomas Basler
3e8c7a4c10 Introduce numeric error codes in network webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
8e9680f394 Introduce numeric error codes in mqtt webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
af93e5d77e Introduce numeric error codes in maintenance webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
9fd044f74f Introduce numeric error codes in limit webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
4dc50777ef Introduce numeric error codes in inverter webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
98b0a23ea0 Introduce numeric error codes in config webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
3b5ff1691e Introduce numeric error codes in dtu webapi 2022-12-24 00:01:54 +01:00
Thomas Basler
8f5d394f3a Added websocket for debug output 2022-12-19 21:38:39 +01:00
Thomas Basler
8b60c29667 Replace all Serial by MessageOutput 2022-12-19 21:38:39 +01:00
Thomas Basler
cd5d5edd5f Implemented class to send debug output to uart as well as to websocket 2022-12-19 21:38:39 +01:00
Thomas Basler
5feefed14e Added missing copyright information 2022-12-14 22:37:37 +01:00
Thomas Basler
54d94af487 Cleanup includes 2022-12-14 22:13:03 +01:00
Thomas Basler
36477eab49 Fixed prometheus mac address when running in ethernet mode 2022-12-14 21:12:56 +01:00
Thomas Basler
674ead1c38 Fixed Hass device IP when running in ethernet mode 2022-12-14 21:11:53 +01:00
Thomas Basler
91f79fea19 Move publishHass method to MqttHandleHassClass 2022-12-14 21:08:35 +01:00
Thomas Basler
113caf510f Introduce generic mqtt publish method
Allows publish of mqtt topics from other modules
2022-12-14 20:58:57 +01:00
Thomas Basler
5dd4d5b452 Introduce MqttSubscribeParser and moved inverter specific subscribes to MqttHandleInverterClass
This allows individual callback functions for each subscribed topic. Allows easier implementation of further mqtt functions
2022-12-14 20:42:23 +01:00
Thomas Basler
aab72fd0d8 Move mqtt dtu topic publishing to separate class 2022-12-14 19:32:24 +01:00
Thomas Basler
723a2c6dbe Rename MqttPublishing to MqttHandleInverter 2022-12-14 19:13:34 +01:00
Thomas Basler
5dde17c56b Renamed MqttHassPublishing to MqttHandleHass 2022-12-14 19:07:11 +01:00
helgeerbe
df5cde2e82 Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-12-05 11:46:31 +01:00
Thomas Basler
e8c517f650 Fix timezone specific issue when syncing time manually
Time was off by one hour when using the sync button in the web UI.
tm_isdst = -1 means that mktime determines the DST flag based on the current timezone
2022-11-29 22:55:14 +01:00
Thomas Basler
40203f7316 Fix #387: Allow a little bit more loss before HASS shows unavailable 2022-11-28 18:34:39 +01:00
Thomas Basler
36abaeee12 Moved pin assignment outside the hoymiles library
Allows setting the pins during runtime and not  just using the defines
2022-11-27 12:07:25 +01:00
helgeerbe
ae414c42c1 merge with remote master 2022-11-26 16:31:41 +01:00
helgeerbe
2109520bde Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-11-26 16:31:16 +01:00
Thomas Basler
2a19b46d52 Add authentication to websocket 2022-11-23 21:00:54 +01:00
Thomas Basler
510f0c59f9 Implement readonly security for API endpoints 2022-11-22 23:40:19 +01:00
Thomas Basler
4bdbcbccc5 Introduce configuration option to decide wether the web ui is accessable without password or not 2022-11-22 23:32:52 +01:00
helgeerbe
1fc0e76c41 Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-11-22 17:10:53 +01:00
Thomas Basler
e60619b867 Added device reboot functionality 2022-11-21 23:29:57 +01:00
Thomas Basler
f8b601f871 Show several hints and tips at Live View
This contains the following information:
* No connection to the NRF module possible
* No time set
* Default password used
2022-11-20 15:08:36 +01:00
helgeerbe
2c6dff3714 Password protection for vedirect settings API 2022-11-19 14:34:59 +01:00
helgeerbe
f35395e76f Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-11-16 16:39:01 +01:00
Thomas Basler
fec84fd048 Show custom string name in Live View 2022-11-15 22:31:04 +01:00
Thomas Basler
134db887c0 Publish string names via MQTT 2022-11-15 22:31:04 +01:00
Thomas Basler
d28fadbdac Extended configuration to allow string names
* Current config will be migrated to new format
* Already extended web API to get/post new format
2022-11-15 22:31:04 +01:00
Thomas Basler
daf847e7b3 BREAKING CHANGE: Removed deprecated config parsing method
After this commit its not possible to migrate from the old binary blob config to the new json based config!! If you still running a old version before 12. October please upgrade to a version before this commit.
See https://github.com/tbnobody/OpenDTU/discussions/285
2022-11-15 22:31:04 +01:00
Thomas Basler
5f55414c0a Show Irradiation only in Live Data View if configured for specific channel 2022-11-15 22:31:04 +01:00
Thomas Basler
dd7babb448 Added a timeout of 5ms to detect current time.
This prevents false positives when a interrupt occours during the reading of the time
2022-11-14 20:19:38 +01:00
Thomas Basler
c2f59427b8 Prometheus API: Increase buffer size to allow more inverters 2022-11-10 20:20:55 +01:00
Thomas Basler
d7bcce947e Prometheus API: Adjust api url and method names 2022-11-10 20:20:54 +01:00
Thomas Basler
d62c5b239f Prometheus API: use integrated serialString() method to fetch serial number 2022-11-10 20:20:53 +01:00
Thomas Basler
8e4e055930 Prometheus API: Remove duplicate cache control 2022-11-10 20:20:52 +01:00
Thomas Basler
0fdf7f19e4 Prometheus API: Applied code formatting 2022-11-10 20:20:45 +01:00
Dominik Westner
e5bbb7f517 implemented prometheus metrics 2022-11-10 18:00:13 +01:00
Thomas Basler
e0b069ff3d Password protection for limit/power settings API 2022-11-08 18:34:00 +01:00
Thomas Basler
ab0029d9fd Show the correct amount of string input fields in inverter config 2022-11-07 22:38:53 +01:00
Thomas Basler
f163e239d2 Fix #303: Add inverter name as prefix to HASS auto discovery 2022-11-07 19:35:29 +01:00
Thomas Basler
233efe3a50 Password protection for firmware update API 2022-11-07 19:02:07 +01:00
Thomas Basler
fe8b68d2be Password protection for config settings API 2022-11-07 18:48:02 +01:00
Thomas Basler
a646eae51a Password protection for inverter settings API 2022-11-03 21:44:01 +01:00
Thomas Basler
902e632f51 Password protection for mqtt settings API 2022-11-03 21:31:50 +01:00
Thomas Basler
3a2f73a2b3 Password protection for ntp settings API 2022-11-03 21:20:12 +01:00
Thomas Basler
e605e42c3e Password protection for network settings API 2022-11-03 21:13:42 +01:00
Thomas Basler
b9d2978bf9 Password protection for dtu settings 2022-11-03 21:05:51 +01:00
Thomas Basler
8d14dbd367 Password protection for security settings API
Also implemented the base functionallity to protect further API endpoints.
2022-11-03 21:00:13 +01:00
helgeerbe
b3295f5f33 Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-11-03 09:27:56 +01:00
Thomas Basler
438ce36bab Added sum values of all inverters to web UI 2022-11-01 16:33:20 +01:00
Thomas Basler
69b675bc64 BREAKING CHANGE: Structure WebAPI /api/livedata/status changed
The different inverter data are now in a subobject called "inverters".
This is required to extend the API by other data then the inverter values
2022-11-01 15:04:05 +01:00
Thomas Basler
f854cdff03 Init last_update with 0 instead of current time 2022-11-01 13:23:29 +01:00
Thomas Basler
b96f0c4dbe Introduce last_update MQTT topic
Shows the timestamp of the last successfull statistics data from the specific inverter
2022-10-31 14:38:10 +01:00
helgeerbe
6b4129c400 Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-10-31 14:37:44 +01:00
Thomas Basler
4049f6bdb7 Implemented method to get the amount of relevant digits 2022-10-31 11:51:08 +01:00
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
helgeerbe
a6d734018a Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-10-26 14:20:44 +02:00
helgeerbe
a9336968c7 Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-10-20 23:39:05 +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
helgeerbe
3617e9a260 add vedirect to config import / export 2022-10-20 16:59:23 +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
helgeerbe
5de35ee353 Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-10-17 10:10:34 +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
helgeerbe
3febc28c78 Merge remote-tracking branch
'tbnobody/OpenDTU/master'
2022-10-10 11:08:36 +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
helgeerbe
366e7dc409 Merge remote-tracking branch
'tbnobody/OpenDTU/master'
2022-10-07 10:32:51 +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
helgeerbe
25285b10ee fix cpplint errors 2022-10-04 12:00:29 +02:00
helgeerbe
ba3183e10b Clear map for recieved key, value pairs 2022-10-04 11:34:30 +02:00
Thomas Basler
66453b0854 Return correct formatted HwVersion 2022-10-03 13:58:50 +02:00
helgeerbe
df7c821bd4 Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-10-03 13:34:05 +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
helgeerbe
4b02426ab2 Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-09-26 09:38:14 +02:00
Thomas Basler
290932519c Fix #160: Increase output buffer for inverter list 2022-09-24 10:28:05 +02:00
helgeerbe
3843a46de9 Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-09-22 09:36:36 +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
helgeerbe
e6b2be6fdf Change WebSocketMessageBuffer to String 2022-09-19 10:58:56 +02:00
helgeerbe
bee600bfd8 Merge remote-tracking branch 'tbnobody/OpenDTU/master' 2022-09-19 10:49:41 +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