Create your first Meshbot (tutorial)
- Open EZlogic then click ‘Meshbot Automation’ > ‘Create New Meshbot’ > ‘Create’:
Choose ‘Local’ for now. This creates a meshbot associated with a hub on your network. See Global vs Local Meshbots if you want to know more about the difference at this point.
The next screen shows the interface to add triggers and actions to your meshbot/scene. Type a name for your meshbot in the space provided and choose the type of meshbot you want to create:
- Device – The meshbot will run the action when a device changes status. For example, if the temperature changes, or a door opens, or motion is detected. See the Device page if you need more help with this.
- Date and Time – The meshbot will activate according to a schedule of your choice, be that hourly, daily, weekly, monthly, at certain intervals, between specific times, or at sunrise/sunset. See the Date and Time page if you need more help with this.
- Expression value – An expression is a piece of code which is capable of housing various values. You can reference these values in a meshbot and use it to trigger an action.
- Meshbot – The meshbot will run based on the outcome of the actions of another meshbot. See the Meshbot page if you want more help with this.
- NOT – This means ‘if the reverse of the named condition is true then proceed’. If we clicked ‘NOT’ in the example above then it would trigger the action when the sensor did not detect motion. Similarly, if we chose ‘Wednesday’ as the trigger day, then clicked ‘NOT’, it would execute the action on all days except Wednesday.
You can apply NOT to individual conditions and trigger groups, but cannot use it to establish the connection between individual conditions.
- AND – Executes the action when the conditions of all linked triggers are met. For example, ‘When the motion sensor detects movement’ AND ‘The time is between 11 PM and 6.30 AM’:
- OR – Executes the action when any of the conditions in the linked triggers are met. For example, ‘When the motion sensor detects movement’ OR ‘The ambient noise goes above a certain level’:
- XOR – Executes the action only if exactly one of the conditions is true and all other conditions are not true. This does have its uses, but they are quite niche/advanced.
- See Operators/logic gates if you want more help with the ‘XOR’ operator.
- Device – Commands a device to perform an action if the conditions of your triggers are met.
- Meshbot — Activates a different trigger-action ruleset if the conditions of your trigger become ‘true’. Meshbots are the core building block of MiOS and use sophisticated ‘if-then’ rules to control smart-devices, send user notifications, interact with services and more. They can be a simple ‘one-task’ exercise or an orchestrated chain of commands involving many items, activities and scenes. Think of running a meshbot in your actions as like running a subroutine in a program.
- Script – Runs a Lua script to implement an action if the conditions of your triggers are met. You can find some sample scripts in a community post here. Advanced users and developers can learn more about scripts in our API documentation here.
- sendHttpRequest – Send a HTTP command via our API to retrieve information from a server to implement a custom action, or display information on your dashboard.‘GET’ requests are usually used for reading device information, and ‘POST’ requests are used for setting device parameters. ‘PUT’ is similar to ‘POST’ in that it sets or updates a parameter. However, ‘PUT’ will always replace the data at the URI IF it already exists, whereas ‘POST’ may append to the existing data. You could therefore make multiple ‘POST’ requests to the same URI to produce an additive effect, but multiple ‘PUT’ requests will simply repeat the exact same action over again. ‘DELETE’, obviously, removes the specified parameter.
- FALSE – This tab contains actions that you want to implement if the trigger is not true, or ceases to be true. For example, you set up a rule to turn on your closet dimmer light at 50% whenever the closet door is opened after sunset. This is your ‘TRUE’ action, but the light would remain on unless you specify otherwise. In the ‘FALSE’ tab you can set an action that sets the light to ‘Off’ if any of your trigger conditions are not met. In this example, these are if the door is not open (you closed the door) OR it is not after sunset.
See True / False actions if you want to learn more on this.
You can select one ‘TRUE’ and/or one ‘FALSE’ device action per row. You can specify multiple responses to a trigger by clicking the ‘Add Action’ button. For example, ‘Enable motion sensors’ AND ‘Enable Alarms’ AND ‘Enable Security Cameras’ after 11 PM.
Active – Use this switch to enable or disable the meshbot. Newly saved bots are active by default, so remember to disable them if you don’t want them to run just yet.
Run Once – Runs the meshbot until it has completed one full ‘Trigger-Action’ cycle. This runs regardless of whether the bot is ‘Active’.
Edit – Opens the meshbot editor and allows you to make modifications to the bot.
Columns – Specify what information is shown on this page. All columns are shown by default except the internal meshbot ID.
Filters – Create commands that specify which meshbots are shown in the list. For example, you can create a filter to show only bots which are active, or of the bot type ‘Cloud’, etc. You can add and activate multiple filters at once. This feature is especially useful if you have a large number of bots.
Density – Simple layout options which control how much white space is shown between each meshbot in the list. The more dense, the more meshbots are shown on a single page.
Export – Generates a .csv file of the meshbots you have listed on the current screen. The .csv reflects any filters you have applied and any modifications to the list columns.