The Openmotics system supports following virtual devices:
- Virtual Inputs: For example a doorbell that sends a push notification is translated in an action that switches on a light in the house
- Virtual Outputs: For example a Philips Hue light that acts as a virtual output can be switched on by a normal switch on the Openmotics system (or a virtual switch)
- Virtual Sensors: Any non-openmotics sensors like Z-wave wireless temperature, NEST thermostat temperature and humidity, third party light sensors etc
How does all the Virtual stuff works?
The master firmware (as of F3.142.1) allows you to create virtual input modules.
Virtual inputs have the same possibilities like normal inputs: You can configure them to toggle outputs (normal and virtual), dim outputs (normal and virtual) and/or execute a list of Basic actions. The change of a virtual input will be triggered by an IP API call on the Gateway. That call will be translated to Basic Action 68 or 69 that will change the state (press or release) of a virtual input. The change of that input state will trigger the actions linked to that input.
The Openmotics system allows you to create Virtual Modules. Each Virtual Input module that has been created gives you 8 Virtual inputs. Those virtual inputs can be changed state by using Basic Action 68 (press) and 69 (release). When a virtual input change state, it will act like any normal input and the master will perform the actions programmed for this input.
See Virtual Plug-in Examples for more information how to use this in combination with the plug-in system.
Virtual Inputs (Available in firmware version 3.142.1 and higher)
As of Firmware Version F3.142.1 and higher, the master allows virtual inputs. The number of virtual input modules that can be created is only limited by the system limits (maximum 240 inputs or 30 input modules). These are the type of non-virtual modules which exist as Virtual and Normal (Non-Virtual):
- "I" -> Normal Input module
- "i" -> Virtual Input module
- "T" -> Normal Sensor module
- "R" -> Normal Roller/Shutter module
- "O" -> Normal Output Module
- "o" -> Virtual Output Module
- "D" -> Normal Dimmer Module
- "d" -> Virtual Dimmer Module
As you can see, there is no virtual alternative for the Sensor module since no Virtual Sensor module exists. The Master has 32 sensors and for each sensor, you can choose whether that sensor is Virtual or Not. For more information, see Virtual Sensors
Configure Virtual inputs
A virtual input module can be created by using following CLI instruction:
add virtual module i ;Create a Virtual input module
The created modules can be easily checked with following instruction:
error list ;Error list will indicate all modules created in the system
A virtual input module can also be created by API instruction "AV", see API Reference Guide for more details. When creating a virtual module through the API, the instruction "MI" will be sent from the Master to the BB.
To activate a press state of a Virtual Input, Basic Action 68 must be used, to release a virtual input, Basic Action 69 must be used. Basic Action 68 or 69 only works on virtual inputs, when used on a non-virtual input, nothing will happen. For more information and the different Basic Actions, see Action Types.
To press and Release a virtual Input, following CLI instructions can be used:
basic action activate 68 5 ;Press virtual input 5 basic action activate 69 5 ;Release Virtual input 5
The same can be accomplished by using API instruction "BA", see API Reference Guide for more details.