53 lines
2.1 KiB
Plaintext
53 lines
2.1 KiB
Plaintext
# eg4-battery config — deploys to ~/.config/eg4-battery/eg4-battery.yaml (mode 600)
|
|
|
|
bus:
|
|
# ---- mode: pick one ----
|
|
# active ← RECOMMENDED. We are the master on a dedicated bus to the
|
|
# battery's pin-1/2 external monitor port. Speaks the EG4
|
|
# 7E/0D protocol at 9600 baud. Returns named, decoded HA
|
|
# entities (pack V, cell voltages, SoC, temps, alarms).
|
|
#
|
|
# passive ← Listen-only Modbus-RTU sniffer at 19200 baud. Use only when
|
|
# the FTDI is on a bus that already has a Modbus master
|
|
# (e.g. the LVX6048 parallel-comm bus — although see NOTES.md:
|
|
# the LVX6048 doesn't poll EG4 packs that way, so this mode
|
|
# is mostly diagnostic). Publishes raw `register_NN` per slave.
|
|
mode: active
|
|
|
|
transport: serial # serial | mock (--dry-run on the CLI forces mock)
|
|
|
|
# Stable /dev/serial/by-id symlink survives USB reshuffles. Find yours with
|
|
# ls -l /dev/serial/by-id/
|
|
port: /dev/serial/by-id/usb-FTDI_<YOUR_ADAPTER_ID>-if00-port0
|
|
|
|
# Default 9600 (active EG4 protocol). Set 19200 for passive Modbus mode.
|
|
baud: 9600
|
|
|
|
# Active mode only:
|
|
timeout_s: 1.5 # per-query response wait
|
|
poll_interval_s: 10.0 # round-robin cycle target
|
|
|
|
mqtt:
|
|
host: <MQTT_BROKER_IP> # e.g. 10.0.0.41 (HA Mosquitto broker)
|
|
port: 1883
|
|
username: <MQTT_USER>
|
|
password: <MQTT_PASSWORD>
|
|
discovery_prefix: homeassistant
|
|
# Re-publish every retained discovery config every N seconds so HA recovers
|
|
# automatically if it ever loses entity registrations (broker restart, missed
|
|
# initial publish, integration glitch). 0 disables. Default: 1800 (30 min).
|
|
# discovery_republish_interval_s: 1800
|
|
|
|
# One entry per pack. `name` is the HA entity prefix and device identifier.
|
|
# `address` is the EG4 7E protocol address in active mode (master = 1, slaves
|
|
# typically 2, 3, ...) or the Modbus slave ID in passive mode.
|
|
packs:
|
|
- name: lifepower4_1
|
|
address: 1
|
|
- name: lifepower4_2
|
|
address: 2
|
|
- name: lifepower4_3
|
|
address: 3
|
|
|
|
cell_count: 16 # 16S for 48V LFP — active mode only
|