# Home Data Collection Tools

A mono repository containing all the homebrew collectors and REST APIs running on the local server. See it in action [here](https://valkendaal.duckdns.org).

## Project Directory

|- `.vscode` => A folder with Visual Studio Code IDE specific files, for developing this project </br>
|- `include` => A folder housing all the header files used by the source files in `src/` </br>
|- `script` => A folder with handy bash scripts to create and migrate databases </br>
|- `src` => A folder with all the source files of the different projects that require compilation </br>
|- `systemd` => A folder with example systemd service files for the servers </br>

## Dependencies

### Runtime (server)

- .NET 6, [website](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
- Curl: the multiprotocol file tranfser library, [website](https://curl.haxx.se/libcurl/)
- GNU Make, [website](https://www.gnu.org/software/make/)
- Libfmt, [website](https://github.com/fmtlib/fmt)
- Spdlog, [website](https://github.com/gabime/spdlog)
- Sqlite3: a small SQL database engine, v3.39.2, [website](https://www.sqlite.org/index.html)

### Development

In addition to all the runtime dependencies the following dependencies are required for development:

- A C++20 compatible compiler
- Nlohmann JSON, [website](https://github.com/nlohmann/json/tree/v3.11.2)
- cxxopts, [website](https://github.com/jarro2783/cxxopts/tree/v3.0.0)

## Examples

### Solar Logging

```bash
solar-logger --connection-string "/mnt/data0/log/solarpaneloutput.db" -u "http://192.168.2.26/home.cgi" --type Zeverlution
solar-logger --connection-string "/mnt/data0/log/solarpaneloutput.db" -u "http://192.168.2.84/production.json" --type Envoy
```

### Electricity Logging

```bash
electricity-logger -d /dev/ttyUSB0 --connection-string /home/pi/logs/electricity.logs
```
