Repository navigation
Releases
v0.6.0
What's Changed
- README: install 0.5.0 by @athomasse in #4
- Car availability follows the car; gateway availability via the will by @athomasse in #5
- web: quote user input in log lines (CodeQL log injection) by @athomasse in #6
- ci: golangci-lint + gofmt, pcap build, release provenance by @athomasse in #7
Full Changelog: v0.5.0...v0.6.0
v0.5.0
What's Changed
- WiFi and connection status, restart, HA device name, web log tools by @athomasse in #1
- README: screenshots, what the fork adds, credits by @athomasse in #2
- README: short, about what it does, installing and configuring by @athomasse in #3
New Contributors
- @athomasse made their first contribution in #1
Full Changelog: v0.4.0...v0.5.0
v0.4.0
Fork of buxtronix/phev2mqtt. This release adds Debian packages for every architecture and an optional web interface.
Warning
Running against a real car is still untested (the bundled emulator no longer completes the handshake, also with v0.3.0 and upstream). The package, the web interface and MQTT were tested on Debian trixie and bookworm and on a Raspberry Pi B+.
Debian packages
One .deb per architecture: armhf (every 32-bit Raspberry Pi, including the B+ and Zero), arm64, amd64 and i386, plus plain binaries and a single SHA256SUMS.
- Runs as its own
phev2mqttsystem user under a hardened systemd unit; it only getsCAP_NET_ADMIN, enough forwifi_restart_command(ip link) without sudo. - Commented config file in
/etc/phev2mqtt/config.yaml(root:phev2mqtt, 0640) that upgrades leave alone. - Example WiFi files for the car in
/usr/share/doc/phev2mqtt/examples/.
version=0.4.0
deb=phev2mqtt_${version}_$(dpkg --print-architecture).deb
base=https://github.com/athomasse/phev2mqtt-nxt/releases/download/v$version
curl -fLO "$base/SHA256SUMS" -fLO "$base/$deb"
sha256sum -c --ignore-missing SHA256SUMS
sudo apt install "./$deb"
sudoedit /etc/phev2mqtt/config.yaml
sudo systemctl enable --now phev2mqttWeb interface (optional)
Off unless web_listen is set. Status of the car, buttons for climate, lights, charge timer and (re)connecting, MQTT settings, the car's WiFi (scan and connect through NetworkManager) and a live log. One embedded page without external resources.
web_listen: ":8080"
web_password: "something long" # required off localhost, unless
# web_auth: false # no login at all- MQTT settings saved in the web interface go to
/var/lib/phev2mqtt/settings.yaml(0600) and override the config file. - The package ships a polkit rule that lets only the
phev2mqttservice manage WiFi connections. - Requests from other websites are blocked; raw registers cannot be set from the web interface.
- Managed Edge with an
AuthSchemespolicy refuses basic auth and only shows "unauthorized"; use another browser orweb_auth: falseon a trusted network.
Other changes
- The gateway now starts without a reachable or configured MQTT broker and keeps retrying, instead of exiting.
- A broker that is down no longer stalls the car loop; Home Assistant discovery only goes to a connected broker.
- Shared state between the car loop, the MQTT callbacks and the web interface is now behind a lock.
phev2mqtt --version.- A config file given with
--configthat cannot be read is now an error instead of silently using the defaults (--config=/dev/nullstill works). wifi_restart_commandruns with a one-minute timeout.
Upgrading
If you changed /etc/phev2mqtt/config.yaml, dpkg asks whether to keep it when a release ships a newer version of the file. For unattended upgrades use -o Dpkg::Options::=--force-confold.
Full Changelog: v0.3.0...v0.4.0
v0.3.0
Fork of buxtronix/phev2mqtt. The binary is built for the Raspberry Pi B+/Zero (linux/armv6, static, no cgo).
Warning
Not yet tested against a car or a live MQTT broker. The connection and reconnect changes (buxtronix#62, buxtronix#63) in particular need a real-world test before you rely on this release.
Upstream pull requests merged
- buxtronix#62 Fix connection leaks and deadlocks that prevented reconnecting to the car (@Will-Honor)
- buxtronix#63 Re-establish MQTT subscriptions and discovery after a broker reconnect (@Will-Honor)
- buxtronix#64 Default climate commands to 30 minutes instead of 10, including the MY14 duration fix from buxtronix#61 (@Will-Honor)
- buxtronix#65 Fix go vet format-string errors (@Will-Honor)
- buxtronix#55 Publish autodiscovery with QoS 1 (@lazytesting)
- buxtronix#66 Testing details for the Eclipse Cross 2022 (@Grisu930)
- buxtronix#50 Documentation: config file format, interface naming, NetworkManager setup (@altserg)
Fixes
set/register/<xx>: an empty register crashed the daemon, a multi-byte one was silently truncated, and a topic prefix containing/(e.g.home/phev) made every register command fail.- Commands arriving before the first car connection (e.g. retained messages at startup) crashed on a nil client; they are now ignored.
set/climate/modewith an unknown payload turned the climate off, and the payloadmodesent the invalid mode0x4to the car. Both are now rejected.- The periodic update request no longer blocks the receive loop for up to 10 s.
- Home Assistant discovery pointed at topics that were never published: the climate state select now uses
~/climate/state, Disable Charge Timer uses~/charge/charging. - A panic in the MQTT handler no longer takes down the daemon.
- Wrong register (0xb instead of 0xa) in the headlights error log; typos in the README.
Behaviour changes
- Climate
onnow runs for 30 minutes (was 10). - Home Assistant: the climate state select and Disable Charge Timer switch show a state for the first time; discovery and availability are republished after a broker or Home Assistant restart.
set/register/requires exactly one hex byte in the topic.update_intervalmust be positive;0is refused at startup.- A climate command is logged and ignored while the car's model year is still unknown.
Build and security
- Go modules on their latest versions;
go vetclean; tests run with the race detector. - New: tests for the MQTT command handler (
cmd/mqtt_test.go). - CI: govulncheck (on every push and daily), CodeQL (weekly), dependency review on pull requests, weekly Dependabot updates.
Install
gh release download v0.3.0 -R athomasse/phev2mqtt-nxt -p 'phev2mqtt-linux-armv6*'
sha256sum -c phev2mqtt-linux-armv6.sha256Full Changelog: v0.2.0...v0.3.0
v0.2.0
v0.1.0
Full Changelog: https://github.com/athomasse/phev2mqtt-nxt/commits/v0.1.0