Menus Available in SmoothMQTT
Gameobject
Entry | Description | When to Use |
---|---|---|
Gameobject ↳ SmoothMQTT ↳ MqttManager With Broker | Instantiates the equally-named prefab into your current scene | Run everything MQTT from within Unity |
Gameobject ↳ SmoothMQTT ↳ MqttManager Without Broker | Instantiates the equally-named prefab into your current scene | Use external Broker, e.g. smarthome, mosquitto or cloud provider |
tip
If you are unsure about using an external broker, we suggest you use the first option. If you later on decide to use an external broker, you can simply deactivate the broker component.
Tools
Entry | Description | When to Use |
---|---|---|
Tools ↳ SmoothMQTT ↳ Receive | path to the following menu entries (to declutter the table) | ... |
↳ String payload | Adds a Subscriber component with random client ID to the selected Gameobject |
|
↳ Float payload | Adds a Subscriber component with random client ID to the selected Gameobject and adds a float UniversalConverter to interpret the payload as decimal number and pass it onto components using float values |
|
↳ Int payload | Adds a Subscriber component with random client ID to the selected Gameobject and adds a int UniversalConverter to interpret the payload as whole number and pass it onto components using int values |
|
↳ Bool payload | Adds a Subscriber component with random client ID to the selected Gameobject and adds a boolean UniversalConverter to interpret the payload as truth value and pass it onto components using bool values |
|
↳ Color payload | Adds a Subscriber component with random client ID to the selected Gameobject and adds a Color UniversalConverter to interpret the payload as a color value and pass it onto components using colors |
|
↳ Vector3 payload | Adds a Subscriber component with random client ID to the selected Gameobject and adds a Vector3 UniversalConverter to interpret the payload as a vector and pass it onto components using vectors |
|
↳ Quaternion payload | Adds a Subscriber component with random client ID to the selected Gameobject and adds a Quaternion UniversalConverter to interpret the payload as a rotation and pass it onto components using quaternions |
|
-------- | -------- | -------- |
Tools ↳ SmoothMQTT ↳ Send | path to the following menu entries (to declutter the table) | ... |
↳ String payload | Adds a Publish Value component to the selected Gameobject that can be called from any UnityEvent to send string , int , float , or bool values. | Use buttons or unityevents to send arbitrary values to e.g. smart light bulbs or smart sockets. |
↳ Color payload | Adds a Publish Color component to the selected Gameobject that can be called from any UnityEvent to send a hexadecimal representation of a color. | Send color value to e.g. LEDs |
↳ Vector3 payload | Adds a Publish Vector3 component to the selected Gameobject that can be called from any UnityEvent to send the string representation of a vector. | Send vector3 value (mainly used to communicate with other SmoothMQTT components) |
↳ Quaternion payload | Adds a Publish Quaternion component to the selected Gameobject that can be called from any UnityEvent to send the string representation of a quaternion. | Send static rotation or send rotation of a transform (mainly used to communicate with other SmoothMQTT components) |
↳ TMPInputField | Adds a Publish From TMP Input Field component to the selected Gameobject that can be called from any UnityEvent to send the string representation of a quaternion. | Send content of a TextMeshPro Input Field. This component's OnSendInputField function is supposed to be called from the On End Edit event on a TMPInputField |
↳ React to UnityEvents | Adds a Send On Event component to the selected Gameobject. This component sends a static payload to the defined topic upon gameobject event triggers | This is great for click or drag events on objects in the scene. Use-cases are: click a virtual button to switch on LEDs or motors. Hover over an object and show the tooltip on a 16x2 liquid crystal display. |
↳ React to Trigger or Collision | Adds a Publish Trigger Collision component to the selected Gameobject. This component can send the description of a collision to a dynamically configurable topic | Switch on/off fans or heaters when player enters triggerzone (windy mountain top, scorchign desert). Also great for detecting object collisions and switching on alarm lights. We sincerely hope no horror game will ever use SmoothMQTT for flickering the room lights. |
Assets
Entry | Description | When to Use |
---|---|---|
Create ↳ SmoothMQTT ↳ Certificate | Creates a scriptable asset to hold information to a SSL certificate (e.g. path, password) | When you want to encrypt communication between Unity and MQTT broker through mqtts:// |
Create ↳ SmoothMQTT ↳ User Credentials | This very simple object stores a user and password to be used by the local SmoothMQTT broker | When you require username and passwords from inbound connecting clients, create one of these assets per user/password pair |