diff --git a/docs/Berry.md b/docs/Berry.md index fc17d64853..b0ec4b6226 100644 --- a/docs/Berry.md +++ b/docs/Berry.md @@ -582,6 +582,7 @@ Tasmota Function|Parameters and details mqtt.publish|`(topic:string, payload:string[, retain:bool, start:int, len:int]) -> nil`
Equivalent of `publish` command, publishes a MQTT message on `topic` with `payload`. Optional `retain` parameter.
`payload` can be a string or a bytes() binary array
`start` and `len` allow to specify a sub-part of the string or bytes buffer, useful when sending only a portion of a larger buffer. mqtt.subscribe|`mqtt.subscribe(topic:string [, function:closure]) -> nil`
Subscribes to a `topic` (exact match or pattern). Contrary to Tasmota's `Subscribe` command, the topic is sent as-is and not appended with `/#`. You need to add wildcards yourself. Driver method `mqtt_data` is called for each matching payload.
If a function/closure is added, the function is called whenever and only if an incoming messages matches the pattern for this function. The function should return `true` if message was processed, `false` if not which will let the message flow to Tasmota eventually as a command. mqtt.unsubscribe|`(topic:string) -> nil`
Unubscribe to a `topic` (exact match). +mqtt.connected|`mqtt.connected() -> bool`
Returns `true` if Tasmota is connected to the MQTT broker ### `light` object