Adding a Virtual Sensor

This tutorial demonstrates how to add a virtual sensor trough the Zipato Control center.

Requirements: Zipato Controller

Adding the Virtual Sensor:
1.In the control center, click on the 'Add new device' option.
2.From the dropdown list, select the 'Virtual device' option.
3.For the device type, select 'Virtual sensor' and give it a name.
4.Press ‘Save’ to add your device.
5.Your device is now added and ready for use.

Triggering the Virtual Sensor:
1.To manually trigger your Virtual Sensor, click on the 'Device Manager' icon.
2.Under the category 'Virtual' select your Virtual sensor.
3.Expand the tree by clicking 'Virtual Sensor' => 'Sensor' => 'State'.
4.Click on the configure button next to 'State' category.
5.Select the displayed URL of your sensor and copy it.
6.Paste the URL into address bar of a new tab.
7.Change the value of the URL ending string &state=
8.Use &state=1 to trigger the sensor ON, or &state=0 to trigger it off.

Automating the Virtual sensor triggering:
1.To trigger the URL of our Virtual Sensor we will be using a Virtual Switch. Click on the 'Device Manager' again and add a new Virtual switch.
2.Now let’s create a rule to link the Virtual Switch to our Virtual sensor.
3.To create the rule, start with a 'WHEN' puzzle piece.
4.Next, add the 'IF/ELSE' puzzle piece inside the 'WHEN' piece.
5.Add the 'HTTP request' puzzle piece to both 'IF' and 'ELSE' sections.
6.Add the 'Sensor' piece to both 'WHEN' and 'IF' parts in order to add our Virtual Switch.
7.Add the Virtual Switch to our sensor pieces and set it like this:
    a. When [Virtual Switch] (any)
    b. If [Virtual Switch] (ON)
8.Now let’s configure the 'HTTP Request' puzzle piece:
    a. Press the configure button on the 'HTTP Request' piece.
    b. Use the GET method and paste in your Virtual Sensor URL.
    c. Change the '&state=' string to 1 on the first request and 0 on the second.
9.Synchronize the rules on your Zipabox Controller.
10.Now to test the rule, try to trigger your Virtual Switch. When the switch is on, the sensor should change state to ACTIVE.


Is article helpful?