Plugin vdevice¶
Domogik Plugin for Virtual Device
Purpose¶
This plugin provides Virtual Devices to store datatype value in sensor. You just need to use the device command to update the device sensor.
There are some datatype of device available in plugin, but it will always be possible to add if necessary:
- “vdevice.number”
- “vdevice.binary”
- “vdevice.switch”
- “vdevice.openclose”
- “vdevice.startstop”
- “vdevice.motion”
- “vdevice.string”
- “vdevice.colorrgb”
- “vdevice.colorrgbhexa”
<<<<<<< HEAD¶
- “vdevice.colorcii”
- “vdevice.datetime”
>>>>>>> 2.0
Each device have a command and a sensor.
The called command will update the sensor, allowing the sensor to be update from a REST URL or a scenario.
A virtual device give a REST URL for external software to update the virtual sensor of this device:
For example,
- if a plugin in Jeedom that don’t exist in Domogik, this feature allows Jeedom to update the sensor in Domogik
- A small device like wifi ESP8266 sensor can call a Domogik VDevice URL to update the VDevice sensor
Simple example test in shell, for a virtual device with a command (id=36) and a sensor (id=217):
For update the sensor:
$ curl -s 'http://hermes:40406/rest/cmd/id/36?value=260'
The read of the sensor return the same value:
$ curl -s 'http://hermes:40406/rest/sensorhistory/id/217/last/1'; echo
[{"timestamp": 1452101182.0, "value_str": "260", "value_num": 260.0}]
This will allow an easier transition from home automation box to Domogik
Dependencies¶
No dependencies needed
Plugin configuration¶
No configuration needed for the plugin
<<<<<<< HEAD¶
Device’s type available:
>>>>>>> 2.0 Create the devices ==================
Device parameters configuration¶
There is one parameter for device configuration:
This paremeter is use to initialize sensor’s value, only if this value is empty when plugin start:
Key | Type | Description |
---|---|---|
value | Depends on the datatype | Initial value for the device’s sensor |
Start the plugin¶
You can now start the plugin (start button) and use the created devices.
Now, there is no need to restart the plugin if a device is added or updated.
Set up your widgets on the user interface¶
You can now place the widgets of your devices features on the user interface.