Registered StackHub users may elect to receive email notifications whenever a new package version is released or a comment is posted on the forum.
There are 11 watchers.
MQTT message constructor that is passed the point record, value and level
The JSON Str returned is an outer object containing an array with the property name metrics. The single object in the array has a name and a value property, and optionally a level property if provided
Example returned JSON Message:
{ "metrics": [ {"name":"pt1","value":73.0,"level":1} ] }
MQTT message parser that is passed the payload as a String and parses it as a comma separated set of values.
Default column separator is ,
and expected value positions are "curVal","curStatus"
To override this pass in a Dict as an optional second parameter. The Dict should contain the tags colSep and colNames. colSep is a single character Str and colNames is Str[]
If there are more values than column names supplied, default colnames of v1..vn are used. If curStatus is not one of the column names curStatus will be set to "ok"
This function abides by the contract for MQTT message parsers in taking a Str as its first parameter and returning a Dict with curVal and curStatus tags.
Configure it on the connector either just as the function name or follow it with a Dict containing colSep and colNames tags. e.g.
pahoMqttParseCsv {colSep:",", colNames:["curVal","curStatus"]}
MQTT message parser that is passed the payload as a String and parses it as a JSON object.
The JSON Object structure is fixed. It expects the outer object to contain an array of metric objects, with the property name metrics. Each metric object in the array must have a name and a value property.
Example JSON Message:
{ "metrics": [ {"name":"pt1","value":73.0}, {"name":"pt2","value":true}, {"name":"pt3","value":"string val"} ] }
results in this Dict:
{pt1:73.0, pt2:true, pt3:"string val"}
MQTT message parser that is passed the payload as a String and uses it as the point curVal. It assumes point curStatus is "ok". Units should not be in the message body.
If no MQTT parser is configured on an PahoMqtt Connector or point, this is the default parser used.
This function abides by the contract for MQTT message parsers in taking a Str as its first parameter and returning a Dict with curVal and curStatus tags.
Ping a PahoMqtt connector
Examples:
read(pahoMqttConn).pahoMqttPing pahoMqttPing(pahoMqttConnId)
Side effects:
Provide a function that publishes a message to a broker on a topic This is unrelated to Connector functionality The Dict parameter provided must contain the following url - (Str or Uri). Format is tcp://host:port or ssl://host:port topic - What topic to publish to msg - Supports String messages only
Optionally you can also provide: username password - Plain Text clientId - to override a default UUID generated client ID cleanSession - Bool true|false qos - Int 0|1|2 retained - Bool true|false
Subscribe all the proxy points to their MQTT topic on the MQTT Broker. Current value with asynchronously arrive on the next message received for the topic. If there is a retained message for the topic, current value will arrive almost immediately. The proxies may be any value supported by toRecList.
Each proxy point must contain:
Side effects: