Creating a New IOT Data Stream Device
Creating an IOT Data Stream Device ready to receive data.
Step 1 - Create a new IOT Integration Interface
When in the project, click on IOT Integrations in the left-hand main menu. If you don't see this menu, your user role does not have permission to access IOT integrations, or your Twinview subscription does not include the IOT and Analytics packages.

In the IOT Integrations modal, click 'Add' and give your IOT Integration a name, such as 'External API Services.' We must also select a Reference, which should be set to Twinview Direct Integration.
Click Save, and a new field called 'Subdomain' will appear. Enter "Ingestion" into this interface, then click Save again.

Step 2 - Create a new IOT Data Stream Device
Now that we have created our 'IOT Integration Interface,' we can add the IOT Data Streams to the integration interface. Each IOT Data Stream is a single data point, e.g., 'Temperature, Humidity, CO2, etc.'
When in the project, click 'IOT Integrations' in the left-hand menu. When the model opens, you should see the IOT interface we created in step 3.1. Click 'Devices' to show all 'IOT Data Stream 'devices set up on the interface. At the moment, we don't have any, so we must create one by clicking the 'Add' button.

Give your IOT Data Stream Device a name and make sure the 'Type' is set to 'Sensor', then click 'Save'
We strongly recommend that you define a standard naming schema for your IOT Data Stream devices. This will make them easier to recognise in the future when creating dashboards or reports that consume this data.
We recommend that the name should make it possible to know the device's location in the building by incorporating the floor level, room and asset that the IOT Data Stream is applicable to.

The IOT Data Stream Device will be created, and a new model will appear that allows you to specify the IOT Data Stream Device details. At a minimum, we need to ensure that the 'Data Type' field (1) is set correctly for the type of data you expect to receive.
You will also notice that the Edit Device modal shows the 'Endpoint' URL (3) and the request type POST. Twinview also shows an example payload structure (3).

After clicking save, we will see that the device UUID has been generated. When posting data to the Twinview Data Ingestion service, we must specify this UUID to associate the data with this IOT Device.

Even though we have just added a new IOT Data Stream Device successfully, if we tried to add the data stream to a dashboard widget, the device would not show in the list when we tried to pick it. This is because when you create a new IOT Data Stream Device, it does not yet belong to any security groups.
This behaviour is by design, such as making the device accessible before it has been applied to a security group or adding it automatically to an existing security group, meaning everyone would have access to the IOT Data Stream device.
Step 3 - Creating a new Device Security Group and associating the IOT Data Stream.
To create a new security group while in the project, go to the 'Settings ', which is accessible from the main left-hand menu.

In the Setting dialogue, click the 'Device Group' tab and then click 'Add' to create a new Device Group.

Name your device group and click 'Save' to create the Device Group. Once the Group has been created, click the 'View' button to open the device group.

On the Device group window, we first need to add the IOT Data Stream Device we created earlier to our new 'Device Group'. To do this, we click on the 'Devices' tab and then click the 'Use' bottom button against the IOT Data Stream Device we created earlier.

We have successfully assigned the IOT Data Stream Device to the Device Group. Next, we need to assign ourselves to the Device Group so that the IOT Data Stream Device will be available for us to use on widgets, dashboarding and reporting. To do this, click on the 'Users' tab and click 'Use' on your user and any other users you want to be able to access this IOT Data Stream Device.

We recommend that you consider how you want to use Device Groups on your project and plan these into your onboarding and infrastructure strategy.
Some people have a single device group, and people have only a handful but use them carefully, for example, "High-Security Devices" and "Standard Devices".
Some clients use device groups to control tenants and/or staff access to devices, and they have a device group for each tenant/apartment.