You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Fiware Orion:如何在httpCustom通知中发现属性?

Discovering Sensor Attributes for Orion Pattern-Based Subscriptions

Great question! When you're setting up Orion subscriptions that match entities using patterns (like idPattern: "*"), it's totally normal to not know all the attribute names available for your payload templates upfront. Here are practical, actionable ways to uncover those properties:

  • Query Orion for matching entities directly
    Use Orion's NGSI v2 API to fetch details of all entities that match your pattern. A simple GET request will return the full structure of these entities, including their attributes. For example, run this curl command (replace with your Orion host and port):

    curl -X GET "http://your-orion-instance:1026/v2/entities?idPattern=*"
    

    The JSON response will list each entity's attributes field—you can scan this to find property names like temperature, humidity, or pressure that you can use in your payload.

  • Narrow results with entity types (if known)
    If your sensors belong to a specific type (e.g., TemperatureSensor or SmartMeter), add a type parameter to your query to filter results and reduce noise:

    curl -X GET "http://your-orion-instance:1026/v2/entities?idPattern=*&type=TemperatureSensor"
    

    This gives you a focused list of attributes relevant to your target sensor group.

  • Simplify responses with key-value format
    To make attribute names easier to spot, add the options=keyValues parameter to your query. This returns a flattened structure where attribute names are top-level keys:

    curl -X GET "http://your-orion-instance:1026/v2/entities?idPattern=*&options=keyValues"
    

    Perfect for quickly scanning all available properties without digging through nested JSON.

  • Test with a "catch-all" payload
    Create a temporary subscription that outputs the entire entity payload using the ${@} placeholder. This lets you see exactly what data Orion sends when an event triggers. Here's an example configuration:

    {
      "subject": {
        "entities": [{"idPattern": "*"}]
      },
      "notification": {
        "httpCustom": {
          "url": "https://your-test-webhook-endpoint.com",
          "payload": "${@}"
        }
      }
    }
    

    Check the data received by your test endpoint—you'll get the full entity structure, including every available attribute you can reference in your final payload.

  • Check upstream data source docs
    If your sensors are connected via an IoT Agent (like the FIWARE IoT Agent for JSON or Ultralight), the agent's configuration or documentation will list exactly which attributes it sends to Orion. This is often the fastest way to get a definitive list of properties.

By using one or a combination of these methods, you'll be able to confidently build payload templates that reference all the right sensor attributes for your subscriptions.

内容的提问来源于stack exchange,提问作者cdupont

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 07:38:18