summaryrefslogtreecommitdiff
path: root/README.md
blob: 1e73e60ec7518ef8651adb1a3c9e07c52681f85d (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
# Camper Widget

A Plasma 6 applet that displays real-time information about your camper van's energy system. It consists of a pure QML widget and a Rust background service that reads Victron MQTT data and publishes it over D-Bus.

## Features

- **Battery monitoring**: State of charge, power draw, charge/discharge/idle state
- **Solar tracking**: Solar panel power generation
- **AC monitoring**: AC input and AC load power
- **Compact view**: Direction icon, battery icon, battery percentage, and system power
- **Full view**: Detailed breakdown of all energy subsystems
- **Real-time updates**: D-Bus property signals push changes to the widget instantly
- **Rust backend**: Async service with tokio, zbus 5, and rumqttc

## Requirements

- Plasma 6.3+ (for `org.kde.plasma.workspace.dbus` QML module)
- Rust toolchain
- [just](https://just.systems/man/en/introduction.html) command runner
- D-Bus session bus
- Victron energy system accessible via MQTT

## Installation

### Build from source

1. Clone the repository:

   ```bash
   git clone https://codeberg.org/knightdave/camper-widget.git
   cd camper-widget
   ```

2. Build the service:

   ```bash
   just build
   ```

3. Install the widget and service:

   ```bash
   just install
   ```

4. Restart Plasma or log out and back in

### Configuration

Configure the MQTT connection (hosts, credentials, refresh interval) through the widget's settings page in Plasma. The service reads this configuration from the Plasma applet INI file and automatically picks up changes when you save.

## Development

Run `just` to see all available commands.

```bash
just check       # Format check + clippy + cargo check
just test        # Run Rust tests
just verify      # check + build
just ci          # Full CI pipeline (check + test)
just ci-quick    # Quick check (no build/test)
just run         # Run widget in plasmoidviewer
just run-service # Run service locally
```

## Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

## Credits

This project was initially inspired by [bcdt-rust_plasmoid_example](https://codeberg.org/black-cat-engineering/bcdt-rust_plasmoid_example)