Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to transform MQTT payload for FROST import #2022

Open
joachimmueller opened this issue Sep 23, 2024 · 1 comment
Open

Best way to transform MQTT payload for FROST import #2022

joachimmueller opened this issue Sep 23, 2024 · 1 comment

Comments

@joachimmueller
Copy link

I try to import a MQTT stream from another NON FROST MQTT source. The payload looks like

{
  "uuid": "16508b11-4349-48f7-be51-1227b7888585",
  "number": "3770040",
  "shortname": "RHEDE",
  "state": "Deutschland",
  "region": "Niedersachsen",
  "agency": "Standort Meppen",
  "water": {
    "shortname": "DEK" 
  },
  "timeseries": {
    "uuid": "076ce109-94d6-4755-8062-8d79b1cdd4ce",
    "shortname": "W",
    "longname": "Wasserstand",
    "unit": "cm",
    "equidistance": 1.0,
    "measurement": {
      "timestamp": "2024-08-29T09:11:00+02:00",
      "value": 669.0
    }
  }
}

How can I transform the payload into a form, FROST understands?

@hylkevds
Copy link
Member

Usually one would use a little script that listens on one side, and transforms the data to push it on the other side.
It would need a function to search the correct Datastream to push to, and maybe to create that Datastream if it doesn't exist. It doesn't look like this payload has enough information to also create Things/Sensors, so those would have to be generated beforehand.

Storing those uuids in the properties would allow for an efficient search for the correct Thing/Datastream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants