Home Pump Monitor
A Java application that reads data from a heat pump via Modbus TCP and sends metrics to InfluxDB.
Features
- Reads Modbus holding registers from a heat pump
- Caches readings for 60 seconds to reduce load
- Sends temperature and pump status data to InfluxDB every minute
- Configurable via JSON file
Configuration
Edit src/main/resources/registryMapping.json to configure:
- Modbus TCP connection (address, port)
- InfluxDB connection (address, username, password)
- List of registers to read with descriptions
Additional mapping fields (optional):
-
useMock(Boolean, top-level): Whentrue, the application runs with a localMockRepositoryinstead of attempting to connect to a Modbus device. Useful for local development when a device is not available (default: false). -
unitId(Integer): Modbus slave/unit id for the register (default: 1) -
scale(Double): Multiply raw device value by this to obtain display value (default: 0.1) -
dataType(String): Data type used for the locator (e.g.TWO_BYTE_INT_SIGNED). Supported values:TWO_BYTE_INT_SIGNED,TWO_BYTE_INT_UNSIGNED,FOUR_BYTE_INT_SIGNED,FOUR_BYTE_INT_UNSIGNED,FOUR_BYTE_FLOAT(the latter reads two adjacent registers and interprets as IEEE754 float). For devices with non-standard word order, the following swapped variants are supported:FOUR_BYTE_INT_SWAPPED,FOUR_BYTE_INT_UNSIGNED_SWAPPED,FOUR_BYTE_FLOAT_SWAPPED(word order low/high). -
signedLegacyWrap(Boolean): When true, apply legacy negative wrap decoding for values near -32768 (default: true)
Build and Run
mvn clean package
java -jar target/home-pump-1.0.0.jar
Requirements
- Java 21
- Modbus TCP accessible heat pump
- InfluxDB instance