The Impulse driver counts pulses received on a serial interface (RS485, RS232, USB) and converts them into a counter value. It is designed for energy meters and other metering devices that output impulses (pulses) proportional to consumption — for example, an electricity meter that sends one pulse per kWh.
Each time a pulse is received on the serial port, the driver increments a counter by a configurable increment value (default: 1). An offset can be added to align the counter with the real meter reading.
Create a new gateway and select the Impulse driver. Configure:
/dev/ttyUSB0).9600.When the gateway starts, it opens the serial port and waits for data. The driver considers any data received on the serial port as an impulse. The received data string is used as a suffix to differentiate multiple counters from the same serial source.
On the first impulse, the driver automatically creates the following addresses:
%impulse (or %impulse:<suffix>) — the main counter value (increment × pulse count + offset). This value can be manually overwritten to set the current meter reading.%impulse/count — total number of impulses counted since the driver started. Resets to 0 on restart.%impulse/t — milliseconds elapsed from driver start to the last impulse.%impulse/dt — milliseconds elapsed between the two last impulses (useful for calculating instantaneous flow/power).%impulse/increment — the value added to the counter on each impulse. Default: 1. Persisted across restarts.%impulse/offset — an offset added to the final counter value. Default: 0. Persisted across restarts.Note: Addresses are created automatically on the first impulse — manual address insertion is not available.
To align the counter with the actual meter reading:
%impulse).The driver will continue counting from this new value. Alternatively, adjust the offset address to shift the counter value without resetting the count.
If the meter outputs one impulse per 0.01 kWh (for example), set the increment address to 0.01. Each pulse will then add 0.01 to the counter, giving you a direct kWh reading.
| Label | JSON Key | Description |
|---|---|---|
| Name | name | A descriptive name for this Impulse gateway instance. |
| Cluster ID | cluster | Cluster identifier (integer). Use 0 for single-gateway setups. |
| Description | description | Optional description for this gateway. |
| Serial Port | serialPort | The serial interface connected to the impulse source. Auto-complete lists detected USB/serial interfaces. Can be set by unique ID (recommended) or system path. |
| Baudrate | baudrate | Serial communication speed: Auto, 9600 (default), 19200, 38400, 57600, 76800, or 115200. |
{
"serialPort": "/dev/serial/by-id/usb-FTDI_FT232R-if00",
"baudrate": 9600
}
All addresses are created automatically when the first impulse is received.
| Address | Description | Persisted | Writable |
|---|---|---|---|
%impulse |
Main counter value (increment × count + offset). Can be overwritten to set the current meter reading. | Yes | Yes |
%impulse/count |
Number of impulses counted since driver startup. Resets to 0 on each restart. | No | No |
%impulse/t |
Milliseconds from driver start to the last impulse. Resets on restart. | No | No |
%impulse/dt |
Milliseconds between the two last impulses. Useful for instantaneous rate calculation. | No | No |
%impulse/increment |
Value added to the counter per impulse. Default: 1. |
Yes | Yes |
%impulse/offset |
Offset added to the final counter value. Default: 0. |
Yes | Yes |
If the serial data contains a text suffix, it is appended to the address name (e.g. %impulse:CH1, %impulse:CH1/count, etc.), allowing multiple independent counters on the same serial port.
The main counter value is calculated as:
counter = (number of impulses × increment) + offset
For example, with increment = 0.01 and offset = 15000:
The dt address (time between two impulses) can be used in a route with a logic module to calculate the instantaneous consumption rate. For example, for an electricity meter with 1 impulse = 0.001 kWh:
Power (kW) = (increment / dt) × 3600000
Where dt is in milliseconds and 3600000 converts ms to hours.
| Property | Value |
|---|---|
| Readable | No |
| Writable | Yes (main counter, increment, offset only) |
| Routable | Yes |
| Loggable | Yes |