The IoTResource Catalogue provides two means to actuate on an IoTResource:
- By providing the unique identifier of a specific IoTResource
- By providing the local endpoint of a specific IoTResource
- By providing a semantic description that matches one or several IoTResource
Using identifier
The keyword is IoTResource to be supplied directly after the <catalogueendpoint> followed by the specific identifier and then the actuation expression:
http://<catalogueendpoint>/IoTResources/<IoTresourceid>/services/switch/actions/TurnOn
Using endpoint
By first calling the action GetIoTResourcesEndpoint in the catalogue service of the IoTResourceCatalogue you will be able to retrieve the local endpoint of the device and can start communicating direclty with the IoTResource. This method is recommended if you need to do a massive amount of calls to IoTResource and then you don´t have to go throught the central IoTResourceCatalogue. However, it will only work if your Application is executing in the same local network as the IoTResources.
Using Semantic Description
Provide an xpath expression directly after the <catalogueendpoint> followed by the actuation expression:
http://<catalogueendpoint>/<xpath>/services/switch/actions/TurnOn
Example
Turn on all IoTResources that are of type switchdevice:
http://<catalogueendpoint>//upnp:devicetype[contains(.,’switchdevice’)]/services/switch/actions/TurnOn
Example
Turn off all IoTResources that are from CNet and that currently consumes more than 200W.
http://<catalogueendpoint>//upnp:device[upnp:manufacturer=’CNet’][IoT:currentconsumption>200]/services/switch/actions/TurnOff
Notes
One current limitation when using semantic descriptions is that the xpath expression cannot contain the word services.