# Communication # Voice Control Blocks for communication with the [Voice Control](https://www.fischertechnik.de/de-de/service/downloads/apps "Voice Control") app. #### on command received: text Executed when a new text has been received from [Voice Control](https://www.fischertechnik.de/de-de/service/downloads/apps "Voice Control") app. #### text Text is the recognised voice command. # Cloud / MQTT ### fischertechnik Cloud Blocks for communication with the fischertechnik Cloud. These blocks are used for "Sensorstation IoT" and "Training Factory Industry 4.0". ### MQTT Client MQTT stands for "Message Queuing Telemetry Transport" protocol and is often used in IoT (Internet of Things) applications. #### MQTT client create: websockets [![Bild6.png](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/scaled-1680-/bild6.png)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/bild6.png) Creates an MQTT client with which messages can be received and sent. It is recommended to write the output of the block into a variable in order to be able to use the client several times later in other blocks. #### MQTT client ... connect [![Bild7.png](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/scaled-1680-/bild7.png)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/bild7.png) Connects an MQTT client to an MQTT broker with the specified settings. Client can be the block "MQTT client create" or its output in a variable. Host specifies the address of the MQTT broker. To use the local MQTT broker, localhost or 127.0.0.1 is entered as the value. To use external MQTT brokers, their IP address or host name must be used. Port specifies the port on which the MQTT Broker is available. The default is 1883 for MQTT Broker (fischertechnik Cloud) or 2883 (GUI application). If external MQTT brokers are used, their port must be entered. Username and password are empty by default; for external servers, their login information must be entered here. #### MQTT client ... is connected [![Bild8.png](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/scaled-1680-/bild8.png)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/bild8.png) MQTT client can be the block "MQTT client create" or its output in a variable. Returns "true" if the specified MQTT client is connected to an MQTT broker. If the MQTT client is not connected, "false" is returned. #### MQTT client ... disconnect [![Bild9.png](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/scaled-1680-/bild9.png)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/bild9.png) MQTT client can be the block "MQTT client create" or its output in a variable. Disconnects the specified MQTT client from the MQTT broker. #### MQTT client ... publish [![Bild10.png](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/scaled-1680-/bild10.png)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/bild10.png) MQTT client can be the block "MQTT client create" or its output in a variable. Publishes a message "payload" with the specified MQTT client in a specified channel "topic". In addition, "qos" and "retain" can be specified, i.e. whether newly connected clients should receive the message after sending and with which security level the message should be sent. #### MQTT client ... publish (with return value) [![Bild11.png](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/scaled-1680-/bild11.png)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/bild11.png) MQTT client can be the block "MQTT client create" or its output in a variable. Publishes a message "payload" with the specified MQTT client in a specified channel "topic". In addition, "qos" and "retain" can be specified, i.e. whether newly connected clients should receive the message after sending and with which security level the message should be sent. If the message is sent successfully, "true" is returned, otherwise "false". #### MQTT client ... will set [![Bild12.png](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/scaled-1680-/bild12.png)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/bild12.png) MQTT client can be the block "MQTT client create" or its output in a variable. Sets the message "payload", which is to be sent after disconnecting the MQTT client in a specified channel "topic", and with which security level the message is to be sent. #### MQTT client ... subscribe [![Bild13.png](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/scaled-1680-/bild13.png)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/bild13.png) Subscribes to a channel with an MQTT client. The function to be executed when receiving a message is specified in the callback argument. "Qos" specifies the security level with which the message is to be sent. #### subscribe callback ... : message [![Bild14.png](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/scaled-1680-/bild14.png)](https://docs.fischertechnik-cloud.com/uploads/images/gallery/2022-12/bild14.png) Defines a function that is to be executed by receiving a message. Message contains the received message.