# OpenDTU-Database-Database # OpenDTU-Database One year OpenDTU-Database ![Image](docs/screenshots/Screenshot_2024-05-23_131208.png) [![OpenDTU Build](https://github.com/tbnobody/OpenDTU/actions/workflows/build.yml/badge.svg)](https://github.com/tbnobody/OpenDTU/actions/workflows/build.yml) [![cpplint](https://github.com/tbnobody/OpenDTU/actions/workflows/cpplint.yml/badge.svg)](https://github.com/tbnobody/OpenDTU/actions/workflows/cpplint.yml) [![Yarn Linting](https://github.com/tbnobody/OpenDTU/actions/workflows/yarnlint.yml/badge.svg)](https://github.com/tbnobody/OpenDTU/actions/workflows/yarnlint.yml) OpenDTU-Database adds an ESP32 LittleFS Database and two energy charts, a column chart of the last 25 hours and a full calendar chart. ![Screenshot](https://github.com/RaBa64/OpenDTU/blob/Database/docs/screenshots/23_Database.png) OpenDTU-Database adds an ESP32 LittleFS Database and two energy charts, a column chart of the last 25 hours and a full calendar chart. There are 3 new APIs available, returning JSON strings: | API | returned values | |-------------------|-----------------| | /api/database | returns all recored data points from the database with total energy value | | /api/databaseHour | returns the energy per hour for the last 25 hours | | /api/databaseDay | returns the energy for each day | Each data point has the following format: [ _year (00-99)_, _month (1-12)_, _day (1-31)_, _hour (0-23)_, _energy (Wh)_ ] Example: [23,6,30,15,132.995605] The 192KB LittleFS in OpenDTU can store around 6 years of data, because each data point needs only 8 bytes of memory. ![Screenshot](docs/screenshots/23_Database.png) ## Background This project was started from [this](https://www.mikrocontroller.net/topic/525778) discussion (Mikrocontroller.net). It was the goal to replace the original Hoymiles DTU (Telemetry Gateway) with their cloud access. With a lot of reverse engineering the Hoymiles protocol was decrypted and analyzed. ## Documentation The documentation can be found [here](https://tbnobody.github.io/OpenDTU-docs/). Please feel free to support and create a PR in [this](https://github.com/tbnobody/OpenDTU-docs) repository to make the documentation even better. ## Breaking changes Generated using: `git log --date=short --pretty=format:"* %h%x09%ad%x09%s" | grep BREAKING` ```code * 1b637f08 2024-01-30 BREAKING CHANGE: Web API Endpoint /api/livedata/status and /api/prometheus/metrics * e1564780 2024-01-30 BREAKING CHANGE: Web API Endpoint /api/livedata/status and /api/prometheus/metrics * f0b5542c 2024-01-30 BREAKING CHANGE: Web API Endpoint /api/livedata/status and /api/prometheus/metrics * c27ecc36 2024-01-29 BREAKING CHANGE: Web API Endpoint /api/livedata/status * 71d1b3b 2023-11-07 BREAKING CHANGE: Home Assistant Auto Discovery to new naming scheme * 04f62e0 2023-04-20 BREAKING CHANGE: Web API Endpoint /api/eventlog/status no nested serial object * 59f43a8 2023-04-17 BREAKING CHANGE: Web API Endpoint /api/devinfo/status requires GET parameter inv= * 318136d 2023-03-15 BREAKING CHANGE: Updated partition table: Make sure you have a configuration backup and completly reflash the device! * 3b7aef6 2023-02-13 BREAKING CHANGE: Web API! * d4c838a 2023-02-06 BREAKING CHANGE: Prometheus API! * daf847e 2022-11-14 BREAKING CHANGE: Removed deprecated config parsing method * 69b675b 2022-11-01 BREAKING CHANGE: Structure WebAPI /api/livedata/status changed * 27ed4e3 2022-10-31 BREAKING: Change power factor from percent value to value between 0 and 1 ``` ## Currently supported Inverters A list of all currently supported inverters can be found [here](https://www.opendtu.solar/hardware/inverter_overview/)