FIWARE playground

This project shows the core API calls needed to set up a FIWARE IoT Agent and the Orion-LD Context Broker.
The calls:
-
provision an IoT Agent service that listens on an MQTT broker,
-
forward incoming device data to Orion-LD as NGSI-LD entities,
-
create a subscription so Orion-LD sends notifications whenever new updates arrive.
Services Used
-
FIWARE IoT-Agent JSON – FIWARE agent
-
FIWARE Orion-LD context broker - Context broker
-
EMQX broker - MQTT broker
List of used nodes
-
Inject/Timestamp – Triggers flow execution
-
Function – Adds custom logic using JavaScript
-
HTTP Request – Sends HTTP requests to external services
-
Debug – Displays messages in the debug console
-
HTTP in – Recieve HTTP messages
-
JSON - parse JSON to JS object
For details, see Node-RED Documentation |
GROUP: IoTAgent manager

This group contains five flows that let you create, list and delete IoT-Agent services and devices through simple Inject-triggered HTTP calls.
For the meaning of service and device in FIWARE—and the full set of provisioning options—see the official IoT-Agent documentation (TODO: add link).
The flows share three tab-level variables:
-
apikey – appears in the MQTT topic (/<resource>/<apikey>/…) that the IoT-Agent listens to.
-
fiwareService and fiwareServicePath – sent in the FIWARE-Service and FIWARE-ServicePath headers so you can keep data for different tenants or sub-domains separated.
All requests are made with Node-RED HTTP request nodes. If you’re new to those, check the Node-RED docs (TODO: link).
FLOW: provision iotagent service
A service in the IoT-Agent is a configuration entity that defines how the IoT-Agent interacts with the MQTT broker and the Orion-LD context broker. It specifies the API key (apikey
) used to authenticate messages, the resource path (resource
) for the MQTT topic, the context broker’s URL (cbroker
), and the default entity type (entity_type
) for devices.
For example, the following JSON object represents a service configuration:
{
"apikey": "apikey",
"resource": "",
"cbroker": "http://127.0.0.1:1027",
"entity_type": "devType"
}
This configuration allows the IoT-Agent to listen for MQTT messages on the specified resource path, authenticate them using the provided API key, and forward the data to the Orion-LD context broker. The entity_type
defines the type of entities created in the context broker for the incoming data.
FLOW: GET provisioned services
GET /iot/services
request can be used to retrieve a list of all provisioned services in the IoT-Agent.
FLOW: DELETE provisioned service
DELETE /iot/services
request is used to remove a provisioned service from the IoT-Agent. This operation requires specifying the service’s API key and other relevant details in the request. Once deleted, the service will no longer be available for handling MQTT messages or forwarding data to the context broker.
Example: DELETE /iot/services/?resource&apikey=testing
FLOW: GET provisioned devices
GET /iot/devices
This request retrieves a list of all devices provisioned in the IoT-Agent. Each device represents a physical or virtual entity that sends data to the IoT-Agent, which then forwards it to the Orion-LD context broker.
Provisioned services in the IoT-Agent create new devices by associating them with a specific service configuration. When a device is provisioned, it is linked to the service’s API key, resource path, and entity type. This ensures that the device’s data is correctly routed and stored in the context broker.
GROUP: Orion LD manager

This group contains five flows that manage entities and subscriptions in the Orion-LD context broker. Click an Inject node to send the corresponding HTTP request.
Reference material: see the official Orion-LD docs for the full NGSI-LD API (TODO: add link).
Shared flow variables
-
apikey identifies the device/API key used by the IoT Agent (carried in fiware-correlator header).
-
fiwareService tenant name → FIWARE-Service header.
-
fiwareServicePath sub-service path → FIWARE-ServicePath header.
All requests use Node-RED HTTP request nodes (TODO: link to Node-RED HTTP node docs).
FLOW: GET Orion entities
GET /ngsi-ld/v1/entities
fetches context entities—JSON-LD objects that model real-world devices, rooms, vehicles, etc.
Common query options:
/ngsi-ld/v1/entities
?idPattern=.* # regex over entity IDs
&type=Room # filter by @type
&attrs=temperature,humidity
Example to delete all entities:
GET /ngsi-ld/v1/entities?idPattern=.*
FLOW: DELETE ent
Removes a specific entity.
DELETE /ngsi-ld/v1/entities
DELETE /ngsi-ld/v1/entities/urn:ngsi-ld:Room:001
FLOW: create subscription
Creates a generic NGSI-LD subscription that forwards changes to an arbitrary HTTP endpoint.
Payload template:
{
"type": "Subscription",
"entities": [{ "type": "Room" }],
"watchedAttributes": ["temperature"],
"notification": {
"endpoint": {
"uri": "http://example.com/notify",
"accept": "application/json"
}
}
}
Change the entities, watchedAttributes, or endpoint.uri fields to suit your use-case.
FLOW: GET subs
Lists all active subscriptions.
GET /ngsi-ld/v1/subscriptions
Query example with pagination:
/ngsi-ld/v1/subscriptions?limit=20&offset=0
Each item includes its id, status, watched entities/attributes, and notification endpoint, letting you audit or debug your subscription setup.
GROUP: developer tools
This group contains five flows:
-
Init context vars – An Inject node populates the tab-level variables (apikey, fiwareService, fiwareServicePath). Click it once after deploying.
-
Receive Orion notifications – An HTTP-in/Debug pair captures the callbacks sent by the subscription in the Orion-LD manager group and prints them to the Debug panel.
3-5. Publish sample payloads – Three separate Inject → MQTT flows that push example JSON messages to the broker. Press the Inject button beside each flow to send the sample data.