{% set hasCapabilitySupport = igor.internal.accessControl('hasCapabilitySupport') %}

Igor Devices and Sensors

{% set user = igor.app.getSessionItem('user', None) %} {% if user %}

You are logged in as {{user}}. {% if user != 'admin' %} You may not have sufficient permissions for the commands below unless you login as user admin. {% endif %}

{% else %}

You are not logged in. This page will probably not render correctly.

{% endif %}

Igor Devices

In Igor terms, a device is something that Igor may send commands to. It exports some sort of service (for example using http or https) that Igor can contact. If something is a device as well as a sensor it will be listed amongst the devices here.

{% if hasCapabilitySupport %} {% endif %} {% set keyListData = pluginObject._keyList(callerToken) %} {% set deviceList = pluginObject._list(callerToken) %} {% for device in deviceList %} {% set name=device.get('name') %} {% set hostName = device.get('hostname', '') %} {% set hasAudSecretKey = hostName and (hostName in keyListData.allKeyAudiences or ('http://%s' % hostName) in keyListData.allKeyAudiences or ('https://%s' % hostName) in keyListData.allKeyAudiences) %} {% set hasSubSecretKey = hostName and (hostName in keyListData.allKeySubjects) %} {% if hasCapabilitySupport %} {% endif %} {% endfor %}
Name Hostname Type(s) Entry Status EntrySecret Shared keysActions OP
{{name}} {{hostName}} {% if device.get('deviceType') %} {{device.deviceType}} {% else %} {% if device.get('isDevice') %} Device
{% endif %} {% if device.get('isSensor') %} Sensor
{% endif %} {% if device.get('isPlugin') %} Plugin
{% endif %} {% endif %}
{% for ent in device.get('entry', []) %} {{ent}}
{% endfor %}
{% for ent in device.get('status', []) %} {{ent}}
{% endfor %}
{% if hasAudSecretKey %} aud={{hostName}}
{% endif %} {% if hasSubSecretKey %} sub={{hostName}}
{% endif %}
{% for action in device.get('actions', []) %} {% set actionName = igor.database.getValues(action+'/name', token=callerToken) %} {% set actionNameDisplay = actionName[0][1] if actionName else action %} {{actionNameDisplay}}
{% endfor %}
{% if hostName and igor.plugins.exists('iotsaDiscovery') %}
{% endif %} {% if hasCapabilitySupport %} {% if hostName and device.get('isDevice') and not hasAudSecretKey %}
{% endif %} {% if hostName and (device.get('isDevice') or device.get('isSensor')) and not hasSubSecretKey %}
{% endif %} {% if device.get('isSensor') or device.get('isDevice') %}
{% endif %} {% endif %}

Add Device

Add a new device or sensor to Igor:

Name User-visible name in Igor (must be an identifier)
Type ActiveDevice: Igor will send commands to this device through REST or http[s] or so
ActiveSensor: device will send commands to Igor through REST or http[s] or so
PolledSensor: Igor will poll this device to obtain sensor data
PassiveSensor: Sensor data is obtained indirectly
Hostname Needed for ActiveDevice and ActiveSensor, if needed defaults to Name.local
Plugin Plugin to support this device. Not needed for PassiveSensor.
Secured? This device supports Iotsa capabilities
Device object toplevel object on device (for capability, needed for ActiveDevice)

Add a new iotsa-based device or sensor to Igor:

Name User-visible name in Igor (must be an identifier)
Type Output only
Can trigger actions
Does this device contact Igor (through http/s get requests to actions)?
Secured? This device supports Iotsa capabilities
{% if hasCapabilitySupport %}

Secret Shared Keys

A device that wants to contact Igor needs a shared secret key with itself (the device) as subject and Igor as the audience. This key is used by the device to sign the capability, and ensures to igor that the device is the right one.

A device to which Igor needs to send requests needs a shared key with the device as audience and either no subject or Igor itself as the subject. Igor will sign capabilities with this key, and the device can confirm that the request actually comes from Igor.

Igor has the following shared secret keys:

{% for iss, aud, sub in keyListData.allKeysAsTuples %} {% endfor %}
Issuer Audience Subject OP
{{iss}} {{aud}} {{sub}}
{% endif %}
{% if returnTo %} Return to {{returnTo}}.
{% endif %} Return to device listing page.
Return to Igor homepage