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
- In the control center, click on the 'Add new device' option.
- From the dropdown list, select the 'Virtual device' option.
- For the device type, select 'Virtual sensor' and give it a name.
- Press ‘Save’ to add your device.
- Your device is now added and ready for use.
Triggering the Virtual Sensor:
- To manually trigger your Virtual Sensor, click on the 'Device Manager' icon.
- Under the category 'Virtual' select your Virtual sensor.
- Expand the tree by clicking 'Virtual Sensor' => 'Sensor' => 'State'.
- Click on the configure button next to 'State' category.
- Select the displayed URL of your sensor and copy it.
- Paste the URL into address bar of a new tab.
- Change the value of the URL ending string &state=
- Use &state=1 to trigger the sensor ON, or &state=0 to trigger it off.
Automating the Virtual sensor triggering:
- 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.
- Now let’s create a rule to link the Virtual Switch to our Virtual sensor.
- To create the rule, start with a 'WHEN' puzzle piece.
- Next, add the 'IF/ELSE' puzzle piece inside the 'WHEN' piece.
- Add the 'HTTP request' puzzle piece to both 'IF' and 'ELSE' sections.
- Add the 'Sensor' piece to both 'WHEN' and 'IF' parts in order to add our Virtual Switch.
- Add the Virtual Switch to our sensor pieces and set it like this: a. When [Virtual Switch] (any) b. If [Virtual Switch] (ON)
- 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.
- Synchronize the rules on your Zipabox Controller.
- Now to test the rule, try to trigger your Virtual Switch. When the switch is on, the sensor should change state to ACTIVE.
Tutorial: