Asset Attribute with JSON Object and store data points to Line Chart

Hi Birdie,

We’re adding a filter to the asset attribute picker so you can’t select an attribute with a valuetype that does not match the widget anymore. So that should solve your initial confusion :slight_smile:

Secondly, if you are getting the data using an Agent Link, you can filter the JSON with a value filter so that you only write the value that you need, not the whole object, to the attribute. However, I believe you are using the MQTT API, so you could do the following:

  • Write the JSON to an attribute ‘A’
  • Add the attribute link configuration item to that attribute to push a filtered value to another attribute ‘B’
  • Unfortunately the attribute link does not have a nice form UI yet, so you will have to it like this:
[
  {
    "ref": {
      "id": "ASSET_ID",
      "name": "B"
    },
    "filters": [
      {
        "type": "jsonPath",
        "path": "$.main.temp",
        "returnFirst": true,
        "returnLast": false
      }
    ]
  }
]
  • Now attribute ‘B’ will have the value.

You can push to multiple attributes. See this tutorial for more info: Tutorial: Open Weather API using HTTP Agent · openremote/openremote Wiki · GitHub

There might be a better solution that I can’t quickly think of now :slight_smile:

Don

1 Like