Skip to content

Home > resol-vbus-core-toolbox-scripts > mqttPublisher > MqttPublisher

mqttPublisher.MqttPublisher class

Publishes VBus values using MQTT.

Signature:

typescript
export declare class MqttPublisher

Constructors

Constructor

Modifiers

Description

(constructor)(options)

Create a new MQTT publisher.

Properties

Property

Modifiers

Type

Description

client

mqtt.MqttClient | undefined

The MQTT client connection.

headerset

HeaderSet<Packet> | undefined

The shared set of packets.

interval

number

The interval in milliseconds in which VBus values should be published.

mqttClientOptions

mqtt.IClientOptions | undefined

The options to pass to the mqtt.connectAsync() function.

packetFieldIds

string[] | null

Optional list of VBus packet field IDs to consider publishing.

packetFieldValueMap

Map<string, bigint | null>

The map of VBus packet field IDs to their last known value.

specification

Specification | undefined

The VBus specification to use.

startGate

utils.StartGate

The StartGate for error handling.

timestampInterval

TimestampInterval | undefined

The TimestampInterval instance.

url

string

The URL of the MQTT broker.

valueChangesOnly

boolean

Whether only changes VBus values should be published.

valueTopicPattern

string

The MQTT topic pattern, using %P as a placeholder for the VBus packet field ID.

Methods

Method

Modifiers

Description

onInterval(timestamp)

Handle a tick from the TimestampInterval to publish VBus values to MQTT.

start(specification, headerset)

Start the MQTT publisher.