-
Notifications
You must be signed in to change notification settings - Fork 24
Configuration
The configuration file is YAML; by default lxp-bridge expects to find it at config.yaml
in the current directory but you can change this with the -c
switch on startup.
There is no support for configuration re-loading; if you change it, restart lxp-bridge.
loglevel: info # can be trace / debug / info / warn / error / off
Added in v0.11. This sets the log filtering of lxp-bridge, which is written to stdout.
By default this is debug
, which will be used if the key is missing from the configuration.
Before v0.11, you could set the RUST_LOG
environment variable instead - this still works and will override whatever is set here.
inverters:
- enabled: true
host: 192.168.0.10
port: 8000
serial: 5555555555
datalog: 2222222222
heartbeats: false
publish_holdings_on_connect: false
read_timeout: 900
This is an array of inverters to connect to. It's an array as some people have multiple inverters (you can configure them in parallel). It's fine to have only one entry here, as shown above.
-
enabled: boolean; defaults to
true
if not present
Whether to connect to the inverter. If this isfalse
then lxp-bridge will ignore the entry and not attempt connection to this inverter. -
host: IP or host
IP of your inverter on your LAN. -
port: integer
Port of your inverter on your LAN. -
serial: string
Your inverter's serial number. See below. -
datalog: string
Your datalogger's serial number. See below. -
heartbeats: boolean; defaults to
false
if not present (added in v0.9)
Whether to respond to heartbeats sent by the inverter. See the section in Inverter Basics. -
publish_holdings_on_connect: boolean; defaults to
false
if not present (added in v0.10)
Whether to request and publish holding values to MQTT when lxp-bridge starts. This is useful for HA to be notified of the current values of registers to avoid it displaying "unknown". It is recommended to turn this on (it is only off by default to maintain backwards compatibility). It will be changed to default totrue
at some point in the future. -
read_timeout: integer; defaults to
900
if not present (added in v0.14)
Reconnect to the inverter after this many seconds of not receiving any packets. This can be used to detect broken connections that haven't fully disconnected properly. If this is zero, lxp-bridge will never disconnect on inactivity. It's not advisable to set this to lower than 300 or lxp-bridge will reconnect unnecessarily.
For now, the easiest way to find these is to log into Luxpower's "Monitor Center" and look under Configuration -> Devices. The two numbers you want are under the Serial number
(this is our serial
) and Dongle
(this is our datalog
) headers.
I plan to work on removing this step as I think it should be possible to autodetect the serials (the inverter broadcasts them out with every packet). The mobile apps seem to manage just fine without knowing the serials in advance, for instance.
It's worth noting that lxp-bridge only actually needs these configuring if you want to control the inverter; ie changing parameters, turning AC Charge on/off etc. If you only want to monitor the inverter then the values here don't matter (lxp-bridge may emit warnings to tell you they're wrong, but this is inconsequential). Just put in any 10 characters if you only want to monitor the power data.
databases:
- enabled: false
url: postgres://user:pass@localhost/lxp
- enabled: true
url: mysql://user:pass@localhost/lxp
- enabled: false
url: sqlite://lxp.db
This is an array of databases to log power data to. Postgres, MySQL, and SQLite are supported, as shown above.
-
enabled: boolean; defaults to
true
if not present
Whether to log to this database. If this isfalse
then lxp-bridge will ignore the entry and not use this database configuration. -
url: string
The database URI; see examples above for how to format these.
In the examples above, the username is user
, the password is pass
, the database host is localhost
, and the database name is lxp
; except for SQLite which only needs a database filename, which here is lxp.db
.
lxp-bridge will not create the database for you; you need to do that and grant the user full write permissions to it. Once the database is created and lxp-bridge is started, it will create the necessary tables (currently just an inputs
table). You can see the queries that will be run to create the tables inside https://github.com/celsworth/lxp-bridge/tree/master/db/migrations
As newer tables/columns are added, newer versions of lxp-bridge will keep the schema up to date automatically when restarted, via new files being added with new queries in these migration directories.
See also Database Setup.
mqtt:
enabled: true
host: localhost
port: 1883
username:
password:
namespace: lxp
publish_individual_input: false
homeassistant:
enabled: true
prefix: homeassistant
Configuration of your MQTT broker. This is not an array; only one MQTT broker is supported. [it could be a future improvement to support multiple; open an issue if you'd find this helpful]
-
enabled: boolean; defaults to
true
if not present
Whether to connect to the MQTT broker. If this isfalse
then lxp-bridge will not connect to MQTT. -
host: IP or host
IP of MQTT broker on your LAN. If using the Home Assistant "Mosquitto broker" add-on use the hostcore-mosquitto
-
port: integer; defaults to 1883 if not present
Port of MQTT broker on your LAN. -
username: string; optional
Username to connect to MQTT broker with, if required. -
password: string; optional
Password to connect to MQTT broker with, if required. -
namespace: string; defaults to
lxp
if not present
The first element of the MQTT topic; this can be used to isolate multiple lxp-bridge instances, but generally can be left alone aslxp
. -
publish_individual_input: (added in v0.10) boolean; defaults to false if not present
Determines whether to publish individual input registers seen from the inverter -
homeassistant: an optional hash of the following: (see also here for more details)
-
enabled: bool; defaults to
true
if not present
Whether to send HomeAssistant auto-discovery MQTT messages on startup. -
prefix: string; defaults to
homeassistant
if not present
The MQTT topic to start auto-discovery messages with.
-
enabled: bool; defaults to
See MQTT for details on how lxp-bridge uses MQTT.
influx:
enabled: true
url: http://localhost:8086
username:
password:
database: lxp
Configuration of your Influx database. This is not an array; only one database is supported. [it could be a future improvement to support multiple; open an issue if you'd find this helpful]
-
enabled: boolean; defaults to
true
if not present
Whether to store power data in InfluxDB. If this isfalse
then lxp-bridge will not use InfluxDB. -
url: string
The URL to your InfluxDB server; as shown in the example this should include a port. -
username: string; optional
Username to connect to InfluxDB with, if required. -
password: string; optional
Password to connect to InfluxDB with, if required. -
database: string
The database to store power data in; lxp-bridge will create aninputs
measurement in this database.
WIP, but probably don't use this, its not very reliable and may be removed.
The scheduler was envisaged as a way to run tasks on a regular basis, but so far the only scheduled implementation is time synchronization, which sets the inverter time to the same as on the machine lxp-bridge is running.
scheduler:
enabled: false
timesync:
enabled: false
cron: "0 0 * * *"
v0.13 has a simplification to this configuration in #209. The old configuration will not work anymore and will be ignored.
scheduler:
enabled: false
timesync_cron: "0 0 * * *"
-
enabled: boolean; defaults to
true
if not present
Whether to start the scheduler at all. If false, no scheduling will happen. -
timesync_cron: string
A cron specification for when to schedule the timesync.
If this line is not present, no timesyncs will be run. However timesyncs are the only thing that the scheduler currently does, so you could also setenabled: false
for the entire scheduler.