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 does not read a dry contact directly: it needs a device that sends at least one byte on the serial line for each pulse.
%impulse, the text CH1 gives %impulse:CH1. This is how one serial line can carry several counters.t is measured from the first impulse received after the driver started (not from the start of the driver): that first impulse gives t = 0.missing license means the gateway has no licence for the Impulse driver.On the first impulse, the driver automatically creates the following addresses:
%impulse (or %impulse:<suffix>) — the main counter value (running total + offset, see 3.2). 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 the first impulse received after the driver started 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; the published value is the written value plus the offset. A new offset is only taken into account at the next impulse.
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 (running total + 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 the first impulse received after the driver started 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 driver keeps a running total: each impulse adds the current increment to it, and the published value is running total + offset.
1: set the increment, then align the counter.%impulse replaces the running total; the published value becomes written value + offset.count restarts at 0 each time the driver starts, so the counter is not equal to count × increment + offset.Recommended: leave offset at 0 and align the counter by writing the meter reading to %impulse (see 1.3).
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 |