|  Help center

MiOS search

Create your first Meshbot (tutorial)

This section shows you how to use Ezlogic’s query builder interface to create your first meshbot.
  • 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.
In this example we will create a simple meshbot which tells a camera to make a recording IF the motion detector detects movement under any circumstances. We therefore select ‘Device’ as the meshbot type in the first drop-down:
After selecting ‘Device’ you will see a list of your ‘trigger’ devices in the second drop-down. A change in the state of these devices can be used to trigger a response in another device. Not all devices have such ‘trigger’ capabilities. For example, alarms and sirens are purely output devices, so you won’t see them listed here.
Choose the device which you want to use to trigger the action in the target/output device. In our example, we select the device ‘VistaCam 703 … Motion Sensor’:
This activates the conditions menu underneath the device selection row. This menu shows all possible ‘IF…’ conditions that the chosen device can report to EZlogic. If the conditions are met then EZlogic tells the device in the ‘Action’ panel to take the specified action.
In our simple example, we just want to create a recording if the motion sensor detects movement under any circumstances, so we choose ‘Whenever VistaCam … detects motion whether it is armed or disarmed’:
  • 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.
You can select one ‘IF…’ condition per trigger row. You need to click the ‘Add Trigger’ button if you want to add multiple conditions before an action gets triggered. By adding a 2nd trigger you have created a ‘trigger group’. You can link the triggers in the group with ‘AND’, ‘OR’, or ‘XOR’ operators/logic gates:
  • 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.
Once you have decided on your triggers, single or multiple, you are ready to choose the response-action you want the trigger to initiate. The ‘Action’ panel is directly below the trigger(s) you just specified in the previous step.
Click ‘Add Action’ in the actions panel:
…then choose one of the following action types from the first drop-down:
  • 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.
Our simple, one-trigger example only requires a camera device to make a recording if the motion detector detects any movement, so we choose ‘Device’ as the type:
Next, choose the specific device that you want to react to the trigger, followed by the action you want it to take. In our example, we pick the device ‘VistaCam 703…’ and the action ‘make_recording’:
You can also choose whether you want to start the action immediately, or after a delay. For example, you might want to turn on the hallway lights after a short period of time rather than right away:
  • 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.

The following screen shows how you could add a second action to set the amount of time that the camera records:
Your competed rule should look something like this:
When you are happy with the triggers and actions you have created, it’s time to put the rule into action. Click the ‘Save’ button to register the Meshbot with EZlogic. The bot is ‘Active’ by default, so it’ll start working right away:
The meshbot list-screen contains various controls and information related to your bots:

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.